summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2013-08-13 16:49:44 -0400
committerTom Rini <trini@ti.com>2013-08-13 16:49:44 -0400
commitdf785a7ffb7197330ec9b281cd149cbf6cec2d37 (patch)
tree8cc8414726bba7466a38ca375831328bc59ad53c
parentb98d934128bcd98106e764d2f492ac79c38ae53d (diff)
parenta168d3af5d9887019e62c4d4f842c79971079a0b (diff)
downloadu-boot-imx-df785a7ffb7197330ec9b281cd149cbf6cec2d37.zip
u-boot-imx-df785a7ffb7197330ec9b281cd149cbf6cec2d37.tar.gz
u-boot-imx-df785a7ffb7197330ec9b281cd149cbf6cec2d37.tar.bz2
Merge branch 'dcc' of git://www.denx.de/git/u-boot-microblaze
-rw-r--r--common/stdio.c3
-rw-r--r--drivers/serial/arm_dcc.c41
-rw-r--r--drivers/serial/serial.c2
-rw-r--r--include/stdio_dev.h3
4 files changed, 25 insertions, 24 deletions
diff --git a/common/stdio.c b/common/stdio.c
index 721e9a1..844f98c 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -196,9 +196,6 @@ int stdio_init (void)
/* Initialize the list */
INIT_LIST_HEAD(&(devs.list));
-#ifdef CONFIG_ARM_DCC
- drv_arm_dcc_init ();
-#endif
#ifdef CONFIG_SYS_I2C
i2c_init_all();
#else
diff --git a/drivers/serial/arm_dcc.c b/drivers/serial/arm_dcc.c
index c217c88..29d9295 100644
--- a/drivers/serial/arm_dcc.c
+++ b/drivers/serial/arm_dcc.c
@@ -27,7 +27,7 @@
*/
#include <common.h>
-#include <stdio_dev.h>
+#include <serial.h>
#if defined(CONFIG_CPU_V6)
/*
@@ -89,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;
@@ -107,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;
@@ -123,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;
@@ -138,22 +138,27 @@ int arm_dcc_tstc(void)
return reg;
}
-static struct stdio_dev arm_dcc_dev;
+static void arm_dcc_setbrg(void)
+{
+}
-int drv_arm_dcc_init(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)
{
- strcpy(arm_dcc_dev.name, "dcc");
- arm_dcc_dev.ext = 0; /* No extensions */
- arm_dcc_dev.flags = DEV_FLAGS_INPUT | DEV_FLAGS_OUTPUT;
- arm_dcc_dev.tstc = arm_dcc_tstc; /* 'tstc' function */
- arm_dcc_dev.getc = arm_dcc_getc; /* 'getc' function */
- arm_dcc_dev.putc = arm_dcc_putc; /* 'putc' function */
- arm_dcc_dev.puts = arm_dcc_puts; /* 'puts' function */
-
- return stdio_register(&arm_dcc_dev);
+ serial_register(&arm_dcc_drv);
}
__weak struct serial_device *default_serial_console(void)
{
- return NULL;
+ return &arm_dcc_drv;
}
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index 6730135..118fbc3 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -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);
}
diff --git a/include/stdio_dev.h b/include/stdio_dev.h
index d0b5593..e6dc12a 100644
--- a/include/stdio_dev.h
+++ b/include/stdio_dev.h
@@ -83,9 +83,6 @@ struct list_head* stdio_get_list(void);
struct stdio_dev* stdio_get_by_name(const char* name);
struct stdio_dev* stdio_clone(struct stdio_dev *dev);
-#ifdef CONFIG_ARM_DCC
-int drv_arm_dcc_init(void);
-#endif
#ifdef CONFIG_LCD
int drv_lcd_init (void);
#endif