]> err.no Git - linux-2.6/commitdiff
[PATCH] ARM: 2793/1: platform serial support for ixp2000
authorLennert Buytenhek <buytenh@wantstofly.org>
Sun, 10 Jul 2005 18:44:53 +0000 (19:44 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 10 Jul 2005 18:44:53 +0000 (19:44 +0100)
Patch from Lennert Buytenhek

This patch converts the ixp2000 serial port over to a platform
serial device.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-ixp2000/core.c
arch/arm/mach-ixp2000/enp2611.c
arch/arm/mach-ixp2000/ixdp2x00.c
arch/arm/mach-ixp2000/ixdp2x01.c
include/asm-arm/arch-ixp2000/platform.h

index 4b9d841e04c15395a50488c52b1f1ca86daa9bd7..45b18658499f8e8c984bb105682ef4031fb174b3 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/serial.h>
 #include <linux/tty.h>
 #include <linux/bitops.h>
-#include <linux/serial_core.h>
+#include <linux/serial_8250.h>
 #include <linux/mm.h>
 
 #include <asm/types.h>
@@ -125,19 +125,6 @@ static struct map_desc ixp2000_io_desc[] __initdata = {
        }
 };
 
-static struct uart_port ixp2000_serial_port = {
-       .membase        = (char *)(IXP2000_UART_VIRT_BASE + 3),
-       .mapbase        = IXP2000_UART_PHYS_BASE + 3,
-       .irq            = IRQ_IXP2000_UART,
-       .flags          = UPF_SKIP_TEST,
-       .iotype         = UPIO_MEM,
-       .regshift       = 2,
-       .uartclk        = 50000000,
-       .line           = 0,
-       .type           = PORT_XSCALE,
-       .fifosize       = 16
-};
-
 void __init ixp2000_map_io(void)
 {
        extern unsigned int processor_id;
@@ -157,12 +144,50 @@ void __init ixp2000_map_io(void)
        }
 
        iotable_init(ixp2000_io_desc, ARRAY_SIZE(ixp2000_io_desc));
-       early_serial_setup(&ixp2000_serial_port);
 
        /* Set slowport to 8-bit mode.  */
        ixp2000_reg_write(IXP2000_SLOWPORT_FRM, 1);
 }
 
+
+/*************************************************************************
+ * Serial port support for IXP2000
+ *************************************************************************/
+static struct plat_serial8250_port ixp2000_serial_port[] = {
+       {
+               .mapbase        = IXP2000_UART_PHYS_BASE,
+               .membase        = (char *)(IXP2000_UART_VIRT_BASE + 3),
+               .irq            = IRQ_IXP2000_UART,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+               .iotype         = UPIO_MEM,
+               .regshift       = 2,
+               .uartclk        = 50000000,
+       },
+       { },
+};
+
+static struct resource ixp2000_uart_resource = {
+       .start          = IXP2000_UART_PHYS_BASE,
+       .end            = IXP2000_UART_PHYS_BASE + 0xffff,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device ixp2000_serial_device = {
+       .name           = "serial8250",
+       .id             = 0,
+       .dev            = {
+               .platform_data          = ixp2000_serial_port,
+       },
+       .num_resources  = 1,
+       .resource       = &ixp2000_uart_resource,
+};
+
+void __init ixp2000_uart_init(void)
+{
+       platform_device_register(&ixp2000_serial_device);
+}
+
+
 /*************************************************************************
  * Timer-tick functions for IXP2000
  *************************************************************************/
index b7ebf3898fc545024ff12e548d09da416b92d861..9aa54de447407d615211860f693fe6a6879f2f28 100644 (file)
@@ -219,6 +219,7 @@ static struct platform_device *enp2611_devices[] __initdata = {
 static void __init enp2611_init_machine(void)
 {
        platform_add_devices(enp2611_devices, ARRAY_SIZE(enp2611_devices));
+       ixp2000_uart_init();
 }
 
 
index 5e4380747b53d1bb2b105b35ec71f890ba4440c1..a43369ad876ca57cc27ab0732053ccb5d13417a1 100644 (file)
@@ -303,5 +303,6 @@ void __init ixdp2x00_init_machine(void)
        gpio_line_config(IXDP2X00_GPIO_I2C_ENABLE, GPIO_OUT);
 
        platform_add_devices(ixdp2x00_devices, ARRAY_SIZE(ixdp2x00_devices));
+       ixp2000_uart_init();
 }
 
index c73588743ee12f9f1b7c7ecd1aa74db5a9fa8800..43447dad165759affb4ddcdd22e108c0cdefd187 100644 (file)
@@ -370,6 +370,7 @@ static void __init ixdp2x01_init_machine(void)
                ((*IXDP2X01_CPLD_FLASH_REG & IXDP2X01_CPLD_FLASH_BANK_MASK) + 1);
 
        platform_add_devices(ixdp2x01_devices, ARRAY_SIZE(ixdp2x01_devices));
+       ixp2000_uart_init();
 }
 
 
index 52ded516ea5caed2d85aff56000d2985af06daf8..c0caf3e3e6fd78d32118836e7f82927dc413e33a 100644 (file)
@@ -115,6 +115,7 @@ static inline unsigned int ixp2000_is_pcimaster(void)
 }
 
 void ixp2000_map_io(void);
+void ixp2000_uart_init(void);
 void ixp2000_init_irq(void);
 void ixp2000_init_time(unsigned long);
 unsigned long ixp2000_gettimeoffset(void);