2006-09-27 10:41:31 +02:00
|
|
|
/*
|
|
|
|
* arch/sh/boards/shmin/setup.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Takashi YOSHII
|
|
|
|
*
|
|
|
|
* SHMIN Support.
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
2007-06-15 11:56:19 +02:00
|
|
|
#include <linux/irq.h>
|
2006-09-27 10:41:31 +02:00
|
|
|
#include <asm/machvec.h>
|
2006-10-19 09:16:18 +02:00
|
|
|
#include <asm/shmin.h>
|
2006-09-27 10:41:31 +02:00
|
|
|
#include <asm/clock.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
|
2006-12-25 10:35:24 +01:00
|
|
|
#define PFC_PHCR 0xa400010eUL
|
2007-02-07 05:54:39 +01:00
|
|
|
#define INTC_ICR1 0xa4000010UL
|
2006-12-25 10:35:24 +01:00
|
|
|
#define INTC_IPRC 0xa4000016UL
|
|
|
|
|
2007-06-15 11:56:19 +02:00
|
|
|
static struct ipr_data ipr_irq_table[] = {
|
|
|
|
{ 32, 0, 0, 0 },
|
|
|
|
{ 33, 0, 4, 0 },
|
|
|
|
{ 34, 0, 8, 8 },
|
|
|
|
{ 35, 0, 12, 0 },
|
|
|
|
};
|
|
|
|
|
|
|
|
static unsigned long ipr_offsets[] = {
|
|
|
|
INTC_IPRC,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct ipr_desc ipr_irq_desc = {
|
|
|
|
.ipr_offsets = ipr_offsets,
|
|
|
|
.nr_offsets = ARRAY_SIZE(ipr_offsets),
|
|
|
|
|
|
|
|
.ipr_data = ipr_irq_table,
|
|
|
|
.nr_irqs = ARRAY_SIZE(ipr_irq_table),
|
|
|
|
|
|
|
|
.chip = {
|
|
|
|
.name = "IPR-shmin",
|
|
|
|
},
|
2006-12-25 10:35:24 +01:00
|
|
|
};
|
2006-09-27 10:41:31 +02:00
|
|
|
|
|
|
|
static void __init init_shmin_irq(void)
|
|
|
|
{
|
|
|
|
ctrl_outw(0x2a00, PFC_PHCR); // IRQ0-3=IRQ
|
|
|
|
ctrl_outw(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active.
|
2007-06-15 11:56:19 +02:00
|
|
|
register_ipr_controller(&ipr_irq_desc);
|
2006-09-27 10:41:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size)
|
|
|
|
{
|
|
|
|
static int dummy;
|
|
|
|
|
|
|
|
if ((port & ~0x1f) == SHMIN_NE_BASE)
|
|
|
|
return (void __iomem *)(SHMIN_IO_BASE + port);
|
|
|
|
|
|
|
|
dummy = 0;
|
|
|
|
|
|
|
|
return &dummy;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2007-05-15 08:19:34 +02:00
|
|
|
static struct sh_machine_vector mv_shmin __initmv = {
|
2006-09-27 11:17:31 +02:00
|
|
|
.mv_name = "SHMIN",
|
2006-09-27 10:41:31 +02:00
|
|
|
.mv_init_irq = init_shmin_irq,
|
|
|
|
.mv_ioport_map = shmin_ioport_map,
|
|
|
|
};
|