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.
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
[] = {
22 .start
= USB_OHCI_BASE
,
23 .end
= USB_OHCI_BASE
+ USB_OHCI_LEN
,
24 .flags
= IORESOURCE_MEM
,
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",
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
[] = {
52 .start
= LCD_PHYS_ADDR
,
53 .end
= LCD_PHYS_ADDR
+ 0x800 - 1,
54 .flags
= IORESOURCE_MEM
,
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
= {
69 .dma_mask
= &au1100_lcd_dmamask
,
70 .coherent_dma_mask
= 0xffffffff,
72 .num_resources
= ARRAY_SIZE(au1100_lcd_resources
),
73 .resource
= au1100_lcd_resources
,
77 #ifdef CONFIG_SOC_AU1200
78 /* EHCI (USB high speed host controller) */
79 static struct resource au1xxx_usb_ehci_resources
[] = {
81 .start
= USB_EHCI_BASE
,
82 .end
= USB_EHCI_BASE
+ USB_EHCI_LEN
- 1,
83 .flags
= IORESOURCE_MEM
,
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",
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
[] = {
108 .start
= USB_UDC_BASE
,
109 .end
= USB_UDC_BASE
+ USB_UDC_LEN
- 1,
110 .flags
= IORESOURCE_MEM
,
113 .start
= AU1200_USB_INT
,
114 .end
= AU1200_USB_INT
,
115 .flags
= IORESOURCE_IRQ
,
119 static struct resource au1xxx_mmc_resources
[] = {
121 .start
= SD0_PHYS_ADDR
,
122 .end
= SD0_PHYS_ADDR
+ 0x40,
123 .flags
= IORESOURCE_MEM
,
126 .start
= SD1_PHYS_ADDR
,
127 .end
= SD1_PHYS_ADDR
+ 0x40,
128 .flags
= IORESOURCE_MEM
,
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",
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
[] = {
153 .start
= USB_UOC_BASE
,
154 .end
= USB_UOC_BASE
+ USB_UOC_LEN
- 1,
155 .flags
= IORESOURCE_MEM
,
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",
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
[] = {
179 .start
= LCD_PHYS_ADDR
,
180 .end
= LCD_PHYS_ADDR
+ 0x800 - 1,
181 .flags
= IORESOURCE_MEM
,
184 .start
= AU1200_LCD_INT
,
185 .end
= AU1200_LCD_INT
,
186 .flags
= IORESOURCE_IRQ
,
190 static struct resource au1200_ide0_resources
[] = {
192 .start
= AU1XXX_ATA_PHYS_ADDR
,
193 .end
= AU1XXX_ATA_PHYS_ADDR
+ AU1XXX_ATA_PHYS_LEN
,
194 .flags
= IORESOURCE_MEM
,
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",
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",
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",
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",
249 #ifdef CONFIG_MIPS_DB1200
251 static struct resource smc91x_resources
[] = {
253 .name
= "smc91x-regs",
254 .start
= AU1XXX_SMC91111_PHYS_ADDR
,
255 .end
= AU1XXX_SMC91111_PHYS_ADDR
+ 0xfffff,
256 .flags
= IORESOURCE_MEM
,
259 .start
= AU1XXX_SMC91111_IRQ
,
260 .end
= AU1XXX_SMC91111_IRQ
,
261 .flags
= IORESOURCE_IRQ
,
265 static struct platform_device smc91x_device
= {
268 .num_resources
= ARRAY_SIZE(smc91x_resources
),
269 .resource
= smc91x_resources
,
274 static struct platform_device
*au1xxx_platform_devices
[] __initdata
= {
275 &au1xxx_usb_ohci_device
,
276 &au1x00_pcmcia_device
,
277 #ifdef CONFIG_FB_AU1100
280 #ifdef CONFIG_SOC_AU1200
281 &au1xxx_usb_ehci_device
,
282 &au1xxx_usb_gdt_device
,
283 &au1xxx_usb_otg_device
,
288 #ifdef CONFIG_MIPS_DB1200
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
);