diff options
author | Jagannadha Sutradharudu Teki <jagannadha.sutradharudu-teki@xilinx.com> | 2013-08-04 01:22:25 +0530 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2013-08-13 08:38:52 +0200 |
commit | a168d3af5d9887019e62c4d4f842c79971079a0b (patch) | |
tree | 8caa0dc2edd4d65c73370710cc9b14ec65db4880 /drivers/serial/arm_dcc.c | |
parent | 32749e91aa31338882c02d3499c1376e7e794b82 (diff) |
serial: arm_dcc: Register with serial core
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>
Diffstat (limited to 'drivers/serial/arm_dcc.c')
-rw-r--r-- | drivers/serial/arm_dcc.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/drivers/serial/arm_dcc.c b/drivers/serial/arm_dcc.c index e76c0382d8..29d929571d 100644 --- a/drivers/serial/arm_dcc.c +++ b/drivers/serial/arm_dcc.c @@ -27,6 +27,7 @@ */ #include <common.h> +#include <serial.h> #if defined(CONFIG_CPU_V6) /* @@ -88,12 +89,12 @@ #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; } |