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 * 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>
35 #include <asm/arch/regs-serial.h>
39 /* Serial port registrations */
41 struct platform_device *s3c24xx_uart_devs[3];
43 /* USB Host Controller */
45 static struct resource s3c_usb_resource[] = {
47 .start = S3C2410_PA_USBHOST,
48 .end = S3C2410_PA_USBHOST + S3C2410_SZ_USBHOST,
49 .flags = IORESOURCE_MEM,
54 .flags = IORESOURCE_IRQ,
58 static u64 s3c_device_usb_dmamask = 0xffffffffUL;
60 struct platform_device s3c_device_usb = {
61 .name = "s3c2410-ohci",
63 .num_resources = ARRAY_SIZE(s3c_usb_resource),
64 .resource = s3c_usb_resource,
66 .dma_mask = &s3c_device_usb_dmamask,
67 .coherent_dma_mask = 0xffffffffUL
71 EXPORT_SYMBOL(s3c_device_usb);
75 static struct resource s3c_lcd_resource[] = {
77 .start = S3C2410_PA_LCD,
78 .end = S3C2410_PA_LCD + S3C2410_SZ_LCD,
79 .flags = IORESOURCE_MEM,
84 .flags = IORESOURCE_IRQ,
89 static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
91 struct platform_device s3c_device_lcd = {
92 .name = "s3c2410-lcd",
94 .num_resources = ARRAY_SIZE(s3c_lcd_resource),
95 .resource = s3c_lcd_resource,
97 .dma_mask = &s3c_device_lcd_dmamask,
98 .coherent_dma_mask = 0xffffffffUL
102 EXPORT_SYMBOL(s3c_device_lcd);
104 /* NAND Controller */
106 static struct resource s3c_nand_resource[] = {
108 .start = S3C2410_PA_NAND,
109 .end = S3C2410_PA_NAND + S3C2410_SZ_NAND,
110 .flags = IORESOURCE_MEM,
114 struct platform_device s3c_device_nand = {
115 .name = "s3c2410-nand",
117 .num_resources = ARRAY_SIZE(s3c_nand_resource),
118 .resource = s3c_nand_resource,
121 EXPORT_SYMBOL(s3c_device_nand);
123 /* USB Device (Gadget)*/
125 static struct resource s3c_usbgadget_resource[] = {
127 .start = S3C2410_PA_USBDEV,
128 .end = S3C2410_PA_USBDEV + S3C2410_SZ_USBDEV,
129 .flags = IORESOURCE_MEM,
134 .flags = IORESOURCE_IRQ,
139 struct platform_device s3c_device_usbgadget = {
140 .name = "s3c2410-usbgadget",
142 .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
143 .resource = s3c_usbgadget_resource,
146 EXPORT_SYMBOL(s3c_device_usbgadget);
150 static struct resource s3c_wdt_resource[] = {
152 .start = S3C2410_PA_WATCHDOG,
153 .end = S3C2410_PA_WATCHDOG + S3C2410_SZ_WATCHDOG,
154 .flags = IORESOURCE_MEM,
159 .flags = IORESOURCE_IRQ,
164 struct platform_device s3c_device_wdt = {
165 .name = "s3c2410-wdt",
167 .num_resources = ARRAY_SIZE(s3c_wdt_resource),
168 .resource = s3c_wdt_resource,
171 EXPORT_SYMBOL(s3c_device_wdt);
175 static struct resource s3c_i2c_resource[] = {
177 .start = S3C2410_PA_IIC,
178 .end = S3C2410_PA_IIC + S3C2410_SZ_IIC,
179 .flags = IORESOURCE_MEM,
184 .flags = IORESOURCE_IRQ,
189 struct platform_device s3c_device_i2c = {
190 .name = "s3c2410-i2c",
192 .num_resources = ARRAY_SIZE(s3c_i2c_resource),
193 .resource = s3c_i2c_resource,
196 EXPORT_SYMBOL(s3c_device_i2c);
200 static struct resource s3c_iis_resource[] = {
202 .start = S3C2410_PA_IIS,
203 .end = S3C2410_PA_IIS + S3C2410_SZ_IIS,
204 .flags = IORESOURCE_MEM,
208 static u64 s3c_device_iis_dmamask = 0xffffffffUL;
210 struct platform_device s3c_device_iis = {
211 .name = "s3c2410-iis",
213 .num_resources = ARRAY_SIZE(s3c_iis_resource),
214 .resource = s3c_iis_resource,
216 .dma_mask = &s3c_device_iis_dmamask,
217 .coherent_dma_mask = 0xffffffffUL
221 EXPORT_SYMBOL(s3c_device_iis);
225 static struct resource s3c_rtc_resource[] = {
227 .start = S3C2410_PA_RTC,
228 .end = S3C2410_PA_RTC + 0xff,
229 .flags = IORESOURCE_MEM,
234 .flags = IORESOURCE_IRQ,
239 .flags = IORESOURCE_IRQ
243 struct platform_device s3c_device_rtc = {
244 .name = "s3c2410-rtc",
246 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
247 .resource = s3c_rtc_resource,
250 EXPORT_SYMBOL(s3c_device_rtc);
254 static struct resource s3c_adc_resource[] = {
256 .start = S3C2410_PA_ADC,
257 .end = S3C2410_PA_ADC + S3C2410_SZ_ADC,
258 .flags = IORESOURCE_MEM,
263 .flags = IORESOURCE_IRQ,
268 struct platform_device s3c_device_adc = {
269 .name = "s3c2410-adc",
271 .num_resources = ARRAY_SIZE(s3c_adc_resource),
272 .resource = s3c_adc_resource,
277 static struct resource s3c_sdi_resource[] = {
279 .start = S3C2410_PA_SDI,
280 .end = S3C2410_PA_SDI + S3C2410_SZ_SDI,
281 .flags = IORESOURCE_MEM,
286 .flags = IORESOURCE_IRQ,
291 struct platform_device s3c_device_sdi = {
292 .name = "s3c2410-sdi",
294 .num_resources = ARRAY_SIZE(s3c_sdi_resource),
295 .resource = s3c_sdi_resource,
298 EXPORT_SYMBOL(s3c_device_sdi);
302 static struct resource s3c_spi0_resource[] = {
304 .start = S3C2410_PA_SPI,
305 .end = S3C2410_PA_SPI + 0x1f,
306 .flags = IORESOURCE_MEM,
311 .flags = IORESOURCE_IRQ,
316 struct platform_device s3c_device_spi0 = {
317 .name = "s3c2410-spi",
319 .num_resources = ARRAY_SIZE(s3c_spi0_resource),
320 .resource = s3c_spi0_resource,
323 EXPORT_SYMBOL(s3c_device_spi0);
327 static struct resource s3c_spi1_resource[] = {
329 .start = S3C2410_PA_SPI + 0x20,
330 .end = S3C2410_PA_SPI + 0x20 + 0x1f,
331 .flags = IORESOURCE_MEM,
336 .flags = IORESOURCE_IRQ,
341 struct platform_device s3c_device_spi1 = {
342 .name = "s3c2410-spi",
344 .num_resources = ARRAY_SIZE(s3c_spi1_resource),
345 .resource = s3c_spi1_resource,
348 EXPORT_SYMBOL(s3c_device_spi1);
350 /* pwm timer blocks */
352 static struct resource s3c_timer0_resource[] = {
354 .start = S3C2410_PA_TIMER + 0x0C,
355 .end = S3C2410_PA_TIMER + 0x0C + 0xB,
356 .flags = IORESOURCE_MEM,
361 .flags = IORESOURCE_IRQ,
366 struct platform_device s3c_device_timer0 = {
367 .name = "s3c2410-timer",
369 .num_resources = ARRAY_SIZE(s3c_timer0_resource),
370 .resource = s3c_timer0_resource,
373 EXPORT_SYMBOL(s3c_device_timer0);
377 static struct resource s3c_timer1_resource[] = {
379 .start = S3C2410_PA_TIMER + 0x18,
380 .end = S3C2410_PA_TIMER + 0x23,
381 .flags = IORESOURCE_MEM,
386 .flags = IORESOURCE_IRQ,
391 struct platform_device s3c_device_timer1 = {
392 .name = "s3c2410-timer",
394 .num_resources = ARRAY_SIZE(s3c_timer1_resource),
395 .resource = s3c_timer1_resource,
398 EXPORT_SYMBOL(s3c_device_timer1);
402 static struct resource s3c_timer2_resource[] = {
404 .start = S3C2410_PA_TIMER + 0x24,
405 .end = S3C2410_PA_TIMER + 0x2F,
406 .flags = IORESOURCE_MEM,
411 .flags = IORESOURCE_IRQ,
416 struct platform_device s3c_device_timer2 = {
417 .name = "s3c2410-timer",
419 .num_resources = ARRAY_SIZE(s3c_timer2_resource),
420 .resource = s3c_timer2_resource,
423 EXPORT_SYMBOL(s3c_device_timer2);
427 static struct resource s3c_timer3_resource[] = {
429 .start = S3C2410_PA_TIMER + 0x30,
430 .end = S3C2410_PA_TIMER + 0x3B,
431 .flags = IORESOURCE_MEM,
436 .flags = IORESOURCE_IRQ,
441 struct platform_device s3c_device_timer3 = {
442 .name = "s3c2410-timer",
444 .num_resources = ARRAY_SIZE(s3c_timer3_resource),
445 .resource = s3c_timer3_resource,
448 EXPORT_SYMBOL(s3c_device_timer3);