diff options
author | Andrew Lunn <andrew@lunn.ch> | 2011-05-15 07:32:41 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-05-16 14:46:17 -0400 |
commit | 28a2b45054f2e3f3671e36a6e9efc82756afa31a (patch) | |
tree | b33726c3de55636902cc033124eb3dd6ba6fe1d1 /arch/arm/mach-dove | |
parent | 5c60255149eece2a36ec9f5c99817b85f96fe8ec (diff) |
ARM: orion: Consolidate the creation of the uart platform data.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-dove')
-rw-r--r-- | arch/arm/mach-dove/common.c | 159 |
1 files changed, 11 insertions, 148 deletions
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 30c951879787..fffa92e92d6c 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
@@ -36,8 +36,11 @@ | |||
36 | #include <plat/mv_xor.h> | 36 | #include <plat/mv_xor.h> |
37 | #include <plat/ehci-orion.h> | 37 | #include <plat/ehci-orion.h> |
38 | #include <plat/time.h> | 38 | #include <plat/time.h> |
39 | #include <plat/common.h> | ||
39 | #include "common.h" | 40 | #include "common.h" |
40 | 41 | ||
42 | static int get_tclk(void); | ||
43 | |||
41 | /***************************************************************************** | 44 | /***************************************************************************** |
42 | * I/O Address Mapping | 45 | * I/O Address Mapping |
43 | ****************************************************************************/ | 46 | ****************************************************************************/ |
@@ -255,173 +258,37 @@ void __init dove_sata_init(struct mv_sata_platform_data *sata_data) | |||
255 | /***************************************************************************** | 258 | /***************************************************************************** |
256 | * UART0 | 259 | * UART0 |
257 | ****************************************************************************/ | 260 | ****************************************************************************/ |
258 | static struct plat_serial8250_port dove_uart0_data[] = { | ||
259 | { | ||
260 | .mapbase = DOVE_UART0_PHYS_BASE, | ||
261 | .membase = (char *)DOVE_UART0_VIRT_BASE, | ||
262 | .irq = IRQ_DOVE_UART_0, | ||
263 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
264 | .iotype = UPIO_MEM, | ||
265 | .regshift = 2, | ||
266 | .uartclk = 0, | ||
267 | }, { | ||
268 | }, | ||
269 | }; | ||
270 | |||
271 | static struct resource dove_uart0_resources[] = { | ||
272 | { | ||
273 | .start = DOVE_UART0_PHYS_BASE, | ||
274 | .end = DOVE_UART0_PHYS_BASE + SZ_256 - 1, | ||
275 | .flags = IORESOURCE_MEM, | ||
276 | }, { | ||
277 | .start = IRQ_DOVE_UART_0, | ||
278 | .end = IRQ_DOVE_UART_0, | ||
279 | .flags = IORESOURCE_IRQ, | ||
280 | }, | ||
281 | }; | ||
282 | |||
283 | static struct platform_device dove_uart0 = { | ||
284 | .name = "serial8250", | ||
285 | .id = PLAT8250_DEV_PLATFORM, | ||
286 | .dev = { | ||
287 | .platform_data = dove_uart0_data, | ||
288 | }, | ||
289 | .resource = dove_uart0_resources, | ||
290 | .num_resources = ARRAY_SIZE(dove_uart0_resources), | ||
291 | }; | ||
292 | |||
293 | void __init dove_uart0_init(void) | 261 | void __init dove_uart0_init(void) |
294 | { | 262 | { |
295 | platform_device_register(&dove_uart0); | 263 | orion_uart0_init(DOVE_UART0_VIRT_BASE, DOVE_UART0_PHYS_BASE, |
264 | IRQ_DOVE_UART_0, get_tclk()); | ||
296 | } | 265 | } |
297 | 266 | ||
298 | /***************************************************************************** | 267 | /***************************************************************************** |
299 | * UART1 | 268 | * UART1 |
300 | ****************************************************************************/ | 269 | ****************************************************************************/ |
301 | static struct plat_serial8250_port dove_uart1_data[] = { | ||
302 | { | ||
303 | .mapbase = DOVE_UART1_PHYS_BASE, | ||
304 | .membase = (char *)DOVE_UART1_VIRT_BASE, | ||
305 | .irq = IRQ_DOVE_UART_1, | ||
306 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
307 | .iotype = UPIO_MEM, | ||
308 | .regshift = 2, | ||
309 | .uartclk = 0, | ||
310 | }, { | ||
311 | }, | ||
312 | }; | ||
313 | |||
314 | static struct resource dove_uart1_resources[] = { | ||
315 | { | ||
316 | .start = DOVE_UART1_PHYS_BASE, | ||
317 | .end = DOVE_UART1_PHYS_BASE + SZ_256 - 1, | ||
318 | .flags = IORESOURCE_MEM, | ||
319 | }, { | ||
320 | .start = IRQ_DOVE_UART_1, | ||
321 | .end = IRQ_DOVE_UART_1, | ||
322 | .flags = IORESOURCE_IRQ, | ||
323 | }, | ||
324 | }; | ||
325 | |||
326 | static struct platform_device dove_uart1 = { | ||
327 | .name = "serial8250", | ||
328 | .id = PLAT8250_DEV_PLATFORM1, | ||
329 | .dev = { | ||
330 | .platform_data = dove_uart1_data, | ||
331 | }, | ||
332 | .resource = dove_uart1_resources, | ||
333 | .num_resources = ARRAY_SIZE(dove_uart1_resources), | ||
334 | }; | ||
335 | |||
336 | void __init dove_uart1_init(void) | 270 | void __init dove_uart1_init(void) |
337 | { | 271 | { |
338 | platform_device_register(&dove_uart1); | 272 | orion_uart1_init(DOVE_UART1_VIRT_BASE, DOVE_UART1_PHYS_BASE, |
273 | IRQ_DOVE_UART_1, get_tclk()); | ||
339 | } | 274 | } |
340 | 275 | ||
341 | /***************************************************************************** | 276 | /***************************************************************************** |
342 | * UART2 | 277 | * UART2 |
343 | ****************************************************************************/ | 278 | ****************************************************************************/ |
344 | static struct plat_serial8250_port dove_uart2_data[] = { | ||
345 | { | ||
346 | .mapbase = DOVE_UART2_PHYS_BASE, | ||
347 | .membase = (char *)DOVE_UART2_VIRT_BASE, | ||
348 | .irq = IRQ_DOVE_UART_2, | ||
349 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
350 | .iotype = UPIO_MEM, | ||
351 | .regshift = 2, | ||
352 | .uartclk = 0, | ||
353 | }, { | ||
354 | }, | ||
355 | }; | ||
356 | |||
357 | static struct resource dove_uart2_resources[] = { | ||
358 | { | ||
359 | .start = DOVE_UART2_PHYS_BASE, | ||
360 | .end = DOVE_UART2_PHYS_BASE + SZ_256 - 1, | ||
361 | .flags = IORESOURCE_MEM, | ||
362 | }, { | ||
363 | .start = IRQ_DOVE_UART_2, | ||
364 | .end = IRQ_DOVE_UART_2, | ||
365 | .flags = IORESOURCE_IRQ, | ||
366 | }, | ||
367 | }; | ||
368 | |||
369 | static struct platform_device dove_uart2 = { | ||
370 | .name = "serial8250", | ||
371 | .id = PLAT8250_DEV_PLATFORM2, | ||
372 | .dev = { | ||
373 | .platform_data = dove_uart2_data, | ||
374 | }, | ||
375 | .resource = dove_uart2_resources, | ||
376 | .num_resources = ARRAY_SIZE(dove_uart2_resources), | ||
377 | }; | ||
378 | |||
379 | void __init dove_uart2_init(void) | 279 | void __init dove_uart2_init(void) |
380 | { | 280 | { |
381 | platform_device_register(&dove_uart2); | 281 | orion_uart2_init(DOVE_UART2_VIRT_BASE, DOVE_UART2_PHYS_BASE, |
282 | IRQ_DOVE_UART_2, get_tclk()); | ||
382 | } | 283 | } |
383 | 284 | ||
384 | /***************************************************************************** | 285 | /***************************************************************************** |
385 | * UART3 | 286 | * UART3 |
386 | ****************************************************************************/ | 287 | ****************************************************************************/ |
387 | static struct plat_serial8250_port dove_uart3_data[] = { | ||
388 | { | ||
389 | .mapbase = DOVE_UART3_PHYS_BASE, | ||
390 | .membase = (char *)DOVE_UART3_VIRT_BASE, | ||
391 | .irq = IRQ_DOVE_UART_3, | ||
392 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
393 | .iotype = UPIO_MEM, | ||
394 | .regshift = 2, | ||
395 | .uartclk = 0, | ||
396 | }, { | ||
397 | }, | ||
398 | }; | ||
399 | |||
400 | static struct resource dove_uart3_resources[] = { | ||
401 | { | ||
402 | .start = DOVE_UART3_PHYS_BASE, | ||
403 | .end = DOVE_UART3_PHYS_BASE + SZ_256 - 1, | ||
404 | .flags = IORESOURCE_MEM, | ||
405 | }, { | ||
406 | .start = IRQ_DOVE_UART_3, | ||
407 | .end = IRQ_DOVE_UART_3, | ||
408 | .flags = IORESOURCE_IRQ, | ||
409 | }, | ||
410 | }; | ||
411 | |||
412 | static struct platform_device dove_uart3 = { | ||
413 | .name = "serial8250", | ||
414 | .id = 3, | ||
415 | .dev = { | ||
416 | .platform_data = dove_uart3_data, | ||
417 | }, | ||
418 | .resource = dove_uart3_resources, | ||
419 | .num_resources = ARRAY_SIZE(dove_uart3_resources), | ||
420 | }; | ||
421 | |||
422 | void __init dove_uart3_init(void) | 288 | void __init dove_uart3_init(void) |
423 | { | 289 | { |
424 | platform_device_register(&dove_uart3); | 290 | orion_uart3_init(DOVE_UART3_VIRT_BASE, DOVE_UART3_PHYS_BASE, |
291 | IRQ_DOVE_UART_3, get_tclk()); | ||
425 | } | 292 | } |
426 | 293 | ||
427 | /***************************************************************************** | 294 | /***************************************************************************** |
@@ -835,10 +702,6 @@ void __init dove_init(void) | |||
835 | dove_setup_cpu_mbus(); | 702 | dove_setup_cpu_mbus(); |
836 | 703 | ||
837 | dove_ge00_shared_data.t_clk = tclk; | 704 | dove_ge00_shared_data.t_clk = tclk; |
838 | dove_uart0_data[0].uartclk = tclk; | ||
839 | dove_uart1_data[0].uartclk = tclk; | ||
840 | dove_uart2_data[0].uartclk = tclk; | ||
841 | dove_uart3_data[0].uartclk = tclk; | ||
842 | dove_spi0_data.tclk = tclk; | 705 | dove_spi0_data.tclk = tclk; |
843 | dove_spi1_data.tclk = tclk; | 706 | dove_spi1_data.tclk = tclk; |
844 | 707 | ||