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.
11 #include <linux/platform_device.h>
12 #include <linux/init.h>
14 #include <asm/mach-au1x00/au1xxx.h>
16 /* OHCI (USB full speed host controller) */
17 static struct resource au1xxx_usb_ohci_resources[] = {
19 .start = USB_OHCI_BASE,
20 .end = USB_OHCI_BASE + USB_OHCI_LEN - 1,
21 .flags = IORESOURCE_MEM,
24 .start = AU1000_USB_HOST_INT,
25 .end = AU1000_USB_HOST_INT,
26 .flags = IORESOURCE_IRQ,
30 /* The dmamask must be set for OHCI to work */
31 static u64 ohci_dmamask = ~(u32)0;
33 static struct platform_device au1xxx_usb_ohci_device = {
34 .name = "au1xxx-ohci",
37 .dma_mask = &ohci_dmamask,
38 .coherent_dma_mask = 0xffffffff,
40 .num_resources = ARRAY_SIZE(au1xxx_usb_ohci_resources),
41 .resource = au1xxx_usb_ohci_resources,
44 /*** AU1100 LCD controller ***/
46 #ifdef CONFIG_FB_AU1100
47 static struct resource au1100_lcd_resources[] = {
49 .start = LCD_PHYS_ADDR,
50 .end = LCD_PHYS_ADDR + 0x800 - 1,
51 .flags = IORESOURCE_MEM,
54 .start = AU1100_LCD_INT,
55 .end = AU1100_LCD_INT,
56 .flags = IORESOURCE_IRQ,
60 static u64 au1100_lcd_dmamask = ~(u32)0;
62 static struct platform_device au1100_lcd_device = {
66 .dma_mask = &au1100_lcd_dmamask,
67 .coherent_dma_mask = 0xffffffff,
69 .num_resources = ARRAY_SIZE(au1100_lcd_resources),
70 .resource = au1100_lcd_resources,
74 #ifdef CONFIG_SOC_AU1200
75 /* EHCI (USB high speed host controller) */
76 static struct resource au1xxx_usb_ehci_resources[] = {
78 .start = USB_EHCI_BASE,
79 .end = USB_EHCI_BASE + USB_EHCI_LEN - 1,
80 .flags = IORESOURCE_MEM,
83 .start = AU1000_USB_HOST_INT,
84 .end = AU1000_USB_HOST_INT,
85 .flags = IORESOURCE_IRQ,
89 static u64 ehci_dmamask = ~(u32)0;
91 static struct platform_device au1xxx_usb_ehci_device = {
92 .name = "au1xxx-ehci",
95 .dma_mask = &ehci_dmamask,
96 .coherent_dma_mask = 0xffffffff,
98 .num_resources = ARRAY_SIZE(au1xxx_usb_ehci_resources),
99 .resource = au1xxx_usb_ehci_resources,
102 /* Au1200 UDC (USB gadget controller) */
103 static struct resource au1xxx_usb_gdt_resources[] = {
105 .start = USB_UDC_BASE,
106 .end = USB_UDC_BASE + USB_UDC_LEN - 1,
107 .flags = IORESOURCE_MEM,
110 .start = AU1200_USB_INT,
111 .end = AU1200_USB_INT,
112 .flags = IORESOURCE_IRQ,
116 static struct resource au1xxx_mmc_resources[] = {
118 .start = SD0_PHYS_ADDR,
119 .end = SD0_PHYS_ADDR + 0x40,
120 .flags = IORESOURCE_MEM,
123 .start = SD1_PHYS_ADDR,
124 .end = SD1_PHYS_ADDR + 0x40,
125 .flags = IORESOURCE_MEM,
128 .start = AU1200_SD_INT,
129 .end = AU1200_SD_INT,
130 .flags = IORESOURCE_IRQ,
134 static u64 udc_dmamask = ~(u32)0;
136 static struct platform_device au1xxx_usb_gdt_device = {
137 .name = "au1xxx-udc",
140 .dma_mask = &udc_dmamask,
141 .coherent_dma_mask = 0xffffffff,
143 .num_resources = ARRAY_SIZE(au1xxx_usb_gdt_resources),
144 .resource = au1xxx_usb_gdt_resources,
147 /* Au1200 UOC (USB OTG controller) */
148 static struct resource au1xxx_usb_otg_resources[] = {
150 .start = USB_UOC_BASE,
151 .end = USB_UOC_BASE + USB_UOC_LEN - 1,
152 .flags = IORESOURCE_MEM,
155 .start = AU1200_USB_INT,
156 .end = AU1200_USB_INT,
157 .flags = IORESOURCE_IRQ,
161 static u64 uoc_dmamask = ~(u32)0;
163 static struct platform_device au1xxx_usb_otg_device = {
164 .name = "au1xxx-uoc",
167 .dma_mask = &uoc_dmamask,
168 .coherent_dma_mask = 0xffffffff,
170 .num_resources = ARRAY_SIZE(au1xxx_usb_otg_resources),
171 .resource = au1xxx_usb_otg_resources,
174 static struct resource au1200_lcd_resources[] = {
176 .start = LCD_PHYS_ADDR,
177 .end = LCD_PHYS_ADDR + 0x800 - 1,
178 .flags = IORESOURCE_MEM,
181 .start = AU1200_LCD_INT,
182 .end = AU1200_LCD_INT,
183 .flags = IORESOURCE_IRQ,
187 static struct resource au1200_ide0_resources[] = {
189 .start = AU1XXX_ATA_PHYS_ADDR,
190 .end = AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN - 1,
191 .flags = IORESOURCE_MEM,
194 .start = AU1XXX_ATA_INT,
195 .end = AU1XXX_ATA_INT,
196 .flags = IORESOURCE_IRQ,
200 static u64 au1200_lcd_dmamask = ~(u32)0;
202 static struct platform_device au1200_lcd_device = {
203 .name = "au1200-lcd",
206 .dma_mask = &au1200_lcd_dmamask,
207 .coherent_dma_mask = 0xffffffff,
209 .num_resources = ARRAY_SIZE(au1200_lcd_resources),
210 .resource = au1200_lcd_resources,
214 static u64 ide0_dmamask = ~(u32)0;
216 static struct platform_device au1200_ide0_device = {
217 .name = "au1200-ide",
220 .dma_mask = &ide0_dmamask,
221 .coherent_dma_mask = 0xffffffff,
223 .num_resources = ARRAY_SIZE(au1200_ide0_resources),
224 .resource = au1200_ide0_resources,
227 static u64 au1xxx_mmc_dmamask = ~(u32)0;
229 static struct platform_device au1xxx_mmc_device = {
230 .name = "au1xxx-mmc",
233 .dma_mask = &au1xxx_mmc_dmamask,
234 .coherent_dma_mask = 0xffffffff,
236 .num_resources = ARRAY_SIZE(au1xxx_mmc_resources),
237 .resource = au1xxx_mmc_resources,
239 #endif /* #ifdef CONFIG_SOC_AU1200 */
241 static struct platform_device au1x00_pcmcia_device = {
242 .name = "au1x00-pcmcia",
246 #ifdef CONFIG_MIPS_DB1200
248 static struct resource smc91x_resources[] = {
250 .name = "smc91x-regs",
251 .start = AU1XXX_SMC91111_PHYS_ADDR,
252 .end = AU1XXX_SMC91111_PHYS_ADDR + 0xfffff,
253 .flags = IORESOURCE_MEM,
256 .start = AU1XXX_SMC91111_IRQ,
257 .end = AU1XXX_SMC91111_IRQ,
258 .flags = IORESOURCE_IRQ,
262 static struct platform_device smc91x_device = {
265 .num_resources = ARRAY_SIZE(smc91x_resources),
266 .resource = smc91x_resources,
271 /* All Alchemy demoboards with I2C have this #define in their headers */
272 #ifdef SMBUS_PSC_BASE
273 static struct resource pbdb_smbus_resources[] = {
275 .start = SMBUS_PSC_BASE,
276 .end = SMBUS_PSC_BASE + 0x24 - 1,
277 .flags = IORESOURCE_MEM,
281 static struct platform_device pbdb_smbus_device = {
282 .name = "au1xpsc_smbus",
283 .id = 0, /* bus number */
284 .num_resources = ARRAY_SIZE(pbdb_smbus_resources),
285 .resource = pbdb_smbus_resources,
289 static struct platform_device *au1xxx_platform_devices[] __initdata = {
290 &au1xxx_usb_ohci_device,
291 &au1x00_pcmcia_device,
292 #ifdef CONFIG_FB_AU1100
295 #ifdef CONFIG_SOC_AU1200
296 &au1xxx_usb_ehci_device,
297 &au1xxx_usb_gdt_device,
298 &au1xxx_usb_otg_device,
303 #ifdef CONFIG_MIPS_DB1200
306 #ifdef SMBUS_PSC_BASE
311 int __init au1xxx_platform_init(void)
313 return platform_add_devices(au1xxx_platform_devices, ARRAY_SIZE(au1xxx_platform_devices));
316 arch_initcall(au1xxx_platform_init);