]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: arm_dcc: Register with serial core
authorJagannadha Sutradharudu Teki <jagannadha.sutradharudu-teki@xilinx.com>
Sat, 3 Aug 2013 19:52:25 +0000 (01:22 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 13 Aug 2013 06:38:52 +0000 (08:38 +0200)
Register arm_dcc with drivers/serial/serial.c

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/serial/arm_dcc.c
drivers/serial/serial.c

index e76c0382d8d39e8db43d602c203b59a2dbfe931a..29d929571df653199d61182b7f93ab9fb42b4524 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include <common.h>
+#include <serial.h>
 
 #if defined(CONFIG_CPU_V6)
 /*
 
 #define TIMEOUT_COUNT 0x4000000
 
-int arm_dcc_init(void)
+static int arm_dcc_init(void)
 {
        return 0;
 }
 
-int arm_dcc_getc(void)
+static int arm_dcc_getc(void)
 {
        int ch;
        register unsigned int reg;
@@ -106,7 +107,7 @@ int arm_dcc_getc(void)
        return ch;
 }
 
-void arm_dcc_putc(char ch)
+static void arm_dcc_putc(char ch)
 {
        register unsigned int reg;
        unsigned int timeout_count = TIMEOUT_COUNT;
@@ -122,13 +123,13 @@ void arm_dcc_putc(char ch)
                write_dcc(ch);
 }
 
-void arm_dcc_puts(const char *s)
+static void arm_dcc_puts(const char *s)
 {
        while (*s)
                arm_dcc_putc(*s++);
 }
 
-int arm_dcc_tstc(void)
+static int arm_dcc_tstc(void)
 {
        register unsigned int reg;
 
@@ -137,7 +138,27 @@ int arm_dcc_tstc(void)
        return reg;
 }
 
+static void arm_dcc_setbrg(void)
+{
+}
+
+static struct serial_device arm_dcc_drv = {
+       .name   = "arm_dcc",
+       .start  = arm_dcc_init,
+       .stop   = NULL,
+       .setbrg = arm_dcc_setbrg,
+       .putc   = arm_dcc_putc,
+       .puts   = arm_dcc_puts,
+       .getc   = arm_dcc_getc,
+       .tstc   = arm_dcc_tstc,
+};
+
+void arm_dcc_initialize(void)
+{
+       serial_register(&arm_dcc_drv);
+}
+
 __weak struct serial_device *default_serial_console(void)
 {
-       return NULL;
+       return &arm_dcc_drv;
 }
index 67301355d7dcba85d1a7c2608c1d1814c4e6e687..118fbc305ca721ae980f8a6cf22d078d35c9df1c 100644 (file)
@@ -159,6 +159,7 @@ serial_initfunc(pl01x_serial_initialize);
 serial_initfunc(s3c44b0_serial_initialize);
 serial_initfunc(sa1100_serial_initialize);
 serial_initfunc(sh_serial_initialize);
+serial_initfunc(arm_dcc_initialize);
 
 /**
  * serial_register() - Register serial driver with serial driver core
@@ -251,6 +252,7 @@ void serial_initialize(void)
        s3c44b0_serial_initialize();
        sa1100_serial_initialize();
        sh_serial_initialize();
+       arm_dcc_initialize();
 
        serial_assign(default_serial_console()->name);
 }