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/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 static struct s3c2410fb_mach_info s3c2410fb_info;
108 void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info)
110 memcpy(&s3c2410fb_info,hard_s3c2410fb_info,sizeof(struct s3c2410fb_mach_info));
111 s3c_device_lcd.dev.platform_data = &s3c2410fb_info;
113 EXPORT_SYMBOL(set_s3c2410fb_info);
115 /* NAND Controller */
117 static struct resource s3c_nand_resource[] = {
119 .start = S3C2410_PA_NAND,
120 .end = S3C2410_PA_NAND + S3C24XX_SZ_NAND - 1,
121 .flags = IORESOURCE_MEM,
125 struct platform_device s3c_device_nand = {
126 .name = "s3c2410-nand",
128 .num_resources = ARRAY_SIZE(s3c_nand_resource),
129 .resource = s3c_nand_resource,
132 EXPORT_SYMBOL(s3c_device_nand);
134 /* USB Device (Gadget)*/
136 static struct resource s3c_usbgadget_resource[] = {
138 .start = S3C2410_PA_USBDEV,
139 .end = S3C2410_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
140 .flags = IORESOURCE_MEM,
145 .flags = IORESOURCE_IRQ,
150 struct platform_device s3c_device_usbgadget = {
151 .name = "s3c2410-usbgadget",
153 .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
154 .resource = s3c_usbgadget_resource,
157 EXPORT_SYMBOL(s3c_device_usbgadget);
161 static struct resource s3c_wdt_resource[] = {
163 .start = S3C2410_PA_WATCHDOG,
164 .end = S3C2410_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
165 .flags = IORESOURCE_MEM,
170 .flags = IORESOURCE_IRQ,
175 struct platform_device s3c_device_wdt = {
176 .name = "s3c2410-wdt",
178 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
179 .resource = s3c_wdt_resource,
182 EXPORT_SYMBOL(s3c_device_wdt);
186 static struct resource s3c_i2c_resource[] = {
188 .start = S3C2410_PA_IIC,
189 .end = S3C2410_PA_IIC + S3C24XX_SZ_IIC - 1,
190 .flags = IORESOURCE_MEM,
195 .flags = IORESOURCE_IRQ,
200 struct platform_device s3c_device_i2c = {
201 .name = "s3c2410-i2c",
203 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
204 .resource = s3c_i2c_resource,
207 EXPORT_SYMBOL(s3c_device_i2c);
211 static struct resource s3c_iis_resource[] = {
213 .start = S3C2410_PA_IIS,
214 .end = S3C2410_PA_IIS + S3C24XX_SZ_IIS -1,
215 .flags = IORESOURCE_MEM,
219 static u64 s3c_device_iis_dmamask = 0xffffffffUL;
221 struct platform_device s3c_device_iis = {
222 .name = "s3c2410-iis",
224 .num_resources = ARRAY_SIZE(s3c_iis_resource),
225 .resource = s3c_iis_resource,
227 .dma_mask = &s3c_device_iis_dmamask,
228 .coherent_dma_mask = 0xffffffffUL
232 EXPORT_SYMBOL(s3c_device_iis);
236 static struct resource s3c_rtc_resource[] = {
238 .start = S3C2410_PA_RTC,
239 .end = S3C2410_PA_RTC + 0xff,
240 .flags = IORESOURCE_MEM,
245 .flags = IORESOURCE_IRQ,
250 .flags = IORESOURCE_IRQ
254 struct platform_device s3c_device_rtc = {
255 .name = "s3c2410-rtc",
257 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
258 .resource = s3c_rtc_resource,
261 EXPORT_SYMBOL(s3c_device_rtc);
265 static struct resource s3c_adc_resource[] = {
267 .start = S3C2410_PA_ADC,
268 .end = S3C2410_PA_ADC + S3C24XX_SZ_ADC - 1,
269 .flags = IORESOURCE_MEM,
274 .flags = IORESOURCE_IRQ,
279 struct platform_device s3c_device_adc = {
280 .name = "s3c2410-adc",
282 .num_resources = ARRAY_SIZE(s3c_adc_resource),
283 .resource = s3c_adc_resource,
288 static struct resource s3c_sdi_resource[] = {
290 .start = S3C2410_PA_SDI,
291 .end = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1,
292 .flags = IORESOURCE_MEM,
297 .flags = IORESOURCE_IRQ,
302 struct platform_device s3c_device_sdi = {
303 .name = "s3c2410-sdi",
305 .num_resources = ARRAY_SIZE(s3c_sdi_resource),
306 .resource = s3c_sdi_resource,
309 EXPORT_SYMBOL(s3c_device_sdi);
313 static struct resource s3c_spi0_resource[] = {
315 .start = S3C2410_PA_SPI,
316 .end = S3C2410_PA_SPI + 0x1f,
317 .flags = IORESOURCE_MEM,
322 .flags = IORESOURCE_IRQ,
327 struct platform_device s3c_device_spi0 = {
328 .name = "s3c2410-spi",
330 .num_resources = ARRAY_SIZE(s3c_spi0_resource),
331 .resource = s3c_spi0_resource,
334 EXPORT_SYMBOL(s3c_device_spi0);
338 static struct resource s3c_spi1_resource[] = {
340 .start = S3C2410_PA_SPI + 0x20,
341 .end = S3C2410_PA_SPI + 0x20 + 0x1f,
342 .flags = IORESOURCE_MEM,
347 .flags = IORESOURCE_IRQ,
352 struct platform_device s3c_device_spi1 = {
353 .name = "s3c2410-spi",
355 .num_resources = ARRAY_SIZE(s3c_spi1_resource),
356 .resource = s3c_spi1_resource,
359 EXPORT_SYMBOL(s3c_device_spi1);
361 /* pwm timer blocks */
363 static struct resource s3c_timer0_resource[] = {
365 .start = S3C2410_PA_TIMER + 0x0C,
366 .end = S3C2410_PA_TIMER + 0x0C + 0xB,
367 .flags = IORESOURCE_MEM,
372 .flags = IORESOURCE_IRQ,
377 struct platform_device s3c_device_timer0 = {
378 .name = "s3c2410-timer",
380 .num_resources = ARRAY_SIZE(s3c_timer0_resource),
381 .resource = s3c_timer0_resource,
384 EXPORT_SYMBOL(s3c_device_timer0);
388 static struct resource s3c_timer1_resource[] = {
390 .start = S3C2410_PA_TIMER + 0x18,
391 .end = S3C2410_PA_TIMER + 0x23,
392 .flags = IORESOURCE_MEM,
397 .flags = IORESOURCE_IRQ,
402 struct platform_device s3c_device_timer1 = {
403 .name = "s3c2410-timer",
405 .num_resources = ARRAY_SIZE(s3c_timer1_resource),
406 .resource = s3c_timer1_resource,
409 EXPORT_SYMBOL(s3c_device_timer1);
413 static struct resource s3c_timer2_resource[] = {
415 .start = S3C2410_PA_TIMER + 0x24,
416 .end = S3C2410_PA_TIMER + 0x2F,
417 .flags = IORESOURCE_MEM,
422 .flags = IORESOURCE_IRQ,
427 struct platform_device s3c_device_timer2 = {
428 .name = "s3c2410-timer",
430 .num_resources = ARRAY_SIZE(s3c_timer2_resource),
431 .resource = s3c_timer2_resource,
434 EXPORT_SYMBOL(s3c_device_timer2);
438 static struct resource s3c_timer3_resource[] = {
440 .start = S3C2410_PA_TIMER + 0x30,
441 .end = S3C2410_PA_TIMER + 0x3B,
442 .flags = IORESOURCE_MEM,
447 .flags = IORESOURCE_IRQ,
452 struct platform_device s3c_device_timer3 = {
453 .name = "s3c2410-timer",
455 .num_resources = ARRAY_SIZE(s3c_timer3_resource),
456 .resource = s3c_timer3_resource,
459 EXPORT_SYMBOL(s3c_device_timer3);
461 #ifdef CONFIG_CPU_S3C2440
463 /* Camif Controller */
465 static struct resource s3c_camif_resource[] = {
467 .start = S3C2440_PA_CAMIF,
468 .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1,
469 .flags = IORESOURCE_MEM,
474 .flags = IORESOURCE_IRQ,
479 static u64 s3c_device_camif_dmamask = 0xffffffffUL;
481 struct platform_device s3c_device_camif = {
482 .name = "s3c2440-camif",
484 .num_resources = ARRAY_SIZE(s3c_camif_resource),
485 .resource = s3c_camif_resource,
487 .dma_mask = &s3c_device_camif_dmamask,
488 .coherent_dma_mask = 0xffffffffUL
492 EXPORT_SYMBOL(s3c_device_camif);
494 #endif // CONFIG_CPU_S32440