update to 2.6.9-rc1
[linux-flexiantxendom0-3.2.10.git] / arch / arm / mach-s3c2410 / devs.c
1 /* linux/arch/arm/mach-s3c2410/devs.c
2  *
3  * Copyright (c) 2004 Simtec Electronics
4  * Ben Dooks <ben@simtec.co.uk>
5  *
6  * Base S3C2410 platform device definitions
7  *
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.
11  *
12  * Modifications:
13  *     18-Aug-2004 BJD  Created initial version
14 */
15
16 #include <linux/kernel.h>
17 #include <linux/types.h>
18 #include <linux/interrupt.h>
19 #include <linux/list.h>
20 #include <linux/timer.h>
21 #include <linux/init.h>
22 #include <linux/device.h>
23
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26 #include <asm/mach/irq.h>
27
28 #include <asm/hardware.h>
29 #include <asm/io.h>
30 #include <asm/irq.h>
31
32 #include "devs.h"
33
34 /* USB Host Controller */
35
36 static struct resource s3c_usb_resource[] = {
37         [0] = {
38                 .start = S3C2410_PA_USBHOST,
39                 .end   = S3C2410_PA_USBHOST + S3C2410_SZ_USBHOST,
40                 .flags = IORESOURCE_MEM,
41         },
42         [1] = {
43                 .start = IRQ_USBH,
44                 .end   = IRQ_USBH,
45                 .flags = IORESOURCE_IRQ,
46         }
47 };
48
49 static u64 s3c_device_usb_dmamask = 0xffffffffUL;
50
51 struct platform_device s3c_device_usb = {
52         .name             = "s3c2410-ohci",
53         .id               = 0,
54         .num_resources    = ARRAY_SIZE(s3c_usb_resource),
55         .resource         = s3c_usb_resource,
56         .dev              = {
57                 .dma_mask = &s3c_device_usb_dmamask,
58                 .coherent_dma_mask = 0xffffffffUL
59         }
60 };
61
62 EXPORT_SYMBOL(s3c_device_usb);
63
64 /* LCD Controller */
65
66 static struct resource s3c_lcd_resource[] = {
67         [0] = {
68                 .start = S3C2410_PA_LCD,
69                 .end   = S3C2410_PA_LCD + S3C2410_SZ_LCD,
70                 .flags = IORESOURCE_MEM,
71         },
72         [1] = {
73                 .start = IRQ_LCD,
74                 .end   = IRQ_LCD,
75                 .flags = IORESOURCE_IRQ,
76         }
77
78 };
79
80 static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
81
82 struct platform_device s3c_device_lcd = {
83         .name             = "s3c2410-lcd",
84         .id               = 0,
85         .num_resources    = ARRAY_SIZE(s3c_lcd_resource),
86         .resource         = s3c_lcd_resource,
87         .dev              = {
88                 .dma_mask = &s3c_device_lcd_dmamask,
89                 .coherent_dma_mask = 0xffffffffUL
90         }
91 };
92
93 EXPORT_SYMBOL(s3c_device_lcd);
94
95 /* NAND Controller */
96
97 static struct resource s3c_nand_resource[] = {
98         [0] = {
99                 .start = S3C2410_PA_NAND,
100                 .end   = S3C2410_PA_NAND + S3C2410_SZ_NAND,
101                 .flags = IORESOURCE_MEM,
102         },
103         [1] = {
104                 .start = IRQ_S3CUART_RX0,
105                 .end   = IRQ_S3CUART_ERR0,
106                 .flags = IORESOURCE_IRQ,
107         }
108
109 };
110
111 struct platform_device s3c_device_nand = {
112         .name             = "s3c2410-nand",
113         .id               = 0,
114         .num_resources    = ARRAY_SIZE(s3c_nand_resource),
115         .resource         = s3c_nand_resource,
116 };
117
118 EXPORT_SYMBOL(s3c_device_nand);
119
120 /* USB Device (Gadget)*/
121
122 static struct resource s3c_usbgadget_resource[] = {
123         [0] = {
124                 .start = S3C2410_PA_USBDEV,
125                 .end   = S3C2410_PA_USBDEV + S3C2410_SZ_USBDEV,
126                 .flags = IORESOURCE_MEM,
127         },
128         [1] = {
129                 .start = IRQ_USBD,
130                 .end   = IRQ_USBD,
131                 .flags = IORESOURCE_IRQ,
132         }
133
134 };
135
136 struct platform_device s3c_device_usbgadget = {
137         .name             = "s3c2410-usbgadget",
138         .id               = 0,
139         .num_resources    = ARRAY_SIZE(s3c_usbgadget_resource),
140         .resource         = s3c_usbgadget_resource,
141 };
142
143 EXPORT_SYMBOL(s3c_device_usbgadget);
144
145 /* Watchdog */
146
147 static struct resource s3c_wdt_resource[] = {
148         [0] = {
149                 .start = S3C2410_PA_WATCHDOG,
150                 .end   = S3C2410_PA_WATCHDOG + S3C2410_SZ_WATCHDOG,
151                 .flags = IORESOURCE_MEM,
152         },
153         [1] = {
154                 .start = IRQ_WDT,
155                 .end   = IRQ_WDT,
156                 .flags = IORESOURCE_IRQ,
157         }
158
159 };
160
161 struct platform_device s3c_device_wdt = {
162         .name             = "s3c2410-wdt",
163         .id               = 0,
164         .num_resources    = ARRAY_SIZE(s3c_wdt_resource),
165         .resource         = s3c_wdt_resource,
166 };
167
168 EXPORT_SYMBOL(s3c_device_wdt);
169
170 /* I2C */
171
172 static struct resource s3c_i2c_resource[] = {
173         [0] = {
174                 .start = S3C2410_PA_IIC,
175                 .end   = S3C2410_PA_IIC + S3C2410_SZ_IIC,
176                 .flags = IORESOURCE_MEM,
177         },
178         [1] = {
179                 .start = IRQ_IIC,
180                 .end   = IRQ_IIC,
181                 .flags = IORESOURCE_IRQ,
182         }
183
184 };
185
186 struct platform_device s3c_device_i2c = {
187         .name             = "s3c2410-i2c",
188         .id               = 0,
189         .num_resources    = ARRAY_SIZE(s3c_i2c_resource),
190         .resource         = s3c_i2c_resource,
191 };
192
193 EXPORT_SYMBOL(s3c_device_i2c);
194
195 /* IIS */
196
197 static struct resource s3c_iis_resource[] = {
198         [0] = {
199                 .start = S3C2410_PA_IIS,
200                 .end   = S3C2410_PA_IIS + S3C2410_SZ_IIS,
201                 .flags = IORESOURCE_MEM,
202         }
203 };
204
205 static u64 s3c_device_iis_dmamask = 0xffffffffUL;
206
207 struct platform_device s3c_device_iis = {
208         .name             = "s3c2410-iis",
209         .id               = 0,
210         .num_resources    = ARRAY_SIZE(s3c_iis_resource),
211         .resource         = s3c_iis_resource,
212         .dev              = {
213                 .dma_mask = &s3c_device_iis_dmamask,
214                 .coherent_dma_mask = 0xffffffffUL
215         }
216 };
217
218 EXPORT_SYMBOL(s3c_device_iis);
219
220 /* RTC */
221
222 static struct resource s3c_rtc_resource[] = {
223         [0] = {
224                 .start = S3C2410_PA_RTC,
225                 .end   = S3C2410_PA_RTC + 0xff,
226                 .flags = IORESOURCE_MEM,
227         },
228         [1] = {
229                 .start = IRQ_RTC,
230                 .end   = IRQ_RTC,
231                 .flags = IORESOURCE_IRQ,
232         }
233
234 };
235
236 struct platform_device s3c_device_rtc = {
237         .name             = "s3c2410-rtc",
238         .id               = 0,
239         .num_resources    = ARRAY_SIZE(s3c_rtc_resource),
240         .resource         = s3c_rtc_resource,
241 };
242
243 EXPORT_SYMBOL(s3c_device_rtc);
244
245 /* ADC */
246
247 static struct resource s3c_adc_resource[] = {
248         [0] = {
249                 .start = S3C2410_PA_ADC,
250                 .end   = S3C2410_PA_ADC + S3C2410_SZ_ADC,
251                 .flags = IORESOURCE_MEM,
252         },
253         [1] = {
254                 .start = IRQ_TC,
255                 .end   = IRQ_ADC,
256                 .flags = IORESOURCE_IRQ,
257         }
258
259 };
260
261 struct platform_device s3c_device_adc = {
262         .name             = "s3c2410-adc",
263         .id               = 0,
264         .num_resources    = ARRAY_SIZE(s3c_adc_resource),
265         .resource         = s3c_adc_resource,
266 };
267
268 /* SDI */
269
270 static struct resource s3c_sdi_resource[] = {
271         [0] = {
272                 .start = S3C2410_PA_SDI,
273                 .end   = S3C2410_PA_SDI + S3C2410_SZ_SDI,
274                 .flags = IORESOURCE_MEM,
275         },
276         [1] = {
277                 .start = IRQ_SDI,
278                 .end   = IRQ_SDI,
279                 .flags = IORESOURCE_IRQ,
280         }
281
282 };
283
284 struct platform_device s3c_device_sdi = {
285         .name             = "s3c2410-sdi",
286         .id               = 0,
287         .num_resources    = ARRAY_SIZE(s3c_sdi_resource),
288         .resource         = s3c_sdi_resource,
289 };
290
291 EXPORT_SYMBOL(s3c_device_sdi);
292
293 /* SPI (0) */
294
295 static struct resource s3c_spi0_resource[] = {
296         [0] = {
297                 .start = S3C2410_PA_SPI,
298                 .end   = S3C2410_PA_SPI + 0x1f,
299                 .flags = IORESOURCE_MEM,
300         },
301         [1] = {
302                 .start = IRQ_SPI0,
303                 .end   = IRQ_SPI0,
304                 .flags = IORESOURCE_IRQ,
305         }
306
307 };
308
309 struct platform_device s3c_device_spi0 = {
310         .name             = "s3c2410-spi",
311         .id               = 0,
312         .num_resources    = ARRAY_SIZE(s3c_spi0_resource),
313         .resource         = s3c_spi0_resource,
314 };
315
316 EXPORT_SYMBOL(s3c_device_spi0);
317
318 /* SPI (1) */
319
320 static struct resource s3c_spi1_resource[] = {
321         [0] = {
322                 .start = S3C2410_PA_SPI + 0x20,
323                 .end   = S3C2410_PA_SPI + 0x20 + 0x1f,
324                 .flags = IORESOURCE_MEM,
325         },
326         [1] = {
327                 .start = IRQ_SPI1,
328                 .end   = IRQ_SPI1,
329                 .flags = IORESOURCE_IRQ,
330         }
331
332 };
333
334 struct platform_device s3c_device_spi1 = {
335         .name             = "s3c2410-spi",
336         .id               = 1,
337         .num_resources    = ARRAY_SIZE(s3c_spi1_resource),
338         .resource         = s3c_spi1_resource,
339 };
340
341 EXPORT_SYMBOL(s3c_device_spi1);