2 * linux/arch/m32r/kernel/setup_mappi.c
4 * Setup routines for Renesas MAPPI Board
6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
10 #include <linux/config.h>
11 #include <linux/irq.h>
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/platform_device.h>
16 #include <asm/system.h>
20 #define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long)))
24 unsigned long icucr; /* ICU Control Register */
26 #endif /* CONFIG_SMP */
28 icu_data_t icu_data[NR_IRQS];
30 static void disable_mappi_irq(unsigned int irq)
32 unsigned long port, data;
35 data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7;
39 static void enable_mappi_irq(unsigned int irq)
41 unsigned long port, data;
44 data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6;
48 static void mask_and_ack_mappi(unsigned int irq)
50 disable_mappi_irq(irq);
53 static void end_mappi_irq(unsigned int irq)
55 enable_mappi_irq(irq);
58 static unsigned int startup_mappi_irq(unsigned int irq)
60 enable_mappi_irq(irq);
64 static void shutdown_mappi_irq(unsigned int irq)
69 outl(M32R_ICUCR_ILEVEL7, port);
72 static struct hw_interrupt_type mappi_irq_type =
74 .typename = "MAPPI-IRQ",
75 .startup = startup_mappi_irq,
76 .shutdown = shutdown_mappi_irq,
77 .enable = enable_mappi_irq,
78 .disable = disable_mappi_irq,
79 .ack = mask_and_ack_mappi,
83 void __init init_IRQ(void)
93 /* INT0 : LAN controller (RTL8019AS) */
94 irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED;
95 irq_desc[M32R_IRQ_INT0].handler = &mappi_irq_type;
96 irq_desc[M32R_IRQ_INT0].action = 0;
97 irq_desc[M32R_IRQ_INT0].depth = 1;
98 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
99 disable_mappi_irq(M32R_IRQ_INT0);
100 #endif /* CONFIG_M32R_NE2000 */
102 /* MFT2 : system timer */
103 irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
104 irq_desc[M32R_IRQ_MFT2].handler = &mappi_irq_type;
105 irq_desc[M32R_IRQ_MFT2].action = 0;
106 irq_desc[M32R_IRQ_MFT2].depth = 1;
107 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
108 disable_mappi_irq(M32R_IRQ_MFT2);
110 #ifdef CONFIG_SERIAL_M32R_SIO
111 /* SIO0_R : uart receive data */
112 irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
113 irq_desc[M32R_IRQ_SIO0_R].handler = &mappi_irq_type;
114 irq_desc[M32R_IRQ_SIO0_R].action = 0;
115 irq_desc[M32R_IRQ_SIO0_R].depth = 1;
116 icu_data[M32R_IRQ_SIO0_R].icucr = 0;
117 disable_mappi_irq(M32R_IRQ_SIO0_R);
119 /* SIO0_S : uart send data */
120 irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
121 irq_desc[M32R_IRQ_SIO0_S].handler = &mappi_irq_type;
122 irq_desc[M32R_IRQ_SIO0_S].action = 0;
123 irq_desc[M32R_IRQ_SIO0_S].depth = 1;
124 icu_data[M32R_IRQ_SIO0_S].icucr = 0;
125 disable_mappi_irq(M32R_IRQ_SIO0_S);
127 /* SIO1_R : uart receive data */
128 irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
129 irq_desc[M32R_IRQ_SIO1_R].handler = &mappi_irq_type;
130 irq_desc[M32R_IRQ_SIO1_R].action = 0;
131 irq_desc[M32R_IRQ_SIO1_R].depth = 1;
132 icu_data[M32R_IRQ_SIO1_R].icucr = 0;
133 disable_mappi_irq(M32R_IRQ_SIO1_R);
135 /* SIO1_S : uart send data */
136 irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
137 irq_desc[M32R_IRQ_SIO1_S].handler = &mappi_irq_type;
138 irq_desc[M32R_IRQ_SIO1_S].action = 0;
139 irq_desc[M32R_IRQ_SIO1_S].depth = 1;
140 icu_data[M32R_IRQ_SIO1_S].icucr = 0;
141 disable_mappi_irq(M32R_IRQ_SIO1_S);
142 #endif /* CONFIG_SERIAL_M32R_SIO */
144 #if defined(CONFIG_M32R_PCC)
145 /* INT1 : pccard0 interrupt */
146 irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED;
147 irq_desc[M32R_IRQ_INT1].handler = &mappi_irq_type;
148 irq_desc[M32R_IRQ_INT1].action = 0;
149 irq_desc[M32R_IRQ_INT1].depth = 1;
150 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD00;
151 disable_mappi_irq(M32R_IRQ_INT1);
153 /* INT2 : pccard1 interrupt */
154 irq_desc[M32R_IRQ_INT2].status = IRQ_DISABLED;
155 irq_desc[M32R_IRQ_INT2].handler = &mappi_irq_type;
156 irq_desc[M32R_IRQ_INT2].action = 0;
157 irq_desc[M32R_IRQ_INT2].depth = 1;
158 icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD00;
159 disable_mappi_irq(M32R_IRQ_INT2);
160 #endif /* CONFIG_M32RPCC */
163 #if defined(CONFIG_FB_S1D13XXX)
165 #include <video/s1d13xxxfb.h>
166 #include <asm/s1d13806.h>
168 static struct s1d13xxxfb_pdata s1d13xxxfb_data = {
169 .initregs = s1d13xxxfb_initregs,
170 .initregssize = ARRAY_SIZE(s1d13xxxfb_initregs),
171 .platform_init_video = NULL,
173 .platform_suspend_video = NULL,
174 .platform_resume_video = NULL,
178 static struct resource s1d13xxxfb_resources[] = {
180 .start = 0x10200000UL,
182 .flags = IORESOURCE_MEM,
185 .start = 0x10000000UL,
187 .flags = IORESOURCE_MEM,
191 static struct platform_device s1d13xxxfb_device = {
192 .name = S1D_DEVICENAME,
195 .platform_data = &s1d13xxxfb_data,
197 .num_resources = ARRAY_SIZE(s1d13xxxfb_resources),
198 .resource = s1d13xxxfb_resources,
201 static int __init platform_init(void)
203 platform_device_register(&s1d13xxxfb_device);
206 arch_initcall(platform_init);