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>
37 /* USB Host Controller */
39 static struct resource s3c_usb_resource
[] = {
41 .start
= S3C2410_PA_USBHOST
,
42 .end
= S3C2410_PA_USBHOST
+ S3C2410_SZ_USBHOST
,
43 .flags
= IORESOURCE_MEM
,
48 .flags
= IORESOURCE_IRQ
,
52 static u64 s3c_device_usb_dmamask
= 0xffffffffUL
;
54 struct platform_device s3c_device_usb
= {
55 .name
= "s3c2410-ohci",
57 .num_resources
= ARRAY_SIZE(s3c_usb_resource
),
58 .resource
= s3c_usb_resource
,
60 .dma_mask
= &s3c_device_usb_dmamask
,
61 .coherent_dma_mask
= 0xffffffffUL
65 EXPORT_SYMBOL(s3c_device_usb
);
69 static struct resource s3c_lcd_resource
[] = {
71 .start
= S3C2410_PA_LCD
,
72 .end
= S3C2410_PA_LCD
+ S3C2410_SZ_LCD
,
73 .flags
= IORESOURCE_MEM
,
78 .flags
= IORESOURCE_IRQ
,
83 static u64 s3c_device_lcd_dmamask
= 0xffffffffUL
;
85 struct platform_device s3c_device_lcd
= {
86 .name
= "s3c2410-lcd",
88 .num_resources
= ARRAY_SIZE(s3c_lcd_resource
),
89 .resource
= s3c_lcd_resource
,
91 .dma_mask
= &s3c_device_lcd_dmamask
,
92 .coherent_dma_mask
= 0xffffffffUL
96 EXPORT_SYMBOL(s3c_device_lcd
);
100 static struct resource s3c_nand_resource
[] = {
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",
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
[] = {
121 .start
= S3C2410_PA_USBDEV
,
122 .end
= S3C2410_PA_USBDEV
+ S3C2410_SZ_USBDEV
,
123 .flags
= IORESOURCE_MEM
,
128 .flags
= IORESOURCE_IRQ
,
133 struct platform_device s3c_device_usbgadget
= {
134 .name
= "s3c2410-usbgadget",
136 .num_resources
= ARRAY_SIZE(s3c_usbgadget_resource
),
137 .resource
= s3c_usbgadget_resource
,
140 EXPORT_SYMBOL(s3c_device_usbgadget
);
144 static struct resource s3c_wdt_resource
[] = {
146 .start
= S3C2410_PA_WATCHDOG
,
147 .end
= S3C2410_PA_WATCHDOG
+ S3C2410_SZ_WATCHDOG
,
148 .flags
= IORESOURCE_MEM
,
153 .flags
= IORESOURCE_IRQ
,
158 struct platform_device s3c_device_wdt
= {
159 .name
= "s3c2410-wdt",
161 .num_resources
= ARRAY_SIZE(s3c_wdt_resource
),
162 .resource
= s3c_wdt_resource
,
165 EXPORT_SYMBOL(s3c_device_wdt
);
169 static struct resource s3c_i2c_resource
[] = {
171 .start
= S3C2410_PA_IIC
,
172 .end
= S3C2410_PA_IIC
+ S3C2410_SZ_IIC
,
173 .flags
= IORESOURCE_MEM
,
178 .flags
= IORESOURCE_IRQ
,
183 struct platform_device s3c_device_i2c
= {
184 .name
= "s3c2410-i2c",
186 .num_resources
= ARRAY_SIZE(s3c_i2c_resource
),
187 .resource
= s3c_i2c_resource
,
190 EXPORT_SYMBOL(s3c_device_i2c
);
194 static struct resource s3c_iis_resource
[] = {
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",
207 .num_resources
= ARRAY_SIZE(s3c_iis_resource
),
208 .resource
= s3c_iis_resource
,
210 .dma_mask
= &s3c_device_iis_dmamask
,
211 .coherent_dma_mask
= 0xffffffffUL
215 EXPORT_SYMBOL(s3c_device_iis
);
219 static struct resource s3c_rtc_resource
[] = {
221 .start
= S3C2410_PA_RTC
,
222 .end
= S3C2410_PA_RTC
+ 0xff,
223 .flags
= IORESOURCE_MEM
,
228 .flags
= IORESOURCE_IRQ
,
233 .flags
= IORESOURCE_IRQ
237 struct platform_device s3c_device_rtc
= {
238 .name
= "s3c2410-rtc",
240 .num_resources
= ARRAY_SIZE(s3c_rtc_resource
),
241 .resource
= s3c_rtc_resource
,
244 EXPORT_SYMBOL(s3c_device_rtc
);
248 static struct resource s3c_adc_resource
[] = {
250 .start
= S3C2410_PA_ADC
,
251 .end
= S3C2410_PA_ADC
+ S3C2410_SZ_ADC
,
252 .flags
= IORESOURCE_MEM
,
257 .flags
= IORESOURCE_IRQ
,
262 struct platform_device s3c_device_adc
= {
263 .name
= "s3c2410-adc",
265 .num_resources
= ARRAY_SIZE(s3c_adc_resource
),
266 .resource
= s3c_adc_resource
,
271 static struct resource s3c_sdi_resource
[] = {
273 .start
= S3C2410_PA_SDI
,
274 .end
= S3C2410_PA_SDI
+ S3C2410_SZ_SDI
,
275 .flags
= IORESOURCE_MEM
,
280 .flags
= IORESOURCE_IRQ
,
285 struct platform_device s3c_device_sdi
= {
286 .name
= "s3c2410-sdi",
288 .num_resources
= ARRAY_SIZE(s3c_sdi_resource
),
289 .resource
= s3c_sdi_resource
,
292 EXPORT_SYMBOL(s3c_device_sdi
);
296 static struct resource s3c_spi0_resource
[] = {
298 .start
= S3C2410_PA_SPI
,
299 .end
= S3C2410_PA_SPI
+ 0x1f,
300 .flags
= IORESOURCE_MEM
,
305 .flags
= IORESOURCE_IRQ
,
310 struct platform_device s3c_device_spi0
= {
311 .name
= "s3c2410-spi",
313 .num_resources
= ARRAY_SIZE(s3c_spi0_resource
),
314 .resource
= s3c_spi0_resource
,
317 EXPORT_SYMBOL(s3c_device_spi0
);
321 static struct resource s3c_spi1_resource
[] = {
323 .start
= S3C2410_PA_SPI
+ 0x20,
324 .end
= S3C2410_PA_SPI
+ 0x20 + 0x1f,
325 .flags
= IORESOURCE_MEM
,
330 .flags
= IORESOURCE_IRQ
,
335 struct platform_device s3c_device_spi1
= {
336 .name
= "s3c2410-spi",
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
[] = {
348 .start
= S3C2410_PA_TIMER
+ 0x0C,
349 .end
= S3C2410_PA_TIMER
+ 0x0C + 0xB,
350 .flags
= IORESOURCE_MEM
,
355 .flags
= IORESOURCE_IRQ
,
360 struct platform_device s3c_device_timer0
= {
361 .name
= "s3c2410-timer",
363 .num_resources
= ARRAY_SIZE(s3c_timer0_resource
),
364 .resource
= s3c_timer0_resource
,
367 EXPORT_SYMBOL(s3c_device_timer0
);
371 static struct resource s3c_timer1_resource
[] = {
373 .start
= S3C2410_PA_TIMER
+ 0x18,
374 .end
= S3C2410_PA_TIMER
+ 0x23,
375 .flags
= IORESOURCE_MEM
,
380 .flags
= IORESOURCE_IRQ
,
385 struct platform_device s3c_device_timer1
= {
386 .name
= "s3c2410-timer",
388 .num_resources
= ARRAY_SIZE(s3c_timer1_resource
),
389 .resource
= s3c_timer1_resource
,
392 EXPORT_SYMBOL(s3c_device_timer1
);
396 static struct resource s3c_timer2_resource
[] = {
398 .start
= S3C2410_PA_TIMER
+ 0x24,
399 .end
= S3C2410_PA_TIMER
+ 0x2F,
400 .flags
= IORESOURCE_MEM
,
405 .flags
= IORESOURCE_IRQ
,
410 struct platform_device s3c_device_timer2
= {
411 .name
= "s3c2410-timer",
413 .num_resources
= ARRAY_SIZE(s3c_timer2_resource
),
414 .resource
= s3c_timer2_resource
,
417 EXPORT_SYMBOL(s3c_device_timer2
);
421 static struct resource s3c_timer3_resource
[] = {
423 .start
= S3C2410_PA_TIMER
+ 0x30,
424 .end
= S3C2410_PA_TIMER
+ 0x3B,
425 .flags
= IORESOURCE_MEM
,
430 .flags
= IORESOURCE_IRQ
,
435 struct platform_device s3c_device_timer3
= {
436 .name
= "s3c2410-timer",
438 .num_resources
= ARRAY_SIZE(s3c_timer3_resource
),
439 .resource
= s3c_timer3_resource
,
442 EXPORT_SYMBOL(s3c_device_timer3
);