diff options
Diffstat (limited to 'arch/mips/au1000/common/platform.c')
-rw-r--r-- | arch/mips/au1000/common/platform.c | 248 |
1 files changed, 247 insertions, 1 deletions
diff --git a/arch/mips/au1000/common/platform.c b/arch/mips/au1000/common/platform.c index 0776b2db5641..1f7b465c8038 100644 --- a/arch/mips/au1000/common/platform.c +++ b/arch/mips/au1000/common/platform.c | |||
@@ -7,13 +7,15 @@ | |||
7 | * License version 2. This program is licensed "as is" without any | 7 | * License version 2. This program is licensed "as is" without any |
8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
9 | */ | 9 | */ |
10 | #include <linux/config.h> | ||
10 | #include <linux/device.h> | 11 | #include <linux/device.h> |
11 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
13 | #include <linux/resource.h> | 14 | #include <linux/resource.h> |
14 | 15 | ||
15 | #include <asm/mach-au1x00/au1000.h> | 16 | #include <asm/mach-au1x00/au1xxx.h> |
16 | 17 | ||
18 | /* OHCI (USB full speed host controller) */ | ||
17 | static struct resource au1xxx_usb_ohci_resources[] = { | 19 | static struct resource au1xxx_usb_ohci_resources[] = { |
18 | [0] = { | 20 | [0] = { |
19 | .start = USB_OHCI_BASE, | 21 | .start = USB_OHCI_BASE, |
@@ -41,8 +43,252 @@ static struct platform_device au1xxx_usb_ohci_device = { | |||
41 | .resource = au1xxx_usb_ohci_resources, | 43 | .resource = au1xxx_usb_ohci_resources, |
42 | }; | 44 | }; |
43 | 45 | ||
46 | /*** AU1100 LCD controller ***/ | ||
47 | |||
48 | #ifdef CONFIG_FB_AU1100 | ||
49 | static struct resource au1100_lcd_resources[] = { | ||
50 | [0] = { | ||
51 | .start = LCD_PHYS_ADDR, | ||
52 | .end = LCD_PHYS_ADDR + 0x800 - 1, | ||
53 | .flags = IORESOURCE_MEM, | ||
54 | }, | ||
55 | [1] = { | ||
56 | .start = AU1100_LCD_INT, | ||
57 | .end = AU1100_LCD_INT, | ||
58 | .flags = IORESOURCE_IRQ, | ||
59 | } | ||
60 | }; | ||
61 | |||
62 | static u64 au1100_lcd_dmamask = ~(u32)0; | ||
63 | |||
64 | static struct platform_device au1100_lcd_device = { | ||
65 | .name = "au1100-lcd", | ||
66 | .id = 0, | ||
67 | .dev = { | ||
68 | .dma_mask = &au1100_lcd_dmamask, | ||
69 | .coherent_dma_mask = 0xffffffff, | ||
70 | }, | ||
71 | .num_resources = ARRAY_SIZE(au1100_lcd_resources), | ||
72 | .resource = au1100_lcd_resources, | ||
73 | }; | ||
74 | #endif | ||
75 | |||
76 | #ifdef CONFIG_SOC_AU1200 | ||
77 | /* EHCI (USB high speed host controller) */ | ||
78 | static struct resource au1xxx_usb_ehci_resources[] = { | ||
79 | [0] = { | ||
80 | .start = USB_EHCI_BASE, | ||
81 | .end = USB_EHCI_BASE + USB_EHCI_LEN - 1, | ||
82 | .flags = IORESOURCE_MEM, | ||
83 | }, | ||
84 | [1] = { | ||
85 | .start = AU1000_USB_HOST_INT, | ||
86 | .end = AU1000_USB_HOST_INT, | ||
87 | .flags = IORESOURCE_IRQ, | ||
88 | }, | ||
89 | }; | ||
90 | |||
91 | static u64 ehci_dmamask = ~(u32)0; | ||
92 | |||
93 | static struct platform_device au1xxx_usb_ehci_device = { | ||
94 | .name = "au1xxx-ehci", | ||
95 | .id = 0, | ||
96 | .dev = { | ||
97 | .dma_mask = &ehci_dmamask, | ||
98 | .coherent_dma_mask = 0xffffffff, | ||
99 | }, | ||
100 | .num_resources = ARRAY_SIZE(au1xxx_usb_ehci_resources), | ||
101 | .resource = au1xxx_usb_ehci_resources, | ||
102 | }; | ||
103 | |||
104 | /* Au1200 UDC (USB gadget controller) */ | ||
105 | static struct resource au1xxx_usb_gdt_resources[] = { | ||
106 | [0] = { | ||
107 | .start = USB_UDC_BASE, | ||
108 | .end = USB_UDC_BASE + USB_UDC_LEN - 1, | ||
109 | .flags = IORESOURCE_MEM, | ||
110 | }, | ||
111 | [1] = { | ||
112 | .start = AU1200_USB_INT, | ||
113 | .end = AU1200_USB_INT, | ||
114 | .flags = IORESOURCE_IRQ, | ||
115 | }, | ||
116 | }; | ||
117 | |||
118 | static struct resource au1xxx_mmc_resources[] = { | ||
119 | [0] = { | ||
120 | .start = SD0_PHYS_ADDR, | ||
121 | .end = SD0_PHYS_ADDR + 0x40, | ||
122 | .flags = IORESOURCE_MEM, | ||
123 | }, | ||
124 | [1] = { | ||
125 | .start = SD1_PHYS_ADDR, | ||
126 | .end = SD1_PHYS_ADDR + 0x40, | ||
127 | .flags = IORESOURCE_MEM, | ||
128 | }, | ||
129 | [2] = { | ||
130 | .start = AU1200_SD_INT, | ||
131 | .end = AU1200_SD_INT, | ||
132 | .flags = IORESOURCE_IRQ, | ||
133 | } | ||
134 | }; | ||
135 | |||
136 | static u64 udc_dmamask = ~(u32)0; | ||
137 | |||
138 | static struct platform_device au1xxx_usb_gdt_device = { | ||
139 | .name = "au1xxx-udc", | ||
140 | .id = 0, | ||
141 | .dev = { | ||
142 | .dma_mask = &udc_dmamask, | ||
143 | .coherent_dma_mask = 0xffffffff, | ||
144 | }, | ||
145 | .num_resources = ARRAY_SIZE(au1xxx_usb_gdt_resources), | ||
146 | .resource = au1xxx_usb_gdt_resources, | ||
147 | }; | ||
148 | |||
149 | /* Au1200 UOC (USB OTG controller) */ | ||
150 | static struct resource au1xxx_usb_otg_resources[] = { | ||
151 | [0] = { | ||
152 | .start = USB_UOC_BASE, | ||
153 | .end = USB_UOC_BASE + USB_UOC_LEN - 1, | ||
154 | .flags = IORESOURCE_MEM, | ||
155 | }, | ||
156 | [1] = { | ||
157 | .start = AU1200_USB_INT, | ||
158 | .end = AU1200_USB_INT, | ||
159 | .flags = IORESOURCE_IRQ, | ||
160 | }, | ||
161 | }; | ||
162 | |||
163 | static u64 uoc_dmamask = ~(u32)0; | ||
164 | |||
165 | static struct platform_device au1xxx_usb_otg_device = { | ||
166 | .name = "au1xxx-uoc", | ||
167 | .id = 0, | ||
168 | .dev = { | ||
169 | .dma_mask = &uoc_dmamask, | ||
170 | .coherent_dma_mask = 0xffffffff, | ||
171 | }, | ||
172 | .num_resources = ARRAY_SIZE(au1xxx_usb_otg_resources), | ||
173 | .resource = au1xxx_usb_otg_resources, | ||
174 | }; | ||
175 | |||
176 | static struct resource au1200_lcd_resources[] = { | ||
177 | [0] = { | ||
178 | .start = LCD_PHYS_ADDR, | ||
179 | .end = LCD_PHYS_ADDR + 0x800 - 1, | ||
180 | .flags = IORESOURCE_MEM, | ||
181 | }, | ||
182 | [1] = { | ||
183 | .start = AU1200_LCD_INT, | ||
184 | .end = AU1200_LCD_INT, | ||
185 | .flags = IORESOURCE_IRQ, | ||
186 | } | ||
187 | }; | ||
188 | |||
189 | static struct resource au1200_ide0_resources[] = { | ||
190 | [0] = { | ||
191 | .start = AU1XXX_ATA_PHYS_ADDR, | ||
192 | .end = AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN, | ||
193 | .flags = IORESOURCE_MEM, | ||
194 | }, | ||
195 | [1] = { | ||
196 | .start = AU1XXX_ATA_INT, | ||
197 | .end = AU1XXX_ATA_INT, | ||
198 | .flags = IORESOURCE_IRQ, | ||
199 | } | ||
200 | }; | ||
201 | |||
202 | static u64 au1200_lcd_dmamask = ~(u32)0; | ||
203 | |||
204 | static struct platform_device au1200_lcd_device = { | ||
205 | .name = "au1200-lcd", | ||
206 | .id = 0, | ||
207 | .dev = { | ||
208 | .dma_mask = &au1200_lcd_dmamask, | ||
209 | .coherent_dma_mask = 0xffffffff, | ||
210 | }, | ||
211 | .num_resources = ARRAY_SIZE(au1200_lcd_resources), | ||
212 | .resource = au1200_lcd_resources, | ||
213 | }; | ||
214 | |||
215 | |||
216 | static u64 ide0_dmamask = ~(u32)0; | ||
217 | |||
218 | static struct platform_device au1200_ide0_device = { | ||
219 | .name = "au1200-ide", | ||
220 | .id = 0, | ||
221 | .dev = { | ||
222 | .dma_mask = &ide0_dmamask, | ||
223 | .coherent_dma_mask = 0xffffffff, | ||
224 | }, | ||
225 | .num_resources = ARRAY_SIZE(au1200_ide0_resources), | ||
226 | .resource = au1200_ide0_resources, | ||
227 | }; | ||
228 | |||
229 | static u64 au1xxx_mmc_dmamask = ~(u32)0; | ||
230 | |||
231 | static struct platform_device au1xxx_mmc_device = { | ||
232 | .name = "au1xxx-mmc", | ||
233 | .id = 0, | ||
234 | .dev = { | ||
235 | .dma_mask = &au1xxx_mmc_dmamask, | ||
236 | .coherent_dma_mask = 0xffffffff, | ||
237 | }, | ||
238 | .num_resources = ARRAY_SIZE(au1xxx_mmc_resources), | ||
239 | .resource = au1xxx_mmc_resources, | ||
240 | }; | ||
241 | #endif /* #ifdef CONFIG_SOC_AU1200 */ | ||
242 | |||
243 | static struct platform_device au1x00_pcmcia_device = { | ||
244 | .name = "au1x00-pcmcia", | ||
245 | .id = 0, | ||
246 | }; | ||
247 | |||
248 | #ifdef CONFIG_MIPS_DB1200 | ||
249 | |||
250 | static struct resource smc91x_resources[] = { | ||
251 | [0] = { | ||
252 | .name = "smc91x-regs", | ||
253 | .start = AU1XXX_SMC91111_PHYS_ADDR, | ||
254 | .end = AU1XXX_SMC91111_PHYS_ADDR + 0xfffff, | ||
255 | .flags = IORESOURCE_MEM, | ||
256 | }, | ||
257 | [1] = { | ||
258 | .start = AU1XXX_SMC91111_IRQ, | ||
259 | .end = AU1XXX_SMC91111_IRQ, | ||
260 | .flags = IORESOURCE_IRQ, | ||
261 | }, | ||
262 | }; | ||
263 | |||
264 | static struct platform_device smc91x_device = { | ||
265 | .name = "smc91x", | ||
266 | .id = -1, | ||
267 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
268 | .resource = smc91x_resources, | ||
269 | }; | ||
270 | |||
271 | #endif | ||
272 | |||
44 | static struct platform_device *au1xxx_platform_devices[] __initdata = { | 273 | static struct platform_device *au1xxx_platform_devices[] __initdata = { |
45 | &au1xxx_usb_ohci_device, | 274 | &au1xxx_usb_ohci_device, |
275 | &au1x00_pcmcia_device, | ||
276 | #ifdef CONFIG_FB_AU1100 | ||
277 | &au1100_lcd_device, | ||
278 | #endif | ||
279 | #ifdef CONFIG_SOC_AU1200 | ||
280 | #if 0 /* fixme */ | ||
281 | &au1xxx_usb_ehci_device, | ||
282 | #endif | ||
283 | &au1xxx_usb_gdt_device, | ||
284 | &au1xxx_usb_otg_device, | ||
285 | &au1200_lcd_device, | ||
286 | &au1200_ide0_device, | ||
287 | &au1xxx_mmc_device, | ||
288 | #endif | ||
289 | #ifdef CONFIG_MIPS_DB1200 | ||
290 | &smc91x_device, | ||
291 | #endif | ||
46 | }; | 292 | }; |
47 | 293 | ||
48 | int au1xxx_platform_init(void) | 294 | int au1xxx_platform_init(void) |