aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood
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-kirkwood
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-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/common.c79
1 files changed, 5 insertions, 74 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 4b89eed216e7..8cdf9f9f74b5 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -33,6 +33,7 @@
33#include <plat/mv_xor.h> 33#include <plat/mv_xor.h>
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/common.h>
36#include <plat/time.h> 37#include <plat/time.h>
37#include "common.h" 38#include "common.h"
38 39
@@ -491,91 +492,23 @@ void __init kirkwood_i2c_init(void)
491/***************************************************************************** 492/*****************************************************************************
492 * UART0 493 * UART0
493 ****************************************************************************/ 494 ****************************************************************************/
494static struct plat_serial8250_port kirkwood_uart0_data[] = {
495 {
496 .mapbase = UART0_PHYS_BASE,
497 .membase = (char *)UART0_VIRT_BASE,
498 .irq = IRQ_KIRKWOOD_UART_0,
499 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
500 .iotype = UPIO_MEM,
501 .regshift = 2,
502 .uartclk = 0,
503 }, {
504 },
505};
506
507static struct resource kirkwood_uart0_resources[] = {
508 {
509 .start = UART0_PHYS_BASE,
510 .end = UART0_PHYS_BASE + 0xff,
511 .flags = IORESOURCE_MEM,
512 }, {
513 .start = IRQ_KIRKWOOD_UART_0,
514 .end = IRQ_KIRKWOOD_UART_0,
515 .flags = IORESOURCE_IRQ,
516 },
517};
518
519static struct platform_device kirkwood_uart0 = {
520 .name = "serial8250",
521 .id = PLAT8250_DEV_PLATFORM,
522 .dev = {
523 .platform_data = kirkwood_uart0_data,
524 },
525 .resource = kirkwood_uart0_resources,
526 .num_resources = ARRAY_SIZE(kirkwood_uart0_resources),
527};
528 495
529void __init kirkwood_uart0_init(void) 496void __init kirkwood_uart0_init(void)
530{ 497{
531 platform_device_register(&kirkwood_uart0); 498 orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE,
499 IRQ_KIRKWOOD_UART_0, kirkwood_tclk);
532} 500}
533 501
534 502
535/***************************************************************************** 503/*****************************************************************************
536 * UART1 504 * UART1
537 ****************************************************************************/ 505 ****************************************************************************/
538static struct plat_serial8250_port kirkwood_uart1_data[] = {
539 {
540 .mapbase = UART1_PHYS_BASE,
541 .membase = (char *)UART1_VIRT_BASE,
542 .irq = IRQ_KIRKWOOD_UART_1,
543 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
544 .iotype = UPIO_MEM,
545 .regshift = 2,
546 .uartclk = 0,
547 }, {
548 },
549};
550
551static struct resource kirkwood_uart1_resources[] = {
552 {
553 .start = UART1_PHYS_BASE,
554 .end = UART1_PHYS_BASE + 0xff,
555 .flags = IORESOURCE_MEM,
556 }, {
557 .start = IRQ_KIRKWOOD_UART_1,
558 .end = IRQ_KIRKWOOD_UART_1,
559 .flags = IORESOURCE_IRQ,
560 },
561};
562
563static struct platform_device kirkwood_uart1 = {
564 .name = "serial8250",
565 .id = PLAT8250_DEV_PLATFORM1,
566 .dev = {
567 .platform_data = kirkwood_uart1_data,
568 },
569 .resource = kirkwood_uart1_resources,
570 .num_resources = ARRAY_SIZE(kirkwood_uart1_resources),
571};
572
573void __init kirkwood_uart1_init(void) 506void __init kirkwood_uart1_init(void)
574{ 507{
575 platform_device_register(&kirkwood_uart1); 508 orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE,
509 IRQ_KIRKWOOD_UART_1, kirkwood_tclk);
576} 510}
577 511
578
579/***************************************************************************** 512/*****************************************************************************
580 * Cryptographic Engines and Security Accelerator (CESA) 513 * Cryptographic Engines and Security Accelerator (CESA)
581 ****************************************************************************/ 514 ****************************************************************************/
@@ -987,8 +920,6 @@ void __init kirkwood_init(void)
987 kirkwood_ge00_shared_data.t_clk = kirkwood_tclk; 920 kirkwood_ge00_shared_data.t_clk = kirkwood_tclk;
988 kirkwood_ge01_shared_data.t_clk = kirkwood_tclk; 921 kirkwood_ge01_shared_data.t_clk = kirkwood_tclk;
989 kirkwood_spi_plat_data.tclk = kirkwood_tclk; 922 kirkwood_spi_plat_data.tclk = kirkwood_tclk;
990 kirkwood_uart0_data[0].uartclk = kirkwood_tclk;
991 kirkwood_uart1_data[0].uartclk = kirkwood_tclk;
992 kirkwood_i2s_data.tclk = kirkwood_tclk; 923 kirkwood_i2s_data.tclk = kirkwood_tclk;
993 924
994 /* 925 /*