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.
13 * 10-Mar-2005 LCVR Changed S3C2410_{VA,SZ} to S3C24XX_{VA,SZ}
14 * 10-Feb-2005 BJD Added camera from guillaume.gourat@nexvision.tv
15 * 29-Aug-2004 BJD Added timers 0 through 3
16 * 29-Aug-2004 BJD Changed index of devices we only have one of to -1
17 * 21-Aug-2004 BJD Added IRQ_TICK to RTC resources
18 * 18-Aug-2004 BJD Created initial version
21 #include <linux/kernel.h>
22 #include <linux/types.h>
23 #include <linux/interrupt.h>
24 #include <linux/list.h>
25 #include <linux/timer.h>
26 #include <linux/init.h>
27 #include <linux/platform_device.h>
29 #include <asm/mach/arch.h>
30 #include <asm/mach/map.h>
31 #include <asm/mach/irq.h>
32 #include <asm/arch/fb.h>
33 #include <asm/hardware.h>
37 #include <asm/arch/regs-serial.h>
41 /* Serial port registrations */
43 struct platform_device *s3c24xx_uart_devs[3];
45 /* USB Host Controller */
47 static struct resource s3c_usb_resource[] = {
49 .start = S3C2410_PA_USBHOST,
50 .end = S3C2410_PA_USBHOST + S3C24XX_SZ_USBHOST - 1,
51 .flags = IORESOURCE_MEM,
56 .flags = IORESOURCE_IRQ,
60 static u64 s3c_device_usb_dmamask = 0xffffffffUL;
62 struct platform_device s3c_device_usb = {
63 .name = "s3c2410-ohci",
65 .num_resources = ARRAY_SIZE(s3c_usb_resource),
66 .resource = s3c_usb_resource,
68 .dma_mask = &s3c_device_usb_dmamask,
69 .coherent_dma_mask = 0xffffffffUL
73 EXPORT_SYMBOL(s3c_device_usb);
77 static struct resource s3c_lcd_resource[] = {
79 .start = S3C2410_PA_LCD,
80 .end = S3C2410_PA_LCD + S3C24XX_SZ_LCD - 1,
81 .flags = IORESOURCE_MEM,
86 .flags = IORESOURCE_IRQ,
91 static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
93 struct platform_device s3c_device_lcd = {
94 .name = "s3c2410-lcd",
96 .num_resources = ARRAY_SIZE(s3c_lcd_resource),
97 .resource = s3c_lcd_resource,
99 .dma_mask = &s3c_device_lcd_dmamask,
100 .coherent_dma_mask = 0xffffffffUL
104 EXPORT_SYMBOL(s3c_device_lcd);
106 void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
108 struct s3c2410fb_mach_info *npd;
110 npd = kmalloc(sizeof(*npd), GFP_KERNEL);
112 memcpy(npd, pd, sizeof(*npd));
113 s3c_device_lcd.dev.platform_data = npd;
115 printk(KERN_ERR "no memory for LCD platform data\n");
119 /* NAND Controller */
121 static struct resource s3c_nand_resource[] = {
123 .start = S3C2410_PA_NAND,
124 .end = S3C2410_PA_NAND + S3C24XX_SZ_NAND - 1,
125 .flags = IORESOURCE_MEM,
129 struct platform_device s3c_device_nand = {
130 .name = "s3c2410-nand",
132 .num_resources = ARRAY_SIZE(s3c_nand_resource),
133 .resource = s3c_nand_resource,
136 EXPORT_SYMBOL(s3c_device_nand);
138 /* USB Device (Gadget)*/
140 static struct resource s3c_usbgadget_resource[] = {
142 .start = S3C2410_PA_USBDEV,
143 .end = S3C2410_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
144 .flags = IORESOURCE_MEM,
149 .flags = IORESOURCE_IRQ,
154 struct platform_device s3c_device_usbgadget = {
155 .name = "s3c2410-usbgadget",
157 .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
158 .resource = s3c_usbgadget_resource,
161 EXPORT_SYMBOL(s3c_device_usbgadget);
165 static struct resource s3c_wdt_resource[] = {
167 .start = S3C2410_PA_WATCHDOG,
168 .end = S3C2410_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
169 .flags = IORESOURCE_MEM,
174 .flags = IORESOURCE_IRQ,
179 struct platform_device s3c_device_wdt = {
180 .name = "s3c2410-wdt",
182 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
183 .resource = s3c_wdt_resource,
186 EXPORT_SYMBOL(s3c_device_wdt);
190 static struct resource s3c_i2c_resource[] = {
192 .start = S3C2410_PA_IIC,
193 .end = S3C2410_PA_IIC + S3C24XX_SZ_IIC - 1,
194 .flags = IORESOURCE_MEM,
199 .flags = IORESOURCE_IRQ,
204 struct platform_device s3c_device_i2c = {
205 .name = "s3c2410-i2c",
207 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
208 .resource = s3c_i2c_resource,
211 EXPORT_SYMBOL(s3c_device_i2c);
215 static struct resource s3c_iis_resource[] = {
217 .start = S3C2410_PA_IIS,
218 .end = S3C2410_PA_IIS + S3C24XX_SZ_IIS -1,
219 .flags = IORESOURCE_MEM,
223 static u64 s3c_device_iis_dmamask = 0xffffffffUL;
225 struct platform_device s3c_device_iis = {
226 .name = "s3c2410-iis",
228 .num_resources = ARRAY_SIZE(s3c_iis_resource),
229 .resource = s3c_iis_resource,
231 .dma_mask = &s3c_device_iis_dmamask,
232 .coherent_dma_mask = 0xffffffffUL
236 EXPORT_SYMBOL(s3c_device_iis);
240 static struct resource s3c_rtc_resource[] = {
242 .start = S3C2410_PA_RTC,
243 .end = S3C2410_PA_RTC + 0xff,
244 .flags = IORESOURCE_MEM,
249 .flags = IORESOURCE_IRQ,
254 .flags = IORESOURCE_IRQ
258 struct platform_device s3c_device_rtc = {
259 .name = "s3c2410-rtc",
261 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
262 .resource = s3c_rtc_resource,
265 EXPORT_SYMBOL(s3c_device_rtc);
269 static struct resource s3c_adc_resource[] = {
271 .start = S3C2410_PA_ADC,
272 .end = S3C2410_PA_ADC + S3C24XX_SZ_ADC - 1,
273 .flags = IORESOURCE_MEM,
278 .flags = IORESOURCE_IRQ,
283 struct platform_device s3c_device_adc = {
284 .name = "s3c2410-adc",
286 .num_resources = ARRAY_SIZE(s3c_adc_resource),
287 .resource = s3c_adc_resource,
292 static struct resource s3c_sdi_resource[] = {
294 .start = S3C2410_PA_SDI,
295 .end = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1,
296 .flags = IORESOURCE_MEM,
301 .flags = IORESOURCE_IRQ,
306 struct platform_device s3c_device_sdi = {
307 .name = "s3c2410-sdi",
309 .num_resources = ARRAY_SIZE(s3c_sdi_resource),
310 .resource = s3c_sdi_resource,
313 EXPORT_SYMBOL(s3c_device_sdi);
317 static struct resource s3c_spi0_resource[] = {
319 .start = S3C2410_PA_SPI,
320 .end = S3C2410_PA_SPI + 0x1f,
321 .flags = IORESOURCE_MEM,
326 .flags = IORESOURCE_IRQ,
331 struct platform_device s3c_device_spi0 = {
332 .name = "s3c2410-spi",
334 .num_resources = ARRAY_SIZE(s3c_spi0_resource),
335 .resource = s3c_spi0_resource,
338 EXPORT_SYMBOL(s3c_device_spi0);
342 static struct resource s3c_spi1_resource[] = {
344 .start = S3C2410_PA_SPI + 0x20,
345 .end = S3C2410_PA_SPI + 0x20 + 0x1f,
346 .flags = IORESOURCE_MEM,
351 .flags = IORESOURCE_IRQ,
356 struct platform_device s3c_device_spi1 = {
357 .name = "s3c2410-spi",
359 .num_resources = ARRAY_SIZE(s3c_spi1_resource),
360 .resource = s3c_spi1_resource,
363 EXPORT_SYMBOL(s3c_device_spi1);
365 /* pwm timer blocks */
367 static struct resource s3c_timer0_resource[] = {
369 .start = S3C2410_PA_TIMER + 0x0C,
370 .end = S3C2410_PA_TIMER + 0x0C + 0xB,
371 .flags = IORESOURCE_MEM,
376 .flags = IORESOURCE_IRQ,
381 struct platform_device s3c_device_timer0 = {
382 .name = "s3c2410-timer",
384 .num_resources = ARRAY_SIZE(s3c_timer0_resource),
385 .resource = s3c_timer0_resource,
388 EXPORT_SYMBOL(s3c_device_timer0);
392 static struct resource s3c_timer1_resource[] = {
394 .start = S3C2410_PA_TIMER + 0x18,
395 .end = S3C2410_PA_TIMER + 0x23,
396 .flags = IORESOURCE_MEM,
401 .flags = IORESOURCE_IRQ,
406 struct platform_device s3c_device_timer1 = {
407 .name = "s3c2410-timer",
409 .num_resources = ARRAY_SIZE(s3c_timer1_resource),
410 .resource = s3c_timer1_resource,
413 EXPORT_SYMBOL(s3c_device_timer1);
417 static struct resource s3c_timer2_resource[] = {
419 .start = S3C2410_PA_TIMER + 0x24,
420 .end = S3C2410_PA_TIMER + 0x2F,
421 .flags = IORESOURCE_MEM,
426 .flags = IORESOURCE_IRQ,
431 struct platform_device s3c_device_timer2 = {
432 .name = "s3c2410-timer",
434 .num_resources = ARRAY_SIZE(s3c_timer2_resource),
435 .resource = s3c_timer2_resource,
438 EXPORT_SYMBOL(s3c_device_timer2);
442 static struct resource s3c_timer3_resource[] = {
444 .start = S3C2410_PA_TIMER + 0x30,
445 .end = S3C2410_PA_TIMER + 0x3B,
446 .flags = IORESOURCE_MEM,
451 .flags = IORESOURCE_IRQ,
456 struct platform_device s3c_device_timer3 = {
457 .name = "s3c2410-timer",
459 .num_resources = ARRAY_SIZE(s3c_timer3_resource),
460 .resource = s3c_timer3_resource,
463 EXPORT_SYMBOL(s3c_device_timer3);
465 #ifdef CONFIG_CPU_S3C2440
467 /* Camif Controller */
469 static struct resource s3c_camif_resource[] = {
471 .start = S3C2440_PA_CAMIF,
472 .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1,
473 .flags = IORESOURCE_MEM,
478 .flags = IORESOURCE_IRQ,
483 static u64 s3c_device_camif_dmamask = 0xffffffffUL;
485 struct platform_device s3c_device_camif = {
486 .name = "s3c2440-camif",
488 .num_resources = ARRAY_SIZE(s3c_camif_resource),
489 .resource = s3c_camif_resource,
491 .dma_mask = &s3c_device_camif_dmamask,
492 .coherent_dma_mask = 0xffffffffUL
496 EXPORT_SYMBOL(s3c_device_camif);
498 #endif // CONFIG_CPU_S32440