[PATCH] USB: EHCI for AU1200
[linux-2.6/x86.git] / arch / mips / au1000 / common / platform.c
blob1fb3dbdb93be1b4d978daceb9ec3eb9a766938a4
1 /*
2 * Platform device support for Au1x00 SoCs.
4 * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10 #include <linux/config.h>
11 #include <linux/device.h>
12 #include <linux/platform_device.h>
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/resource.h>
17 #include <asm/mach-au1x00/au1xxx.h>
19 /* OHCI (USB full speed host controller) */
20 static struct resource au1xxx_usb_ohci_resources[] = {
21 [0] = {
22 .start = USB_OHCI_BASE,
23 .end = USB_OHCI_BASE + USB_OHCI_LEN,
24 .flags = IORESOURCE_MEM,
26 [1] = {
27 .start = AU1000_USB_HOST_INT,
28 .end = AU1000_USB_HOST_INT,
29 .flags = IORESOURCE_IRQ,
33 /* The dmamask must be set for OHCI to work */
34 static u64 ohci_dmamask = ~(u32)0;
36 static struct platform_device au1xxx_usb_ohci_device = {
37 .name = "au1xxx-ohci",
38 .id = 0,
39 .dev = {
40 .dma_mask = &ohci_dmamask,
41 .coherent_dma_mask = 0xffffffff,
43 .num_resources = ARRAY_SIZE(au1xxx_usb_ohci_resources),
44 .resource = au1xxx_usb_ohci_resources,
47 /*** AU1100 LCD controller ***/
49 #ifdef CONFIG_FB_AU1100
50 static struct resource au1100_lcd_resources[] = {
51 [0] = {
52 .start = LCD_PHYS_ADDR,
53 .end = LCD_PHYS_ADDR + 0x800 - 1,
54 .flags = IORESOURCE_MEM,
56 [1] = {
57 .start = AU1100_LCD_INT,
58 .end = AU1100_LCD_INT,
59 .flags = IORESOURCE_IRQ,
63 static u64 au1100_lcd_dmamask = ~(u32)0;
65 static struct platform_device au1100_lcd_device = {
66 .name = "au1100-lcd",
67 .id = 0,
68 .dev = {
69 .dma_mask = &au1100_lcd_dmamask,
70 .coherent_dma_mask = 0xffffffff,
72 .num_resources = ARRAY_SIZE(au1100_lcd_resources),
73 .resource = au1100_lcd_resources,
75 #endif
77 #ifdef CONFIG_SOC_AU1200
78 /* EHCI (USB high speed host controller) */
79 static struct resource au1xxx_usb_ehci_resources[] = {
80 [0] = {
81 .start = USB_EHCI_BASE,
82 .end = USB_EHCI_BASE + USB_EHCI_LEN - 1,
83 .flags = IORESOURCE_MEM,
85 [1] = {
86 .start = AU1000_USB_HOST_INT,
87 .end = AU1000_USB_HOST_INT,
88 .flags = IORESOURCE_IRQ,
92 static u64 ehci_dmamask = ~(u32)0;
94 static struct platform_device au1xxx_usb_ehci_device = {
95 .name = "au1xxx-ehci",
96 .id = 0,
97 .dev = {
98 .dma_mask = &ehci_dmamask,
99 .coherent_dma_mask = 0xffffffff,
101 .num_resources = ARRAY_SIZE(au1xxx_usb_ehci_resources),
102 .resource = au1xxx_usb_ehci_resources,
105 /* Au1200 UDC (USB gadget controller) */
106 static struct resource au1xxx_usb_gdt_resources[] = {
107 [0] = {
108 .start = USB_UDC_BASE,
109 .end = USB_UDC_BASE + USB_UDC_LEN - 1,
110 .flags = IORESOURCE_MEM,
112 [1] = {
113 .start = AU1200_USB_INT,
114 .end = AU1200_USB_INT,
115 .flags = IORESOURCE_IRQ,
119 static struct resource au1xxx_mmc_resources[] = {
120 [0] = {
121 .start = SD0_PHYS_ADDR,
122 .end = SD0_PHYS_ADDR + 0x40,
123 .flags = IORESOURCE_MEM,
125 [1] = {
126 .start = SD1_PHYS_ADDR,
127 .end = SD1_PHYS_ADDR + 0x40,
128 .flags = IORESOURCE_MEM,
130 [2] = {
131 .start = AU1200_SD_INT,
132 .end = AU1200_SD_INT,
133 .flags = IORESOURCE_IRQ,
137 static u64 udc_dmamask = ~(u32)0;
139 static struct platform_device au1xxx_usb_gdt_device = {
140 .name = "au1xxx-udc",
141 .id = 0,
142 .dev = {
143 .dma_mask = &udc_dmamask,
144 .coherent_dma_mask = 0xffffffff,
146 .num_resources = ARRAY_SIZE(au1xxx_usb_gdt_resources),
147 .resource = au1xxx_usb_gdt_resources,
150 /* Au1200 UOC (USB OTG controller) */
151 static struct resource au1xxx_usb_otg_resources[] = {
152 [0] = {
153 .start = USB_UOC_BASE,
154 .end = USB_UOC_BASE + USB_UOC_LEN - 1,
155 .flags = IORESOURCE_MEM,
157 [1] = {
158 .start = AU1200_USB_INT,
159 .end = AU1200_USB_INT,
160 .flags = IORESOURCE_IRQ,
164 static u64 uoc_dmamask = ~(u32)0;
166 static struct platform_device au1xxx_usb_otg_device = {
167 .name = "au1xxx-uoc",
168 .id = 0,
169 .dev = {
170 .dma_mask = &uoc_dmamask,
171 .coherent_dma_mask = 0xffffffff,
173 .num_resources = ARRAY_SIZE(au1xxx_usb_otg_resources),
174 .resource = au1xxx_usb_otg_resources,
177 static struct resource au1200_lcd_resources[] = {
178 [0] = {
179 .start = LCD_PHYS_ADDR,
180 .end = LCD_PHYS_ADDR + 0x800 - 1,
181 .flags = IORESOURCE_MEM,
183 [1] = {
184 .start = AU1200_LCD_INT,
185 .end = AU1200_LCD_INT,
186 .flags = IORESOURCE_IRQ,
190 static struct resource au1200_ide0_resources[] = {
191 [0] = {
192 .start = AU1XXX_ATA_PHYS_ADDR,
193 .end = AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN,
194 .flags = IORESOURCE_MEM,
196 [1] = {
197 .start = AU1XXX_ATA_INT,
198 .end = AU1XXX_ATA_INT,
199 .flags = IORESOURCE_IRQ,
203 static u64 au1200_lcd_dmamask = ~(u32)0;
205 static struct platform_device au1200_lcd_device = {
206 .name = "au1200-lcd",
207 .id = 0,
208 .dev = {
209 .dma_mask = &au1200_lcd_dmamask,
210 .coherent_dma_mask = 0xffffffff,
212 .num_resources = ARRAY_SIZE(au1200_lcd_resources),
213 .resource = au1200_lcd_resources,
217 static u64 ide0_dmamask = ~(u32)0;
219 static struct platform_device au1200_ide0_device = {
220 .name = "au1200-ide",
221 .id = 0,
222 .dev = {
223 .dma_mask = &ide0_dmamask,
224 .coherent_dma_mask = 0xffffffff,
226 .num_resources = ARRAY_SIZE(au1200_ide0_resources),
227 .resource = au1200_ide0_resources,
230 static u64 au1xxx_mmc_dmamask = ~(u32)0;
232 static struct platform_device au1xxx_mmc_device = {
233 .name = "au1xxx-mmc",
234 .id = 0,
235 .dev = {
236 .dma_mask = &au1xxx_mmc_dmamask,
237 .coherent_dma_mask = 0xffffffff,
239 .num_resources = ARRAY_SIZE(au1xxx_mmc_resources),
240 .resource = au1xxx_mmc_resources,
242 #endif /* #ifdef CONFIG_SOC_AU1200 */
244 static struct platform_device au1x00_pcmcia_device = {
245 .name = "au1x00-pcmcia",
246 .id = 0,
249 #ifdef CONFIG_MIPS_DB1200
251 static struct resource smc91x_resources[] = {
252 [0] = {
253 .name = "smc91x-regs",
254 .start = AU1XXX_SMC91111_PHYS_ADDR,
255 .end = AU1XXX_SMC91111_PHYS_ADDR + 0xfffff,
256 .flags = IORESOURCE_MEM,
258 [1] = {
259 .start = AU1XXX_SMC91111_IRQ,
260 .end = AU1XXX_SMC91111_IRQ,
261 .flags = IORESOURCE_IRQ,
265 static struct platform_device smc91x_device = {
266 .name = "smc91x",
267 .id = -1,
268 .num_resources = ARRAY_SIZE(smc91x_resources),
269 .resource = smc91x_resources,
272 #endif
274 static struct platform_device *au1xxx_platform_devices[] __initdata = {
275 &au1xxx_usb_ohci_device,
276 &au1x00_pcmcia_device,
277 #ifdef CONFIG_FB_AU1100
278 &au1100_lcd_device,
279 #endif
280 #ifdef CONFIG_SOC_AU1200
281 &au1xxx_usb_ehci_device,
282 &au1xxx_usb_gdt_device,
283 &au1xxx_usb_otg_device,
284 &au1200_lcd_device,
285 &au1200_ide0_device,
286 &au1xxx_mmc_device,
287 #endif
288 #ifdef CONFIG_MIPS_DB1200
289 &smc91x_device,
290 #endif
293 int au1xxx_platform_init(void)
295 return platform_add_devices(au1xxx_platform_devices, ARRAY_SIZE(au1xxx_platform_devices));
298 arch_initcall(au1xxx_platform_init);