diff options
author | Andrew Lunn <andrew@lunn.ch> | 2011-05-15 07:32:49 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-05-16 15:11:33 -0400 |
commit | 4fcd3f374a928081d391cd9a570afe3b2c692fdc (patch) | |
tree | 04359735b7e279174e8d183c9d87906472fc0987 /arch/arm/mach-mv78xx0/common.c | |
parent | ee9627234dae8d1b8059b2ac39c961ee0932b803 (diff) |
ARM: orion: Consolidate USB platform setup code.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-mv78xx0/common.c')
-rw-r--r-- | arch/arm/mach-mv78xx0/common.c | 93 |
1 files changed, 6 insertions, 87 deletions
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index aa27c154cd0d..f250196becd7 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <mach/mv78xx0.h> | 20 | #include <mach/mv78xx0.h> |
21 | #include <mach/bridge-regs.h> | 21 | #include <mach/bridge-regs.h> |
22 | #include <plat/cache-feroceon-l2.h> | 22 | #include <plat/cache-feroceon-l2.h> |
23 | #include <plat/ehci-orion.h> | ||
24 | #include <plat/orion_nand.h> | 23 | #include <plat/orion_nand.h> |
25 | #include <plat/time.h> | 24 | #include <plat/time.h> |
26 | #include <plat/common.h> | 25 | #include <plat/common.h> |
@@ -168,110 +167,30 @@ void __init mv78xx0_map_io(void) | |||
168 | /***************************************************************************** | 167 | /***************************************************************************** |
169 | * EHCI | 168 | * EHCI |
170 | ****************************************************************************/ | 169 | ****************************************************************************/ |
171 | static struct orion_ehci_data mv78xx0_ehci_data = { | ||
172 | .dram = &mv78xx0_mbus_dram_info, | ||
173 | .phy_version = EHCI_PHY_NA, | ||
174 | }; | ||
175 | |||
176 | static u64 ehci_dmamask = DMA_BIT_MASK(32); | ||
177 | |||
178 | |||
179 | /***************************************************************************** | ||
180 | * EHCI0 | ||
181 | ****************************************************************************/ | ||
182 | static struct resource mv78xx0_ehci0_resources[] = { | ||
183 | { | ||
184 | .start = USB0_PHYS_BASE, | ||
185 | .end = USB0_PHYS_BASE + SZ_4K - 1, | ||
186 | .flags = IORESOURCE_MEM, | ||
187 | }, { | ||
188 | .start = IRQ_MV78XX0_USB_0, | ||
189 | .end = IRQ_MV78XX0_USB_0, | ||
190 | .flags = IORESOURCE_IRQ, | ||
191 | }, | ||
192 | }; | ||
193 | |||
194 | static struct platform_device mv78xx0_ehci0 = { | ||
195 | .name = "orion-ehci", | ||
196 | .id = 0, | ||
197 | .dev = { | ||
198 | .dma_mask = &ehci_dmamask, | ||
199 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
200 | .platform_data = &mv78xx0_ehci_data, | ||
201 | }, | ||
202 | .resource = mv78xx0_ehci0_resources, | ||
203 | .num_resources = ARRAY_SIZE(mv78xx0_ehci0_resources), | ||
204 | }; | ||
205 | |||
206 | void __init mv78xx0_ehci0_init(void) | 170 | void __init mv78xx0_ehci0_init(void) |
207 | { | 171 | { |
208 | platform_device_register(&mv78xx0_ehci0); | 172 | orion_ehci_init(&mv78xx0_mbus_dram_info, |
173 | USB0_PHYS_BASE, IRQ_MV78XX0_USB_0); | ||
209 | } | 174 | } |
210 | 175 | ||
211 | 176 | ||
212 | /***************************************************************************** | 177 | /***************************************************************************** |
213 | * EHCI1 | 178 | * EHCI1 |
214 | ****************************************************************************/ | 179 | ****************************************************************************/ |
215 | static struct resource mv78xx0_ehci1_resources[] = { | ||
216 | { | ||
217 | .start = USB1_PHYS_BASE, | ||
218 | .end = USB1_PHYS_BASE + SZ_4K - 1, | ||
219 | .flags = IORESOURCE_MEM, | ||
220 | }, { | ||
221 | .start = IRQ_MV78XX0_USB_1, | ||
222 | .end = IRQ_MV78XX0_USB_1, | ||
223 | .flags = IORESOURCE_IRQ, | ||
224 | }, | ||
225 | }; | ||
226 | |||
227 | static struct platform_device mv78xx0_ehci1 = { | ||
228 | .name = "orion-ehci", | ||
229 | .id = 1, | ||
230 | .dev = { | ||
231 | .dma_mask = &ehci_dmamask, | ||
232 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
233 | .platform_data = &mv78xx0_ehci_data, | ||
234 | }, | ||
235 | .resource = mv78xx0_ehci1_resources, | ||
236 | .num_resources = ARRAY_SIZE(mv78xx0_ehci1_resources), | ||
237 | }; | ||
238 | |||
239 | void __init mv78xx0_ehci1_init(void) | 180 | void __init mv78xx0_ehci1_init(void) |
240 | { | 181 | { |
241 | platform_device_register(&mv78xx0_ehci1); | 182 | orion_ehci_1_init(&mv78xx0_mbus_dram_info, |
183 | USB1_PHYS_BASE, IRQ_MV78XX0_USB_1); | ||
242 | } | 184 | } |
243 | 185 | ||
244 | 186 | ||
245 | /***************************************************************************** | 187 | /***************************************************************************** |
246 | * EHCI2 | 188 | * EHCI2 |
247 | ****************************************************************************/ | 189 | ****************************************************************************/ |
248 | static struct resource mv78xx0_ehci2_resources[] = { | ||
249 | { | ||
250 | .start = USB2_PHYS_BASE, | ||
251 | .end = USB2_PHYS_BASE + SZ_4K - 1, | ||
252 | .flags = IORESOURCE_MEM, | ||
253 | }, { | ||
254 | .start = IRQ_MV78XX0_USB_2, | ||
255 | .end = IRQ_MV78XX0_USB_2, | ||
256 | .flags = IORESOURCE_IRQ, | ||
257 | }, | ||
258 | }; | ||
259 | |||
260 | static struct platform_device mv78xx0_ehci2 = { | ||
261 | .name = "orion-ehci", | ||
262 | .id = 2, | ||
263 | .dev = { | ||
264 | .dma_mask = &ehci_dmamask, | ||
265 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
266 | .platform_data = &mv78xx0_ehci_data, | ||
267 | }, | ||
268 | .resource = mv78xx0_ehci2_resources, | ||
269 | .num_resources = ARRAY_SIZE(mv78xx0_ehci2_resources), | ||
270 | }; | ||
271 | |||
272 | void __init mv78xx0_ehci2_init(void) | 190 | void __init mv78xx0_ehci2_init(void) |
273 | { | 191 | { |
274 | platform_device_register(&mv78xx0_ehci2); | 192 | orion_ehci_2_init(&mv78xx0_mbus_dram_info, |
193 | USB2_PHYS_BASE, IRQ_MV78XX0_USB_2); | ||
275 | } | 194 | } |
276 | 195 | ||
277 | 196 | ||