diff options
author | Andrew Lunn <andrew@lunn.ch> | 2011-05-15 13:32:41 +0200 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-05-16 14:46:17 -0400 |
commit | 28a2b45054f2e3f3671e36a6e9efc82756afa31a (patch) | |
tree | b33726c3de55636902cc033124eb3dd6ba6fe1d1 /arch/arm/mach-orion5x | |
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-orion5x')
-rw-r--r-- | arch/arm/mach-orion5x/common.c | 81 |
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 @@ #include <plat/orion_nand.h> #include <plat/orion_wdt.h> #include <plat/time.h> +#include <plat/common.h> #include "common.h" /***************************************************************************** @@ -349,91 +350,21 @@ void __init orion5x_spi_init() /***************************************************************************** * UART0 ****************************************************************************/ -static struct plat_serial8250_port orion5x_uart0_data[] = { - { - .mapbase = UART0_PHYS_BASE, - .membase = (char *)UART0_VIRT_BASE, - .irq = IRQ_ORION5X_UART0, - .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = 0, - }, { - }, -}; - -static struct resource orion5x_uart0_resources[] = { - { - .start = UART0_PHYS_BASE, - .end = UART0_PHYS_BASE + 0xff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_ORION5X_UART0, - .end = IRQ_ORION5X_UART0, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device orion5x_uart0 = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev = { - .platform_data = orion5x_uart0_data, - }, - .resource = orion5x_uart0_resources, - .num_resources = ARRAY_SIZE(orion5x_uart0_resources), -}; - void __init orion5x_uart0_init(void) { - platform_device_register(&orion5x_uart0); + orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE, + IRQ_ORION5X_UART0, orion5x_tclk); } - /***************************************************************************** * UART1 ****************************************************************************/ -static struct plat_serial8250_port orion5x_uart1_data[] = { - { - .mapbase = UART1_PHYS_BASE, - .membase = (char *)UART1_VIRT_BASE, - .irq = IRQ_ORION5X_UART1, - .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk = 0, - }, { - }, -}; - -static struct resource orion5x_uart1_resources[] = { - { - .start = UART1_PHYS_BASE, - .end = UART1_PHYS_BASE + 0xff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_ORION5X_UART1, - .end = IRQ_ORION5X_UART1, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device orion5x_uart1 = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM1, - .dev = { - .platform_data = orion5x_uart1_data, - }, - .resource = orion5x_uart1_resources, - .num_resources = ARRAY_SIZE(orion5x_uart1_resources), -}; - void __init orion5x_uart1_init(void) { - platform_device_register(&orion5x_uart1); + orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE, + IRQ_ORION5X_UART1, orion5x_tclk); } - /***************************************************************************** * XOR engine ****************************************************************************/ @@ -687,8 +618,6 @@ void __init orion5x_init(void) orion5x_ge00_shared_data.t_clk = orion5x_tclk; orion5x_spi_plat_data.tclk = orion5x_tclk; - orion5x_uart0_data[0].uartclk = orion5x_tclk; - orion5x_uart1_data[0].uartclk = orion5x_tclk; /* * Setup Orion address map |