]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: 2818/1: BAST - Use platform device for SuperIO 16550s
authorBen Dooks <ben-linux@fluff.org>
Mon, 18 Jul 2005 09:24:32 +0000 (10:24 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 18 Jul 2005 09:24:32 +0000 (10:24 +0100)
Patch from Ben Dooks

Use platform device for the 16500 UARTs in the onboard
SuperIO controller.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/configs/bast_defconfig
arch/arm/configs/s3c2410_defconfig
arch/arm/mach-s3c2410/mach-bast.c
drivers/serial/Kconfig
drivers/serial/Makefile
drivers/serial/bast_sio.c [deleted file]

index 2d985e9611cdccec21e616d6d44b19d56b4b8f23..35e3a99bcbb688e0ab9a6c096c9421db4021ef8d 100644 (file)
@@ -561,7 +561,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 #
 CONFIG_SERIAL_S3C2410=y
 CONFIG_SERIAL_S3C2410_CONSOLE=y
-CONFIG_SERIAL_BAST_SIO=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 98b72ff388322dc2fc6766bdf6ba031eac3bd633..96a794d8de842d2476a6776ce0bc46c0afd5369e 100644 (file)
@@ -570,7 +570,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 #
 CONFIG_SERIAL_S3C2410=y
 CONFIG_SERIAL_S3C2410_CONSOLE=y
-CONFIG_SERIAL_BAST_SIO=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index ccb6bcefa46c5e265815d24f7f2afa00dfcff7c1..206778ebfce79de3e40608419a2f56df8d9a7cc9 100644 (file)
@@ -28,6 +28,7 @@
  *     14-Mar-2006 BJD  Updated for __iomem changes
  *     22-Jun-2006 BJD  Added DM9000 platform information
  *     28-Jun-2006 BJD  Moved pm functionality out to common code
+ *     17-Jul-2006 BJD  Changed to platform device for SuperIO 16550s
 */
 
 #include <linux/kernel.h>
@@ -64,6 +65,8 @@
 #include <linux/mtd/nand_ecc.h>
 #include <linux/mtd/partitions.h>
 
+#include <linux/serial_8250.h>
+
 #include "clock.h"
 #include "devs.h"
 #include "cpu.h"
@@ -351,6 +354,39 @@ static struct platform_device bast_device_dm9k = {
        }
 };
 
+/* serial devices */
+
+#define SERIAL_BASE  (S3C2410_CS2 + BAST_PA_SUPERIO)
+#define SERIAL_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SHARE_IRQ)
+#define SERIAL_CLK   (1843200)
+
+static struct plat_serial8250_port bast_sio_data[] = {
+       [0] = {
+               .mapbase        = SERIAL_BASE + 0x2f8,
+               .irq            = IRQ_PCSERIAL1,
+               .flags          = SERIAL_FLAGS,
+               .iotype         = UPIO_MEM,
+               .regshift       = 0,
+               .uartclk        = SERIAL_CLK,
+       },
+       [1] = {
+               .mapbase        = SERIAL_BASE + 0x3f8,
+               .irq            = IRQ_PCSERIAL2,
+               .flags          = SERIAL_FLAGS,
+               .iotype         = UPIO_MEM,
+               .regshift       = 0,
+               .uartclk        = SERIAL_CLK,
+       },
+       { }
+};
+
+static struct platform_device bast_sio = {
+       .name                   = "serial8250",
+       .id                     = 0,
+       .dev                    = {
+               .platform_data  = &bast_sio_data,
+       },
+};
 
 /* Standard BAST devices */
 
@@ -364,6 +400,7 @@ static struct platform_device *bast_devices[] __initdata = {
        &s3c_device_nand,
        &bast_device_nor,
        &bast_device_dm9k,
+       &bast_sio,
 };
 
 static struct clk *bast_clocks[] = {
index e0d0a470ddfcc765c0f750da4adccca5850ade7a..97034d3937fd11a1e6d80be2558b7b3f51ef9743 100644 (file)
@@ -306,13 +306,6 @@ config SERIAL_S3C2410_CONSOLE
          your boot loader about how to pass options to the kernel at
          boot time.)
 
