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/device.h>
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/resource.h>
15 #include <asm/mach-au1x00/au1000.h>
17 /* OHCI (USB full speed host controller) */
18 static struct resource au1xxx_usb_ohci_resources
[] = {
20 .start
= USB_OHCI_BASE
,
21 .end
= USB_OHCI_BASE
+ USB_OHCI_LEN
,
22 .flags
= IORESOURCE_MEM
,
25 .start
= AU1000_USB_HOST_INT
,
26 .end
= AU1000_USB_HOST_INT
,
27 .flags
= IORESOURCE_IRQ
,
31 /* The dmamask must be set for OHCI to work */
32 static u64 ohci_dmamask
= ~(u32
)0;
34 static struct platform_device au1xxx_usb_ohci_device
= {
35 .name
= "au1xxx-ohci",
38 .dma_mask
= &ohci_dmamask
,
39 .coherent_dma_mask
= 0xffffffff,
41 .num_resources
= ARRAY_SIZE(au1xxx_usb_ohci_resources
),
42 .resource
= au1xxx_usb_ohci_resources
,
45 /*** AU1100 LCD controller ***/
47 #ifdef CONFIG_FB_AU1100
48 static struct resource au1100_lcd_resources
[] = {
50 .start
= LCD_PHYS_ADDR
,
51 .end
= LCD_PHYS_ADDR
+ 0x800 - 1,
52 .flags
= IORESOURCE_MEM
,
55 .start
= AU1100_LCD_INT
,
56 .end
= AU1100_LCD_INT
,
57 .flags
= IORESOURCE_IRQ
,
61 static u64 au1100_lcd_dmamask
= ~(u32
)0;
63 static struct platform_device au1100_lcd_device
= {
67 .dma_mask
= &au1100_lcd_dmamask
,
68 .coherent_dma_mask
= 0xffffffff,
70 .num_resources
= ARRAY_SIZE(au1100_lcd_resources
),
71 .resource
= au1100_lcd_resources
,
75 #ifdef CONFIG_SOC_AU1200
76 /* EHCI (USB high speed host controller) */
77 static struct resource au1xxx_usb_ehci_resources
[] = {
79 .start
= USB_EHCI_BASE
,
80 .end
= USB_EHCI_BASE
+ USB_EHCI_LEN
- 1,
81 .flags
= IORESOURCE_MEM
,
84 .start
= AU1000_USB_HOST_INT
,
85 .end
= AU1000_USB_HOST_INT
,
86 .flags
= IORESOURCE_IRQ
,
90 static u64 ehci_dmamask
= ~(u32
)0;
92 static struct platform_device au1xxx_usb_ehci_device
= {
93 .name
= "au1xxx-ehci",
96 .dma_mask
= &ehci_dmamask
,
97 .coherent_dma_mask
= 0xffffffff,
99 .num_resources
= ARRAY_SIZE(au1xxx_usb_ehci_resources
),
100 .resource
= au1xxx_usb_ehci_resources
,
103 /* Au1200 UDC (USB gadget controller) */
104 static struct resource au1xxx_usb_gdt_resources
[] = {
106 .start
= USB_UDC_BASE
,
107 .end
= USB_UDC_BASE
+ USB_UDC_LEN
- 1,
108 .flags
= IORESOURCE_MEM
,
111 .start
= AU1200_USB_INT
,
112 .end
= AU1200_USB_INT
,
113 .flags
= IORESOURCE_IRQ
,
117 static u64 udc_dmamask
= ~(u32
)0;
119 static struct platform_device au1xxx_usb_gdt_device
= {
120 .name
= "au1xxx-udc",
123 .dma_mask
= &udc_dmamask
,
124 .coherent_dma_mask
= 0xffffffff,
126 .num_resources
= ARRAY_SIZE(au1xxx_usb_gdt_resources
),
127 .resource
= au1xxx_usb_gdt_resources
,
130 /* Au1200 UOC (USB OTG controller) */
131 static struct resource au1xxx_usb_otg_resources
[] = {
133 .start
= USB_UOC_BASE
,
134 .end
= USB_UOC_BASE
+ USB_UOC_LEN
- 1,
135 .flags
= IORESOURCE_MEM
,
138 .start
= AU1200_USB_INT
,
139 .end
= AU1200_USB_INT
,
140 .flags
= IORESOURCE_IRQ
,
144 static u64 uoc_dmamask
= ~(u32
)0;
146 static struct platform_device au1xxx_usb_otg_device
= {
147 .name
= "au1xxx-uoc",
150 .dma_mask
= &uoc_dmamask
,
151 .coherent_dma_mask
= 0xffffffff,
153 .num_resources
= ARRAY_SIZE(au1xxx_usb_otg_resources
),
154 .resource
= au1xxx_usb_otg_resources
,
157 /*** AU1200 LCD controller ***/
158 static struct resource au1200_lcd_resources
[] = {
160 .start
= LCD_PHYS_ADDR
,
161 .end
= LCD_PHYS_ADDR
+ 0x800 - 1,
162 .flags
= IORESOURCE_MEM
,
165 .start
= AU1200_LCD_INT
,
166 .end
= AU1200_LCD_INT
,
167 .flags
= IORESOURCE_IRQ
,
171 static u64 au1200_lcd_dmamask
= ~(u32
)0;
173 static struct platform_device au1200_lcd_device
= {
174 .name
= "au1200-lcd",
177 .dma_mask
= &au1200_lcd_dmamask
,
178 .coherent_dma_mask
= 0xffffffff,
180 .num_resources
= ARRAY_SIZE(au1200_lcd_resources
),
181 .resource
= au1200_lcd_resources
,
185 static struct platform_device
*au1xxx_platform_devices
[] __initdata
= {
186 &au1xxx_usb_ohci_device
,
187 #ifdef CONFIG_FB_AU1100
190 #ifdef CONFIG_SOC_AU1200
192 &au1xxx_usb_ehci_device
,
194 &au1xxx_usb_gdt_device
,
195 &au1xxx_usb_otg_device
,
200 int au1xxx_platform_init(void)
202 return platform_add_devices(au1xxx_platform_devices
, ARRAY_SIZE(au1xxx_platform_devices
));
205 arch_initcall(au1xxx_platform_init
);