[PATCH] USB: unusual_devs entry for Nokia N80
[linux-2.6/suspend2-2.6.18.git] / arch / arm / mach-s3c2410 / devs.c
blobad3845e329ba26d8af79d6e50c6e878694dcca68
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 * 15-Jan-2006 LCVR Using S3C24XX_PA_##x macro for common S3C24XX devices
14 * 10-Mar-2005 LCVR Changed S3C2410_{VA,SZ} to S3C24XX_{VA,SZ}
15 * 10-Feb-2005 BJD Added camera from guillaume.gourat@nexvision.tv
16 * 29-Aug-2004 BJD Added timers 0 through 3
17 * 29-Aug-2004 BJD Changed index of devices we only have one of to -1
18 * 21-Aug-2004 BJD Added IRQ_TICK to RTC resources
19 * 18-Aug-2004 BJD Created initial version
22 #include <linux/kernel.h>
23 #include <linux/types.h>
24 #include <linux/interrupt.h>
25 #include <linux/list.h>
26 #include <linux/timer.h>
27 #include <linux/init.h>
28 #include <linux/platform_device.h>
30 #include <asm/mach/arch.h>
31 #include <asm/mach/map.h>
32 #include <asm/mach/irq.h>
33 #include <asm/arch/fb.h>
34 #include <asm/hardware.h>
35 #include <asm/io.h>
36 #include <asm/irq.h>
38 #include <asm/arch/regs-serial.h>
40 #include "devs.h"
41 #include "cpu.h"
43 /* Serial port registrations */
45 static struct resource s3c2410_uart0_resource[] = {
46 [0] = {
47 .start = S3C2410_PA_UART0,
48 .end = S3C2410_PA_UART0 + 0x3fff,
49 .flags = IORESOURCE_MEM,
51 [1] = {
52 .start = IRQ_S3CUART_RX0,
53 .end = IRQ_S3CUART_ERR0,
54 .flags = IORESOURCE_IRQ,
58 static struct resource s3c2410_uart1_resource[] = {
59 [0] = {
60 .start = S3C2410_PA_UART1,
61 .end = S3C2410_PA_UART1 + 0x3fff,
62 .flags = IORESOURCE_MEM,
64 [1] = {
65 .start = IRQ_S3CUART_RX1,
66 .end = IRQ_S3CUART_ERR1,
67 .flags = IORESOURCE_IRQ,
71 static struct resource s3c2410_uart2_resource[] = {
72 [0] = {
73 .start = S3C2410_PA_UART2,
74 .end = S3C2410_PA_UART2 + 0x3fff,
75 .flags = IORESOURCE_MEM,
77 [1] = {
78 .start = IRQ_S3CUART_RX2,
79 .end = IRQ_S3CUART_ERR2,
80 .flags = IORESOURCE_IRQ,
84 struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = {
85 [0] = {
86 .resources = s3c2410_uart0_resource,
87 .nr_resources = ARRAY_SIZE(s3c2410_uart0_resource),
89 [1] = {
90 .resources = s3c2410_uart1_resource,
91 .nr_resources = ARRAY_SIZE(s3c2410_uart1_resource),
93 [2] = {
94 .resources = s3c2410_uart2_resource,
95 .nr_resources = ARRAY_SIZE(s3c2410_uart2_resource),
99 /* yart devices */
101 static struct platform_device s3c24xx_uart_device0 = {
102 .id = 0,
105 static struct platform_device s3c24xx_uart_device1 = {
106 .id = 1,
109 static struct platform_device s3c24xx_uart_device2 = {
110 .id = 2,
113 struct platform_device *s3c24xx_uart_src[3] = {
114 &s3c24xx_uart_device0,
115 &s3c24xx_uart_device1,
116 &s3c24xx_uart_device2,
119 struct platform_device *s3c24xx_uart_devs[3] = {
122 /* USB Host Controller */
124 static struct resource s3c_usb_resource[] = {
125 [0] = {
126 .start = S3C24XX_PA_USBHOST,
127 .end = S3C24XX_PA_USBHOST + S3C24XX_SZ_USBHOST - 1,
128 .flags = IORESOURCE_MEM,
130 [1] = {
131 .start = IRQ_USBH,
132 .end = IRQ_USBH,
133 .flags = IORESOURCE_IRQ,
137 static u64 s3c_device_usb_dmamask = 0xffffffffUL;
139 struct platform_device s3c_device_usb = {
140 .name = "s3c2410-ohci",
141 .id = -1,
142 .num_resources = ARRAY_SIZE(s3c_usb_resource),
143 .resource = s3c_usb_resource,
144 .dev = {
145 .dma_mask = &s3c_device_usb_dmamask,
146 .coherent_dma_mask = 0xffffffffUL
150 EXPORT_SYMBOL(s3c_device_usb);
152 /* LCD Controller */
154 static struct resource s3c_lcd_resource[] = {
155 [0] = {
156 .start = S3C24XX_PA_LCD,
157 .end = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1,
158 .flags = IORESOURCE_MEM,
160 [1] = {
161 .start = IRQ_LCD,
162 .end = IRQ_LCD,
163 .flags = IORESOURCE_IRQ,
168 static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
170 struct platform_device s3c_device_lcd = {
171 .name = "s3c2410-lcd",
172 .id = -1,
173 .num_resources = ARRAY_SIZE(s3c_lcd_resource),
174 .resource = s3c_lcd_resource,
175 .dev = {
176 .dma_mask = &s3c_device_lcd_dmamask,
177 .coherent_dma_mask = 0xffffffffUL
181 EXPORT_SYMBOL(s3c_device_lcd);
183 void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
185 struct s3c2410fb_mach_info *npd;
187 npd = kmalloc(sizeof(*npd), GFP_KERNEL);
188 if (npd) {
189 memcpy(npd, pd, sizeof(*npd));
190 s3c_device_lcd.dev.platform_data = npd;
191 } else {
192 printk(KERN_ERR "no memory for LCD platform data\n");
196 /* NAND Controller */
198 static struct resource s3c_nand_resource[] = {
199 [0] = {
200 .start = S3C2410_PA_NAND,
201 .end = S3C2410_PA_NAND + S3C24XX_SZ_NAND - 1,
202 .flags = IORESOURCE_MEM,
206 struct platform_device s3c_device_nand = {
207 .name = "s3c2410-nand",
208 .id = -1,
209 .num_resources = ARRAY_SIZE(s3c_nand_resource),
210 .resource = s3c_nand_resource,
213 EXPORT_SYMBOL(s3c_device_nand);
215 /* USB Device (Gadget)*/
217 static struct resource s3c_usbgadget_resource[] = {
218 [0] = {
219 .start = S3C24XX_PA_USBDEV,
220 .end = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
221 .flags = IORESOURCE_MEM,
223 [1] = {
224 .start = IRQ_USBD,
225 .end = IRQ_USBD,
226 .flags = IORESOURCE_IRQ,
231 struct platform_device s3c_device_usbgadget = {
232 .name = "s3c2410-usbgadget",
233 .id = -1,
234 .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
235 .resource = s3c_usbgadget_resource,
238 EXPORT_SYMBOL(s3c_device_usbgadget);
240 /* Watchdog */
242 static struct resource s3c_wdt_resource[] = {
243 [0] = {
244 .start = S3C24XX_PA_WATCHDOG,
245 .end = S3C24XX_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
246 .flags = IORESOURCE_MEM,
248 [1] = {
249 .start = IRQ_WDT,
250 .end = IRQ_WDT,
251 .flags = IORESOURCE_IRQ,
256 struct platform_device s3c_device_wdt = {
257 .name = "s3c2410-wdt",
258 .id = -1,
259 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
260 .resource = s3c_wdt_resource,
263 EXPORT_SYMBOL(s3c_device_wdt);
265 /* I2C */
267 static struct resource s3c_i2c_resource[] = {
268 [0] = {
269 .start = S3C24XX_PA_IIC,
270 .end = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1,
271 .flags = IORESOURCE_MEM,
273 [1] = {
274 .start = IRQ_IIC,
275 .end = IRQ_IIC,
276 .flags = IORESOURCE_IRQ,
281 struct platform_device s3c_device_i2c = {
282 .name = "s3c2410-i2c",
283 .id = -1,
284 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
285 .resource = s3c_i2c_resource,
288 EXPORT_SYMBOL(s3c_device_i2c);
290 /* IIS */
292 static struct resource s3c_iis_resource[] = {
293 [0] = {
294 .start = S3C24XX_PA_IIS,
295 .end = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1,
296 .flags = IORESOURCE_MEM,
300 static u64 s3c_device_iis_dmamask = 0xffffffffUL;
302 struct platform_device s3c_device_iis = {
303 .name = "s3c2410-iis",
304 .id = -1,
305 .num_resources = ARRAY_SIZE(s3c_iis_resource),
306 .resource = s3c_iis_resource,
307 .dev = {
308 .dma_mask = &s3c_device_iis_dmamask,
309 .coherent_dma_mask = 0xffffffffUL
313 EXPORT_SYMBOL(s3c_device_iis);
315 /* RTC */
317 static struct resource s3c_rtc_resource[] = {
318 [0] = {
319 .start = S3C24XX_PA_RTC,
320 .end = S3C24XX_PA_RTC + 0xff,
321 .flags = IORESOURCE_MEM,
323 [1] = {
324 .start = IRQ_RTC,
325 .end = IRQ_RTC,
326 .flags = IORESOURCE_IRQ,
328 [2] = {
329 .start = IRQ_TICK,
330 .end = IRQ_TICK,
331 .flags = IORESOURCE_IRQ
335 struct platform_device s3c_device_rtc = {
336 .name = "s3c2410-rtc",
337 .id = -1,
338 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
339 .resource = s3c_rtc_resource,
342 EXPORT_SYMBOL(s3c_device_rtc);
344 /* ADC */
346 static struct resource s3c_adc_resource[] = {
347 [0] = {
348 .start = S3C24XX_PA_ADC,
349 .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
350 .flags = IORESOURCE_MEM,
352 [1] = {
353 .start = IRQ_TC,
354 .end = IRQ_TC,
355 .flags = IORESOURCE_IRQ,
357 [2] = {
358 .start = IRQ_ADC,
359 .end = IRQ_ADC,
360 .flags = IORESOURCE_IRQ,
365 struct platform_device s3c_device_adc = {
366 .name = "s3c2410-adc",
367 .id = -1,
368 .num_resources = ARRAY_SIZE(s3c_adc_resource),
369 .resource = s3c_adc_resource,
372 /* SDI */
374 static struct resource s3c_sdi_resource[] = {
375 [0] = {
376 .start = S3C2410_PA_SDI,
377 .end = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1,
378 .flags = IORESOURCE_MEM,
380 [1] = {
381 .start = IRQ_SDI,
382 .end = IRQ_SDI,
383 .flags = IORESOURCE_IRQ,
388 struct platform_device s3c_device_sdi = {
389 .name = "s3c2410-sdi",
390 .id = -1,
391 .num_resources = ARRAY_SIZE(s3c_sdi_resource),
392 .resource = s3c_sdi_resource,
395 EXPORT_SYMBOL(s3c_device_sdi);
397 /* SPI (0) */
399 static struct resource s3c_spi0_resource[] = {
400 [0] = {
401 .start = S3C24XX_PA_SPI,
402 .end = S3C24XX_PA_SPI + 0x1f,
403 .flags = IORESOURCE_MEM,
405 [1] = {
406 .start = IRQ_SPI0,
407 .end = IRQ_SPI0,
408 .flags = IORESOURCE_IRQ,
413 static u64 s3c_device_spi0_dmamask = 0xffffffffUL;
415 struct platform_device s3c_device_spi0 = {
416 .name = "s3c2410-spi",
417 .id = 0,
418 .num_resources = ARRAY_SIZE(s3c_spi0_resource),
419 .resource = s3c_spi0_resource,
420 .dev = {
421 .dma_mask = &s3c_device_spi0_dmamask,
422 .coherent_dma_mask = 0xffffffffUL
426 EXPORT_SYMBOL(s3c_device_spi0);
428 /* SPI (1) */
430 static struct resource s3c_spi1_resource[] = {
431 [0] = {
432 .start = S3C24XX_PA_SPI + 0x20,
433 .end = S3C24XX_PA_SPI + 0x20 + 0x1f,
434 .flags = IORESOURCE_MEM,
436 [1] = {
437 .start = IRQ_SPI1,
438 .end = IRQ_SPI1,
439 .flags = IORESOURCE_IRQ,
444 static u64 s3c_device_spi1_dmamask = 0xffffffffUL;
446 struct platform_device s3c_device_spi1 = {
447 .name = "s3c2410-spi",
448 .id = 1,
449 .num_resources = ARRAY_SIZE(s3c_spi1_resource),
450 .resource = s3c_spi1_resource,
451 .dev = {
452 .dma_mask = &s3c_device_spi1_dmamask,
453 .coherent_dma_mask = 0xffffffffUL
457 EXPORT_SYMBOL(s3c_device_spi1);
459 /* pwm timer blocks */
461 static struct resource s3c_timer0_resource[] = {
462 [0] = {
463 .start = S3C24XX_PA_TIMER + 0x0C,
464 .end = S3C24XX_PA_TIMER + 0x0C + 0xB,
465 .flags = IORESOURCE_MEM,
467 [1] = {
468 .start = IRQ_TIMER0,
469 .end = IRQ_TIMER0,
470 .flags = IORESOURCE_IRQ,
475 struct platform_device s3c_device_timer0 = {
476 .name = "s3c2410-timer",
477 .id = 0,
478 .num_resources = ARRAY_SIZE(s3c_timer0_resource),
479 .resource = s3c_timer0_resource,
482 EXPORT_SYMBOL(s3c_device_timer0);
484 /* timer 1 */
486 static struct resource s3c_timer1_resource[] = {
487 [0] = {
488 .start = S3C24XX_PA_TIMER + 0x18,
489 .end = S3C24XX_PA_TIMER + 0x23,
490 .flags = IORESOURCE_MEM,
492 [1] = {
493 .start = IRQ_TIMER1,
494 .end = IRQ_TIMER1,
495 .flags = IORESOURCE_IRQ,
500 struct platform_device s3c_device_timer1 = {
501 .name = "s3c2410-timer",
502 .id = 1,
503 .num_resources = ARRAY_SIZE(s3c_timer1_resource),
504 .resource = s3c_timer1_resource,
507 EXPORT_SYMBOL(s3c_device_timer1);
509 /* timer 2 */
511 static struct resource s3c_timer2_resource[] = {
512 [0] = {
513 .start = S3C24XX_PA_TIMER + 0x24,
514 .end = S3C24XX_PA_TIMER + 0x2F,
515 .flags = IORESOURCE_MEM,
517 [1] = {
518 .start = IRQ_TIMER2,
519 .end = IRQ_TIMER2,
520 .flags = IORESOURCE_IRQ,
525 struct platform_device s3c_device_timer2 = {
526 .name = "s3c2410-timer",
527 .id = 2,
528 .num_resources = ARRAY_SIZE(s3c_timer2_resource),
529 .resource = s3c_timer2_resource,
532 EXPORT_SYMBOL(s3c_device_timer2);
534 /* timer 3 */
536 static struct resource s3c_timer3_resource[] = {
537 [0] = {
538 .start = S3C24XX_PA_TIMER + 0x30,
539 .end = S3C24XX_PA_TIMER + 0x3B,
540 .flags = IORESOURCE_MEM,
542 [1] = {
543 .start = IRQ_TIMER3,
544 .end = IRQ_TIMER3,
545 .flags = IORESOURCE_IRQ,
550 struct platform_device s3c_device_timer3 = {
551 .name = "s3c2410-timer",
552 .id = 3,
553 .num_resources = ARRAY_SIZE(s3c_timer3_resource),
554 .resource = s3c_timer3_resource,
557 EXPORT_SYMBOL(s3c_device_timer3);
559 #ifdef CONFIG_CPU_S3C2440
561 /* Camif Controller */
563 static struct resource s3c_camif_resource[] = {
564 [0] = {
565 .start = S3C2440_PA_CAMIF,
566 .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1,
567 .flags = IORESOURCE_MEM,
569 [1] = {
570 .start = IRQ_CAM,
571 .end = IRQ_CAM,
572 .flags = IORESOURCE_IRQ,
577 static u64 s3c_device_camif_dmamask = 0xffffffffUL;
579 struct platform_device s3c_device_camif = {
580 .name = "s3c2440-camif",
581 .id = -1,
582 .num_resources = ARRAY_SIZE(s3c_camif_resource),
583 .resource = s3c_camif_resource,
584 .dev = {
585 .dma_mask = &s3c_device_camif_dmamask,
586 .coherent_dma_mask = 0xffffffffUL
590 EXPORT_SYMBOL(s3c_device_camif);
592 #endif // CONFIG_CPU_S32440