-config SERIAL_BAST_SIO
-       bool "Support for BAST SuperIO serial ports"
-       depends on ARCH_BAST && SERIAL_8250=y
-       help
-         Support for registerin the SuperIO chip on BAST board with
-         the 8250/16550 uart code.
-
 config SERIAL_DZ
        bool "DECstation DZ serial driver"
        depends on MACH_DECSTATION && MIPS32
index 65bd4381685e312134befbf87ff214b49b98a9d8..11c7dc483f930bf6a66aacb36fc900af83213000 100644 (file)
@@ -44,7 +44,6 @@ obj-$(CONFIG_SERIAL_LH7A40X) += serial_lh7a40x.o
 obj-$(CONFIG_SERIAL_AU1X00) += au1x00_uart.o
 obj-$(CONFIG_SERIAL_DZ) += dz.o
 obj-$(CONFIG_SERIAL_SH_SCI) += sh-sci.o
-obj-$(CONFIG_SERIAL_BAST_SIO) += bast_sio.o
 obj-$(CONFIG_SERIAL_SGI_L1_CONSOLE) += sn_console.o
 obj-$(CONFIG_SERIAL_CPM) += cpm_uart/
 obj-$(CONFIG_SERIAL_IMX) += imx.o
diff --git a/drivers/serial/bast_sio.c b/drivers/serial/bast_sio.c
deleted file mode 100644 (file)
index 2b48fab..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* linux/drivers/serial/bast_sio.c
- *
- * Copyright (c) 2004 Simtec Electronics
- *   Ben Dooks <ben@simtec.co.uk>
- *
- * http://www.simtec.co.uk/products/EB2410ITX/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Modifications:
- *     23-Sep-2004  BJD  Added copyright header
- *     23-Sep-2004  BJD  Added serial port remove code
-*/
-
-#include <linux/module.h>
-#include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/tty.h>
-#include <linux/serial.h>
-#include <linux/serial_core.h>
-#include <linux/types.h>
-
-#include <asm/io.h>
-#include <asm/serial.h>
-#include <asm/mach-types.h>
-
-#include <asm/arch/map.h>
-#include <asm/arch/irqs.h>
-#include <asm/arch/bast-map.h>
-#include <asm/arch/bast-irq.h>
-
-static int __init serial_bast_register(unsigned long port, unsigned int irq)
-{
-       struct serial_struct serial_req;
-
-       serial_req.flags      = UPF_AUTOPROBE | UPF_SHARE_IRQ;
-       serial_req.baud_base  = BASE_BAUD;
-       serial_req.irq        = irq;
-       serial_req.io_type    = UPIO_MEM;
-       serial_req.iomap_base = port;
-       serial_req.iomem_base = ioremap(port, 0x10);
-       serial_req.iomem_reg_shift = 0;
-
-       return register_serial(&serial_req);
-}
-
-#define SERIAL_BASE (S3C2410_CS2 + BAST_PA_SUPERIO)
-
-static int port[2] = { -1, -1 };
-
-static int __init serial_bast_init(void)
-{
-       if (machine_is_bast()) {
-               port[0] = serial_bast_register(SERIAL_BASE + 0x2f8, IRQ_PCSERIAL1);
-               port[1] = serial_bast_register(SERIAL_BASE + 0x3f8, IRQ_PCSERIAL2);
-       }
-
-       return 0;
-}
-
-static void __exit serial_bast_exit(void)
-{
-       if (port[0] != -1)
-               unregister_serial(port[0]);
-       if (port[1] != -1)
-               unregister_serial(port[1]);
-}
-
-
-module_init(serial_bast_init);
-module_exit(serial_bast_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Ben Dooks, ben@simtec.co.uk");
-MODULE_DESCRIPTION("BAST Onboard Serial setup");
-
-