aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2011-05-15 07:32:41 -0400
committerNicolas Pitre <nico@fluxnic.net>2011-05-16 14:46:17 -0400
commit28a2b45054f2e3f3671e36a6e9efc82756afa31a (patch)
treeb33726c3de55636902cc033124eb3dd6ba6fe1d1 /arch/arm/mach-orion5x
parent5c60255149eece2a36ec9f5c99817b85f96fe8ec (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-orion5x')
-rw-r--r--arch/arm/mach-orion5x/common.c81
1 files changed, 5 insertions, 76 deletions
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index d281b1984e4a..310de50e1bb9 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -34,6 +34,7 @@
34#include <plat/orion_nand.h> 34#include <plat/orion_nand.h>
35#include <plat/orion_wdt.h> 35#include <plat/orion_wdt.h>
36#include <plat/time.h> 36#include <plat/time.h>
37#include <plat/common.h>
37#include "common.h" 38#include "common.h"
38 39
39/***************************************************************************** 40/*****************************************************************************
@@ -349,91 +350,21 @@ void __init orion5x_spi_init()
349/***************************************************************************** 350/*****************************************************************************
350 * UART0 351 * UART0
351 ****************************************************************************/ 352 ****************************************************************************/
352static struct plat_serial8250_port orion5x_uart0_data[] = {
353 {
354 .mapbase = UART0_PHYS_BASE,
355 .membase = (char *)UART0_VIRT_BASE,
356 .irq = IRQ_ORION5X_UART0,
357 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
358 .iotype = UPIO_MEM,
359 .regshift = 2,
360 .uartclk = 0,
361 }, {
362 },
363};
364
365static struct resource orion5x_uart0_resources[] = {
366 {
367 .start = UART0_PHYS_BASE,
368 .end = UART0_PHYS_BASE + 0xff,
369 .flags = IORESOURCE_MEM,
370 }, {
371 .start = IRQ_ORION5X_UART0,
372 .end = IRQ_ORION5X_UART0,
373 .flags = IORESOURCE_IRQ,
374 },
375};
376
377static struct platform_device orion5x_uart0 = {
378 .name = "serial8250",
379 .id = PLAT8250_DEV_PLATFORM,
380 .dev = {
381 .platform_data = orion5x_uart0_data,
382 },
383 .resource = orion5x_uart0_resources,
384 .num_resources = ARRAY_SIZE(orion5x_uart0_resources),
385};
386
387void __init orion5x_uart0_init(void) 353void __init orion5x_uart0_init(void)
388{ 354{
389 platform_device_register(&orion5x_uart0); 355 orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE,
356 IRQ_ORION5X_UART0, orion5x_tclk);
390} 357}
391 358
392
393/***************************************************************************** 359/*****************************************************************************
394 * UART1 360 * UART1
395 ****************************************************************************/ 361 ****************************************************************************/
396static struct plat_serial8250_port orion5x_uart1_data[] = {
397 {
398 .mapbase = UART1_PHYS_BASE,
399 .membase = (char *)UART1_VIRT_BASE,
400 .irq = IRQ_ORION5X_UART1,
401 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
402 .iotype = UPIO_MEM,
403 .regshift = 2,
404 .uartclk = 0,
405 }, {
406 },
407};
408
409static struct resource orion5x_uart1_resources[] = {
410 {
411 .start = UART1_PHYS_BASE,
412 .end = UART1_PHYS_BASE + 0xff,
413 .flags = IORESOURCE_MEM,
414 }, {
415 .start = IRQ_ORION5X_UART1,
416 .end = IRQ_ORION5X_UART1,
417 .flags = IORESOURCE_IRQ,
418 },
419};
420
421static struct platform_device orion5x_uart1 = {
422 .name = "serial8250",
423 .id = PLAT8250_DEV_PLATFORM1,
424 .dev = {
425 .platform_data = orion5x_uart1_data,
426 },
427 .resource = orion5x_uart1_resources,
428 .num_resources = ARRAY_SIZE(orion5x_uart1_resources),
429};
430
431void __init orion5x_uart1_init(void) 362void __init orion5x_uart1_init(void)
432{ 363{
433 platform_device_register(&orion5x_uart1); 364 orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE,
365 IRQ_ORION5X_UART1, orion5x_tclk);
434} 366}
435 367
436
437/***************************************************************************** 368/*****************************************************************************
438 * XOR engine 369 * XOR engine
439 ****************************************************************************/ 370 ****************************************************************************/
@@ -687,8 +618,6 @@ void __init orion5x_init(void)
687 618
688 orion5x_ge00_shared_data.t_clk = orion5x_tclk; 619 orion5x_ge00_shared_data.t_clk = orion5x_tclk;
689 orion5x_spi_plat_data.tclk = orion5x_tclk; 620 orion5x_spi_plat_data.tclk = orion5x_tclk;
690 orion5x_uart0_data[0].uartclk = orion5x_tclk;
691 orion5x_uart1_data[0].uartclk = orion5x_tclk;
692 621
693 /* 622 /*
694 * Setup Orion address map 623 * Setup Orion address map