blob: 1053e1cb7401771160f98a306ab0d59cade65016 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Hirokazu Takata3264f972007-08-01 21:09:31 +09002 * linux/arch/m32r/platforms/m32700ut/setup.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * Setup routines for Renesas M32700UT Board
5 *
Hirokazu Takata316240f2005-07-07 17:59:32 -07006 * Copyright (c) 2002-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto, Takeo Takahashi
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 *
9 * This file is subject to the terms and conditions of the GNU General
10 * Public License. See the file "COPYING" in the main directory of this
11 * archive for more details.
12 */
13
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#include <linux/irq.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010017#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
19#include <asm/system.h>
20#include <asm/m32r.h>
21#include <asm/io.h>
22
23/*
24 * M32700 Interrupt Control Unit (Level 1)
25 */
26#define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long)))
27
Al Viroc51d9942005-08-23 22:47:22 +010028icu_data_t icu_data[M32700UT_NUM_CPU_IRQ];
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
30static void disable_m32700ut_irq(unsigned int irq)
31{
32 unsigned long port, data;
33
34 port = irq2port(irq);
35 data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7;
36 outl(data, port);
37}
38
39static void enable_m32700ut_irq(unsigned int irq)
40{
41 unsigned long port, data;
42
43 port = irq2port(irq);
44 data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6;
45 outl(data, port);
46}
47
Thomas Gleixner364a9ba2011-01-11 10:43:49 +010048static void mask_m32700ut(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -070049{
Thomas Gleixner364a9ba2011-01-11 10:43:49 +010050 disable_m32700ut_irq(data->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051}
52
Thomas Gleixner364a9ba2011-01-11 10:43:49 +010053static void unmask_m32700ut(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -070054{
Thomas Gleixner364a9ba2011-01-11 10:43:49 +010055 enable_m32700ut_irq(data->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -070056}
57
Thomas Gleixner364a9ba2011-01-11 10:43:49 +010058static void shutdown_m32700ut(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -070059{
60 unsigned long port;
61
Thomas Gleixner364a9ba2011-01-11 10:43:49 +010062 port = irq2port(data->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 outl(M32R_ICUCR_ILEVEL7, port);
64}
65
Thomas Gleixner189e91f2009-06-16 15:33:26 -070066static struct irq_chip m32700ut_irq_type =
Linus Torvalds1da177e2005-04-16 15:20:36 -070067{
Thomas Gleixner364a9ba2011-01-11 10:43:49 +010068 .name = "M32700UT-IRQ",
69 .irq_shutdown = shutdown_m32700ut,
70 .irq_mask = mask_m32700ut,
71 .irq_unmask = unmask_m32700ut
Linus Torvalds1da177e2005-04-16 15:20:36 -070072};
73
74/*
75 * Interrupt Control Unit of PLD on M32700UT (Level 2)
76 */
77#define irq2pldirq(x) ((x) - M32700UT_PLD_IRQ_BASE)
78#define pldirq2port(x) (unsigned long)((int)PLD_ICUCR1 + \
79 (((x) - 1) * sizeof(unsigned short)))
80
81typedef struct {
82 unsigned short icucr; /* ICU Control Register */
83} pld_icu_data_t;
84
85static pld_icu_data_t pld_icu_data[M32700UT_NUM_PLD_IRQ];
86
87static void disable_m32700ut_pld_irq(unsigned int irq)
88{
89 unsigned long port, data;
90 unsigned int pldirq;
91
92 pldirq = irq2pldirq(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 port = pldirq2port(pldirq);
94 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7;
95 outw(data, port);
96}
97
98static void enable_m32700ut_pld_irq(unsigned int irq)
99{
100 unsigned long port, data;
101 unsigned int pldirq;
102
103 pldirq = irq2pldirq(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 port = pldirq2port(pldirq);
105 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6;
106 outw(data, port);
107}
108
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100109static void mask_m32700ut_pld(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110{
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100111 disable_m32700ut_pld_irq(data->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112}
113
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100114static void unmask_m32700ut_pld(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115{
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100116 enable_m32700ut_pld_irq(data->irq);
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100117 enable_m32700ut_irq(M32R_IRQ_INT1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118}
119
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100120static void shutdown_m32700ut_pld_irq(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121{
122 unsigned long port;
123 unsigned int pldirq;
124
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100125 pldirq = irq2pldirq(data->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126 port = pldirq2port(pldirq);
127 outw(PLD_ICUCR_ILEVEL7, port);
128}
129
Thomas Gleixner189e91f2009-06-16 15:33:26 -0700130static struct irq_chip m32700ut_pld_irq_type =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131{
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100132 .name = "M32700UT-PLD-IRQ",
133 .irq_shutdown = shutdown_m32700ut_pld_irq,
134 .irq_mask = mask_m32700ut_pld,
135 .irq_unmask = unmask_m32700ut_pld,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136};
137
138/*
139 * Interrupt Control Unit of PLD on M32700UT-LAN (Level 2)
140 */
141#define irq2lanpldirq(x) ((x) - M32700UT_LAN_PLD_IRQ_BASE)
142#define lanpldirq2port(x) (unsigned long)((int)M32700UT_LAN_ICUCR1 + \
143 (((x) - 1) * sizeof(unsigned short)))
144
145static pld_icu_data_t lanpld_icu_data[M32700UT_NUM_LAN_PLD_IRQ];
146
147static void disable_m32700ut_lanpld_irq(unsigned int irq)
148{
149 unsigned long port, data;
150 unsigned int pldirq;
151
152 pldirq = irq2lanpldirq(irq);
153 port = lanpldirq2port(pldirq);
154 data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7;
155 outw(data, port);
156}
157
158static void enable_m32700ut_lanpld_irq(unsigned int irq)
159{
160 unsigned long port, data;
161 unsigned int pldirq;
162
163 pldirq = irq2lanpldirq(irq);
164 port = lanpldirq2port(pldirq);
165 data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6;
166 outw(data, port);
167}
168
Thomas Gleixner72bd1982011-01-19 18:14:21 +0100169static void mask_m32700ut_lanpld(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170{
Thomas Gleixner72bd1982011-01-19 18:14:21 +0100171 disable_m32700ut_lanpld_irq(data->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172}
173
Thomas Gleixner72bd1982011-01-19 18:14:21 +0100174static void unmask_m32700ut_lanpld(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175{
Thomas Gleixner72bd1982011-01-19 18:14:21 +0100176 enable_m32700ut_lanpld_irq(data->irq);
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100177 enable_m32700ut_irq(M32R_IRQ_INT0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178}
179
Thomas Gleixner72bd1982011-01-19 18:14:21 +0100180static void shutdown_m32700ut_lanpld(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181{
182 unsigned long port;
183 unsigned int pldirq;
184
Thomas Gleixner72bd1982011-01-19 18:14:21 +0100185 pldirq = irq2lanpldirq(data->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186 port = lanpldirq2port(pldirq);
187 outw(PLD_ICUCR_ILEVEL7, port);
188}
189
Thomas Gleixner189e91f2009-06-16 15:33:26 -0700190static struct irq_chip m32700ut_lanpld_irq_type =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191{
Thomas Gleixner72bd1982011-01-19 18:14:21 +0100192 .name = "M32700UT-PLD-LAN-IRQ",
193 .irq_shutdown = shutdown_m32700ut_lanpld,
194 .irq_mask = mask_m32700ut_lanpld,
195 .irq_unmask = unmask_m32700ut_lanpld,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196};
197
198/*
199 * Interrupt Control Unit of PLD on M32700UT-LCD (Level 2)
200 */
201#define irq2lcdpldirq(x) ((x) - M32700UT_LCD_PLD_IRQ_BASE)
202#define lcdpldirq2port(x) (unsigned long)((int)M32700UT_LCD_ICUCR1 + \
203 (((x) - 1) * sizeof(unsigned short)))
204
205static pld_icu_data_t lcdpld_icu_data[M32700UT_NUM_LCD_PLD_IRQ];
206
207static void disable_m32700ut_lcdpld_irq(unsigned int irq)
208{
209 unsigned long port, data;
210 unsigned int pldirq;
211
212 pldirq = irq2lcdpldirq(irq);
213 port = lcdpldirq2port(pldirq);
214 data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7;
215 outw(data, port);
216}
217
218static void enable_m32700ut_lcdpld_irq(unsigned int irq)
219{
220 unsigned long port, data;
221 unsigned int pldirq;
222
223 pldirq = irq2lcdpldirq(irq);
224 port = lcdpldirq2port(pldirq);
225 data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6;
226 outw(data, port);
227}
228
Thomas Gleixner37808e42011-01-19 18:19:42 +0100229static void mask_m32700ut_lcdpld(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230{
Thomas Gleixner37808e42011-01-19 18:19:42 +0100231 disable_m32700ut_lcdpld_irq(data->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232}
233
Thomas Gleixner37808e42011-01-19 18:19:42 +0100234static void unmask_m32700ut_lcdpld(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235{
Thomas Gleixner37808e42011-01-19 18:19:42 +0100236 enable_m32700ut_lcdpld_irq(data->irq);
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100237 enable_m32700ut_irq(M32R_IRQ_INT2);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238}
239
Thomas Gleixner37808e42011-01-19 18:19:42 +0100240static void shutdown_m32700ut_lcdpld(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241{
242 unsigned long port;
243 unsigned int pldirq;
244
Thomas Gleixner37808e42011-01-19 18:19:42 +0100245 pldirq = irq2lcdpldirq(data->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246 port = lcdpldirq2port(pldirq);
247 outw(PLD_ICUCR_ILEVEL7, port);
248}
249
Thomas Gleixner189e91f2009-06-16 15:33:26 -0700250static struct irq_chip m32700ut_lcdpld_irq_type =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251{
Thomas Gleixner37808e42011-01-19 18:19:42 +0100252 .name = "M32700UT-PLD-LCD-IRQ",
253 .irq_shutdown = shutdown_m32700ut_lcdpld,
254 .irq_mask = mask_m32700ut_lcdpld,
255 .irq_unmask = unmask_m32700ut_lcdpld,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256};
257
258void __init init_IRQ(void)
259{
260#if defined(CONFIG_SMC91X)
261 /* INT#0: LAN controller on M32700UT-LAN (SMC91C111)*/
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100262 irq_set_chip_and_handler(M32700UT_LAN_IRQ_LAN,
Thomas Gleixner72bd1982011-01-19 18:14:21 +0100263 &m32700ut_lanpld_irq_type, handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264 lanpld_icu_data[irq2lanpldirq(M32700UT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */
265 disable_m32700ut_lanpld_irq(M32700UT_LAN_IRQ_LAN);
266#endif /* CONFIG_SMC91X */
267
268 /* MFT2 : system timer */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100269 irq_set_chip_and_handler(M32R_IRQ_MFT2, &m32700ut_irq_type,
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100270 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
272 disable_m32700ut_irq(M32R_IRQ_MFT2);
273
274 /* SIO0 : receive */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100275 irq_set_chip_and_handler(M32R_IRQ_SIO0_R, &m32700ut_irq_type,
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100276 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 icu_data[M32R_IRQ_SIO0_R].icucr = 0;
278 disable_m32700ut_irq(M32R_IRQ_SIO0_R);
279
280 /* SIO0 : send */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100281 irq_set_chip_and_handler(M32R_IRQ_SIO0_S, &m32700ut_irq_type,
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100282 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283 icu_data[M32R_IRQ_SIO0_S].icucr = 0;
284 disable_m32700ut_irq(M32R_IRQ_SIO0_S);
285
286 /* SIO1 : receive */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100287 irq_set_chip_and_handler(M32R_IRQ_SIO1_R, &m32700ut_irq_type,
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100288 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289 icu_data[M32R_IRQ_SIO1_R].icucr = 0;
290 disable_m32700ut_irq(M32R_IRQ_SIO1_R);
291
292 /* SIO1 : send */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100293 irq_set_chip_and_handler(M32R_IRQ_SIO1_S, &m32700ut_irq_type,
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100294 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295 icu_data[M32R_IRQ_SIO1_S].icucr = 0;
296 disable_m32700ut_irq(M32R_IRQ_SIO1_S);
297
298 /* DMA1 : */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100299 irq_set_chip_and_handler(M32R_IRQ_DMA1, &m32700ut_irq_type,
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100300 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700301 icu_data[M32R_IRQ_DMA1].icucr = 0;
302 disable_m32700ut_irq(M32R_IRQ_DMA1);
303
304#ifdef CONFIG_SERIAL_M32R_PLDSIO
305 /* INT#1: SIO0 Receive on PLD */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100306 irq_set_chip_and_handler(PLD_IRQ_SIO0_RCV, &m32700ut_pld_irq_type,
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100307 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03;
309 disable_m32700ut_pld_irq(PLD_IRQ_SIO0_RCV);
310
311 /* INT#1: SIO0 Send on PLD */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100312 irq_set_chip_and_handler(PLD_IRQ_SIO0_SND, &m32700ut_pld_irq_type,
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100313 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03;
315 disable_m32700ut_pld_irq(PLD_IRQ_SIO0_SND);
316#endif /* CONFIG_SERIAL_M32R_PLDSIO */
317
318 /* INT#1: CFC IREQ on PLD */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100319 irq_set_chip_and_handler(PLD_IRQ_CFIREQ, &m32700ut_pld_irq_type,
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100320 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321 pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* 'L' level sense */
322 disable_m32700ut_pld_irq(PLD_IRQ_CFIREQ);
323
324 /* INT#1: CFC Insert on PLD */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100325 irq_set_chip_and_handler(PLD_IRQ_CFC_INSERT, &m32700ut_pld_irq_type,
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100326 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00; /* 'L' edge sense */
328 disable_m32700ut_pld_irq(PLD_IRQ_CFC_INSERT);
329
330 /* INT#1: CFC Eject on PLD */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100331 irq_set_chip_and_handler(PLD_IRQ_CFC_EJECT, &m32700ut_pld_irq_type,
Thomas Gleixner63b549b2011-01-19 17:41:51 +0100332 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */
334 disable_m32700ut_pld_irq(PLD_IRQ_CFC_EJECT);
335
336 /*
337 * INT0# is used for LAN, DIO
338 * We enable it here.
339 */
340 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11;
341 enable_m32700ut_irq(M32R_IRQ_INT0);
342
343 /*
344 * INT1# is used for UART, MMC, CF Controller in FPGA.
345 * We enable it here.
346 */
347 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11;
348 enable_m32700ut_irq(M32R_IRQ_INT1);
349
350#if defined(CONFIG_USB)
351 outw(USBCR_OTGS, USBCR); /* USBCR: non-OTG */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100352 irq_set_chip_and_handler(M32700UT_LCD_IRQ_USB_INT1,
Thomas Gleixner37808e42011-01-19 18:19:42 +0100353 &m32700ut_lcdpld_irq_type, handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354
Thomas Gleixner863018a2010-09-22 19:13:16 +0200355 lcdpld_icu_data[irq2lcdpldirq(M32700UT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */
356 disable_m32700ut_lcdpld_irq(M32700UT_LCD_IRQ_USB_INT1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357#endif
358 /*
359 * INT2# is used for BAT, USB, AUDIO
360 * We enable it here.
361 */
362 icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01;
363 enable_m32700ut_irq(M32R_IRQ_INT2);
364
Hirokazu Takata316240f2005-07-07 17:59:32 -0700365#if defined(CONFIG_VIDEO_M32R_AR)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366 /*
367 * INT3# is used for AR
368 */
Thomas Gleixner27e5c5a2011-03-24 17:32:45 +0100369 irq_set_chip_and_handler(M32R_IRQ_INT3, &m32700ut_irq_type,
Thomas Gleixner364a9ba2011-01-11 10:43:49 +0100370 handle_level_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700371 icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
372 disable_m32700ut_irq(M32R_IRQ_INT3);
Hirokazu Takata316240f2005-07-07 17:59:32 -0700373#endif /* CONFIG_VIDEO_M32R_AR */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374}
375
Hirokazu Takata316240f2005-07-07 17:59:32 -0700376#if defined(CONFIG_SMC91X)
377
Linus Torvalds1da177e2005-04-16 15:20:36 -0700378#define LAN_IOSTART 0x300
379#define LAN_IOEND 0x320
380static struct resource smc91x_resources[] = {
381 [0] = {
382 .start = (LAN_IOSTART),
383 .end = (LAN_IOEND),
384 .flags = IORESOURCE_MEM,
385 },
386 [1] = {
387 .start = M32700UT_LAN_IRQ_LAN,
388 .end = M32700UT_LAN_IRQ_LAN,
389 .flags = IORESOURCE_IRQ,
390 }
391};
392
393static struct platform_device smc91x_device = {
394 .name = "smc91x",
395 .id = 0,
396 .num_resources = ARRAY_SIZE(smc91x_resources),
397 .resource = smc91x_resources,
398};
Hirokazu Takata316240f2005-07-07 17:59:32 -0700399#endif
400
401#if defined(CONFIG_FB_S1D13XXX)
402
403#include <video/s1d13xxxfb.h>
404#include <asm/s1d13806.h>
405
406static struct s1d13xxxfb_pdata s1d13xxxfb_data = {
407 .initregs = s1d13xxxfb_initregs,
408 .initregssize = ARRAY_SIZE(s1d13xxxfb_initregs),
409 .platform_init_video = NULL,
410#ifdef CONFIG_PM
411 .platform_suspend_video = NULL,
412 .platform_resume_video = NULL,
413#endif
414};
415
416static struct resource s1d13xxxfb_resources[] = {
417 [0] = {
418 .start = 0x10600000UL,
419 .end = 0x1073FFFFUL,
420 .flags = IORESOURCE_MEM,
421 },
422 [1] = {
423 .start = 0x10400000UL,
424 .end = 0x104001FFUL,
425 .flags = IORESOURCE_MEM,
426 }
427};
428
429static struct platform_device s1d13xxxfb_device = {
430 .name = S1D_DEVICENAME,
431 .id = 0,
432 .dev = {
433 .platform_data = &s1d13xxxfb_data,
434 },
435 .num_resources = ARRAY_SIZE(s1d13xxxfb_resources),
436 .resource = s1d13xxxfb_resources,
437};
438#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439
440static int __init platform_init(void)
441{
Hirokazu Takata316240f2005-07-07 17:59:32 -0700442#if defined(CONFIG_SMC91X)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443 platform_device_register(&smc91x_device);
Hirokazu Takata316240f2005-07-07 17:59:32 -0700444#endif
445#if defined(CONFIG_FB_S1D13XXX)
446 platform_device_register(&s1d13xxxfb_device);
447#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 return 0;
449}
450arch_initcall(platform_init);