]> git.neil.brown.name Git - history.git/commitdiff
[ARM PATCH] 2235/1: S3C2410 - new serial driver - core updates (2/4)
authorBen Dooks <ben-linux@org.rmk.(none)>
Sun, 14 Nov 2004 23:53:41 +0000 (23:53 +0000)
committerRussell King <rmk@flint.arm.linux.org.uk>
Sun, 14 Nov 2004 23:53:41 +0000 (23:53 +0000)
Patch from Ben Dooks

Update the arch/arm/mach-s3c2410 core files for the
new serial port bits, and fix the bugs with s3c2440
handling.

Signed-off-by: Ben Dooks
Signed-off-by: Russell King
arch/arm/mach-s3c2410/devs.c
arch/arm/mach-s3c2410/s3c2410.c
arch/arm/mach-s3c2410/s3c2440.c
arch/arm/mach-s3c2410/s3c2440.h

index 7cf560caeec181c71a6615456143948295191670..b1826df99159bbf8d560c909e7684eefeef8dc96 100644 (file)
 #include <asm/io.h>
 #include <asm/irq.h>
 
+#include <asm/arch/regs-serial.h>
+
 #include "devs.h"
 
+/* Serial port registrations */
+
+struct platform_device *s3c24xx_uart_devs[3];
+
 /* USB Host Controller */
 
 static struct resource s3c_usb_resource[] = {
index bf83a77ebfc5aa69531e7bcc09824a555d158e25..66a34913c0a9e36765c8e7e5134784d2f51aecf5 100644 (file)
@@ -1,7 +1,7 @@
 /* linux/arch/arm/mach-s3c2410/s3c2410.c
  *
  * Copyright (c) 2003,2004 Simtec Electronics
- * Ben Dooks <ben@simtec.co.uk>
+ *     Ben Dooks <ben@simtec.co.uk>
  *
  * http://www.simtec.co.uk/products/EB2410ITX/
  *
@@ -16,6 +16,7 @@
  *     18-Jan-2004 BJD  Added serial port configuration
  *     21-Aug-2004 BJD  Added new struct s3c2410_board handler
  *     28-Sep-2004 BJD  Updates for new serial port bits
+ *     04-Nov-2004 BJD  Updated UART configuration process
 */
 
 #include <linux/kernel.h>
 
 int s3c2410_clock_tick_rate = 12*1000*1000;  /* current timers at 12MHz */
 
-/* serial port setup */
-
-struct s3c2410_uartcfg *s3c2410_uartcfgs;
-
 /* Initial IO mappings */
 
 static struct map_desc s3c2410_iodesc[] __initdata = {
@@ -141,12 +138,10 @@ void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
        struct platform_device *platdev;
        int uart;
 
-       s3c2410_uartcfgs = cfg;         /* compatibility */
-
        for (uart = 0; uart < no; uart++, cfg++) {
                platdev = uart_devices[cfg->hwport];
 
-               s3c2410_uart_devices[uart] = platdev;
+               s3c24xx_uart_devs[uart] = platdev;
                platdev->dev.platform_data = cfg;
        }
 
@@ -199,10 +194,7 @@ void __init s3c2410_map_io(struct map_desc *mach_desc, int mach_size)
 
 int __init s3c2410_init(void)
 {
-       int ret;
-
        printk("S3C2410: Initialising architecture\n");
 
-       ret = platform_add_devices(uart_devices, ARRAY_SIZE(uart_devices));
-       return ret;
+       return platform_add_devices(s3c24xx_uart_devs, s3c2410_uart_count);
 }
index e257d90e3afb9191bff17c899df07c30a7e7e10b..9a179a9cfd95fc56960c44a37135e7ecb51dda30 100644 (file)
@@ -14,6 +14,7 @@
  *     12-Oct-2004 BJD  Moved clock info out to clock.c
  *     01-Nov-2004 BJD  Fixed clock build code
  *     09-Nov-2004 BJD  Added sysdev for power management
+ *     04-Nov-2004 BJD  New serial registration
 */
 
 #include <linux/kernel.h>
@@ -129,6 +130,25 @@ static struct platform_device *uart_devices[] __initdata = {
        &s3c_uart2
 };
 
+/* uart initialisation */
+
+static int __initdata s3c2440_uart_count;
+
+void __init s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
+{
+       struct platform_device *platdev;
+       int uart;
+
+       for (uart = 0; uart < no; uart++, cfg++) {
+               platdev = uart_devices[cfg->hwport];
+
+               s3c24xx_uart_devs[uart] = platdev;
+               platdev->dev.platform_data = cfg;
+       }
+
+       s3c2440_uart_count = uart;
+}
+
 /* s3c2440 specific clock sources */
 
 static struct clk s3c2440_clk_cam = {
@@ -259,9 +279,8 @@ int __init s3c2440_init(void)
        if (ret != 0)
                printk(KERN_ERR "failed to register sysdev for s3c2440\n");
 
-       if (ret != 0)
-               ret = platform_add_devices(uart_devices,
-                                          ARRAY_SIZE(uart_devices));
+       if (ret == 0)
+               ret = platform_add_devices(s3c24xx_uart_devs, s3c2440_uart_count);
 
        return ret;
 }
index bf49a66d583ec6a21d63b463c8d32ddfdaff45fb..f2c9234c14f7e1fb912873d698fa5c3ef34a69f1 100644 (file)
  * published by the Free Software Foundation.
  *
  * Modifications:
- *     24-Aug-2004 BJD  Start of S3C2440 CPU support
+ *     24-Aug-2004 BJD  Start of S3C2440 CPU support
+ *     04-Nov-2004 BJD  Added s3c2440_init_uarts()
 */
 
+struct s3c2410_uartcfg;
+
 extern void s3c2440_init_irq(void);
 
 extern void s3c2440_init_time(void);
+
+extern void s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no);