initial commit with v2.6.9
[linux-2.6.9-moxart.git] / arch / arm / mach-s3c2410 / devs.c
blob7cf560caeec181c71a6615456143948295191670
1 /* linux/arch/arm/mach-s3c2410/devs.c
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * Base S3C2410 platform device definitions
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * Modifications:
13 * 29-Aug-2004 BJD Added timers 0 through 3
14 * 29-Aug-2004 BJD Changed index of devices we only have one of to -1
15 * 21-Aug-2004 BJD Added IRQ_TICK to RTC resources
16 * 18-Aug-2004 BJD Created initial version
19 #include <linux/kernel.h>
20 #include <linux/types.h>
21 #include <linux/interrupt.h>
22 #include <linux/list.h>
23 #include <linux/timer.h>
24 #include <linux/init.h>
25 #include <linux/device.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach/map.h>
29 #include <asm/mach/irq.h>
31 #include <asm/hardware.h>
32 #include <asm/io.h>
33 #include <asm/irq.h>
35 #include "devs.h"
37 /* USB Host Controller */
39 static struct resource s3c_usb_resource[] = {
40 [0] = {
41 .start = S3C2410_PA_USBHOST,
42 .end = S3C2410_PA_USBHOST + S3C2410_SZ_USBHOST,
43 .flags = IORESOURCE_MEM,
45 [1] = {
46 .start = IRQ_USBH,
47 .end = IRQ_USBH,
48 .flags = IORESOURCE_IRQ,
52 static u64 s3c_device_usb_dmamask = 0xffffffffUL;
54 struct platform_device s3c_device_usb = {
55 .name = "s3c2410-ohci",
56 .id = -1,
57 .num_resources = ARRAY_SIZE(s3c_usb_resource),
58 .resource = s3c_usb_resource,
59 .dev = {
60 .dma_mask = &s3c_device_usb_dmamask,
61 .coherent_dma_mask = 0xffffffffUL
65 EXPORT_SYMBOL(s3c_device_usb);
67 /* LCD Controller */
69 static struct resource s3c_lcd_resource[] = {
70 [0] = {
71 .start = S3C2410_PA_LCD,
72 .end = S3C2410_PA_LCD + S3C2410_SZ_LCD,
73 .flags = IORESOURCE_MEM,
75 [1] = {
76 .start = IRQ_LCD,
77 .end = IRQ_LCD,
78 .flags = IORESOURCE_IRQ,
83 static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
85 struct platform_device s3c_device_lcd = {
86 .name = "s3c2410-lcd",
87 .id = -1,
88 .num_resources = ARRAY_SIZE(s3c_lcd_resource),
89 .resource = s3c_lcd_resource,
90 .dev = {
91 .dma_mask = &s3c_device_lcd_dmamask,
92 .coherent_dma_mask = 0xffffffffUL
96 EXPORT_SYMBOL(s3c_device_lcd);
98 /* NAND Controller */
100 static struct resource s3c_nand_resource[] = {
101 [0] = {
102 .start = S3C2410_PA_NAND,
103 .end = S3C2410_PA_NAND + S3C2410_SZ_NAND,
104 .flags = IORESOURCE_MEM,
108 struct platform_device s3c_device_nand = {
109 .name = "s3c2410-nand",
110 .id = -1,
111 .num_resources = ARRAY_SIZE(s3c_nand_resource),
112 .resource = s3c_nand_resource,
115 EXPORT_SYMBOL(s3c_device_nand);
117 /* USB Device (Gadget)*/
119 static struct resource s3c_usbgadget_resource[] = {
120 [0] = {
121 .start = S3C2410_PA_USBDEV,
122 .end = S3C2410_PA_USBDEV + S3C2410_SZ_USBDEV,
123 .flags = IORESOURCE_MEM,
125 [1] = {
126 .start = IRQ_USBD,
127 .end = IRQ_USBD,
128 .flags = IORESOURCE_IRQ,
133 struct platform_device s3c_device_usbgadget = {
134 .name = "s3c2410-usbgadget",
135 .id = -1,
136 .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
137 .resource = s3c_usbgadget_resource,
140 EXPORT_SYMBOL(s3c_device_usbgadget);
142 /* Watchdog */
144 static struct resource s3c_wdt_resource[] = {
145 [0] = {
146 .start = S3C2410_PA_WATCHDOG,
147 .end = S3C2410_PA_WATCHDOG + S3C2410_SZ_WATCHDOG,
148 .flags = IORESOURCE_MEM,
150 [1] = {
151 .start = IRQ_WDT,
152 .end = IRQ_WDT,
153 .flags = IORESOURCE_IRQ,
158 struct platform_device s3c_device_wdt = {
159 .name = "s3c2410-wdt",
160 .id = -1,
161 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
162 .resource = s3c_wdt_resource,
165 EXPORT_SYMBOL(s3c_device_wdt);
167 /* I2C */
169 static struct resource s3c_i2c_resource[] = {
170 [0] = {
171 .start = S3C2410_PA_IIC,
172 .end = S3C2410_PA_IIC + S3C2410_SZ_IIC,
173 .flags = IORESOURCE_MEM,
175 [1] = {
176 .start = IRQ_IIC,
177 .end = IRQ_IIC,
178 .flags = IORESOURCE_IRQ,
183 struct platform_device s3c_device_i2c = {
184 .name = "s3c2410-i2c",
185 .id = -1,
186 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
187 .resource = s3c_i2c_resource,
190 EXPORT_SYMBOL(s3c_device_i2c);
192 /* IIS */
194 static struct resource s3c_iis_resource[] = {
195 [0] = {
196 .start = S3C2410_PA_IIS,
197 .end = S3C2410_PA_IIS + S3C2410_SZ_IIS,
198 .flags = IORESOURCE_MEM,
202 static u64 s3c_device_iis_dmamask = 0xffffffffUL;
204 struct platform_device s3c_device_iis = {
205 .name = "s3c2410-iis",
206 .id = -1,
207 .num_resources = ARRAY_SIZE(s3c_iis_resource),
208 .resource = s3c_iis_resource,
209 .dev = {
210 .dma_mask = &s3c_device_iis_dmamask,
211 .coherent_dma_mask = 0xffffffffUL
215 EXPORT_SYMBOL(s3c_device_iis);
217 /* RTC */
219 static struct resource s3c_rtc_resource[] = {
220 [0] = {
221 .start = S3C2410_PA_RTC,
222 .end = S3C2410_PA_RTC + 0xff,
223 .flags = IORESOURCE_MEM,
225 [1] = {
226 .start = IRQ_RTC,
227 .end = IRQ_RTC,
228 .flags = IORESOURCE_IRQ,
230 [2] = {
231 .start = IRQ_TICK,
232 .end = IRQ_TICK,
233 .flags = IORESOURCE_IRQ
237 struct platform_device s3c_device_rtc = {
238 .name = "s3c2410-rtc",
239 .id = -1,
240 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
241 .resource = s3c_rtc_resource,
244 EXPORT_SYMBOL(s3c_device_rtc);
246 /* ADC */
248 static struct resource s3c_adc_resource[] = {
249 [0] = {
250 .start = S3C2410_PA_ADC,
251 .end = S3C2410_PA_ADC + S3C2410_SZ_ADC,
252 .flags = IORESOURCE_MEM,
254 [1] = {
255 .start = IRQ_TC,
256 .end = IRQ_ADC,
257 .flags = IORESOURCE_IRQ,
262 struct platform_device s3c_device_adc = {
263 .name = "s3c2410-adc",
264 .id = -1,
265 .num_resources = ARRAY_SIZE(s3c_adc_resource),
266 .resource = s3c_adc_resource,
269 /* SDI */
271 static struct resource s3c_sdi_resource[] = {
272 [0] = {
273 .start = S3C2410_PA_SDI,
274 .end = S3C2410_PA_SDI + S3C2410_SZ_SDI,
275 .flags = IORESOURCE_MEM,
277 [1] = {
278 .start = IRQ_SDI,
279 .end = IRQ_SDI,
280 .flags = IORESOURCE_IRQ,
285 struct platform_device s3c_device_sdi = {
286 .name = "s3c2410-sdi",
287 .id = -1,
288 .num_resources = ARRAY_SIZE(s3c_sdi_resource),
289 .resource = s3c_sdi_resource,
292 EXPORT_SYMBOL(s3c_device_sdi);
294 /* SPI (0) */
296 static struct resource s3c_spi0_resource[] = {
297 [0] = {
298 .start = S3C2410_PA_SPI,
299 .end = S3C2410_PA_SPI + 0x1f,
300 .flags = IORESOURCE_MEM,
302 [1] = {
303 .start = IRQ_SPI0,
304 .end = IRQ_SPI0,
305 .flags = IORESOURCE_IRQ,
310 struct platform_device s3c_device_spi0 = {
311 .name = "s3c2410-spi",
312 .id = 0,
313 .num_resources = ARRAY_SIZE(s3c_spi0_resource),
314 .resource = s3c_spi0_resource,
317 EXPORT_SYMBOL(s3c_device_spi0);
319 /* SPI (1) */
321 static struct resource s3c_spi1_resource[] = {
322 [0] = {
323 .start = S3C2410_PA_SPI + 0x20,
324 .end = S3C2410_PA_SPI + 0x20 + 0x1f,
325 .flags = IORESOURCE_MEM,
327 [1] = {
328 .start = IRQ_SPI1,
329 .end = IRQ_SPI1,
330 .flags = IORESOURCE_IRQ,
335 struct platform_device s3c_device_spi1 = {
336 .name = "s3c2410-spi",
337 .id = 1,
338 .num_resources = ARRAY_SIZE(s3c_spi1_resource),
339 .resource = s3c_spi1_resource,
342 EXPORT_SYMBOL(s3c_device_spi1);
344 /* pwm timer blocks */
346 static struct resource s3c_timer0_resource[] = {
347 [0] = {
348 .start = S3C2410_PA_TIMER + 0x0C,
349 .end = S3C2410_PA_TIMER + 0x0C + 0xB,
350 .flags = IORESOURCE_MEM,
352 [1] = {
353 .start = IRQ_TIMER0,
354 .end = IRQ_TIMER0,
355 .flags = IORESOURCE_IRQ,
360 struct platform_device s3c_device_timer0 = {
361 .name = "s3c2410-timer",
362 .id = 0,
363 .num_resources = ARRAY_SIZE(s3c_timer0_resource),
364 .resource = s3c_timer0_resource,
367 EXPORT_SYMBOL(s3c_device_timer0);
369 /* timer 1 */
371 static struct resource s3c_timer1_resource[] = {
372 [0] = {
373 .start = S3C2410_PA_TIMER + 0x18,
374 .end = S3C2410_PA_TIMER + 0x23,
375 .flags = IORESOURCE_MEM,
377 [1] = {
378 .start = IRQ_TIMER1,
379 .end = IRQ_TIMER1,
380 .flags = IORESOURCE_IRQ,
385 struct platform_device s3c_device_timer1 = {
386 .name = "s3c2410-timer",
387 .id = 1,
388 .num_resources = ARRAY_SIZE(s3c_timer1_resource),
389 .resource = s3c_timer1_resource,
392 EXPORT_SYMBOL(s3c_device_timer1);
394 /* timer 2 */
396 static struct resource s3c_timer2_resource[] = {
397 [0] = {
398 .start = S3C2410_PA_TIMER + 0x24,
399 .end = S3C2410_PA_TIMER + 0x2F,
400 .flags = IORESOURCE_MEM,
402 [1] = {
403 .start = IRQ_TIMER2,
404 .end = IRQ_TIMER2,
405 .flags = IORESOURCE_IRQ,
410 struct platform_device s3c_device_timer2 = {
411 .name = "s3c2410-timer",
412 .id = 2,
413 .num_resources = ARRAY_SIZE(s3c_timer2_resource),
414 .resource = s3c_timer2_resource,
417 EXPORT_SYMBOL(s3c_device_timer2);
419 /* timer 3 */
421 static struct resource s3c_timer3_resource[] = {
422 [0] = {
423 .start = S3C2410_PA_TIMER + 0x30,
424 .end = S3C2410_PA_TIMER + 0x3B,
425 .flags = IORESOURCE_MEM,
427 [1] = {
428 .start = IRQ_TIMER3,
429 .end = IRQ_TIMER3,
430 .flags = IORESOURCE_IRQ,
435 struct platform_device s3c_device_timer3 = {
436 .name = "s3c2410-timer",
437 .id = 3,
438 .num_resources = ARRAY_SIZE(s3c_timer3_resource),
439 .resource = s3c_timer3_resource,
442 EXPORT_SYMBOL(s3c_device_timer3);