aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2012-02-01 22:09:21 -0700
committerJohn Rigby <john.rigby@linaro.org>2012-05-02 19:44:09 -0600
commitefce660441fa8884c0e35488c8cfb0b46aafd736 (patch)
tree0f61ca6183ad38cf564c11278343f8a6e162bd9b
parent6e40d3e612b633dc74e4b7f00366a48bf1d8e0a1 (diff)
downloadu-boot-linaro-stable-efce660441fa8884c0e35488c8cfb0b46aafd736.tar.gz
SAUCE: Snowball: init serial later
The early init does not take for some reason or is not called at all? This works around the problem while search for what is really going on. Signed-off-by: John Rigby <john.rigby@linaro.org>
-rw-r--r--drivers/serial/serial_pl01x.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index ed581ae22..f7bc43f2b 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -104,6 +104,8 @@ int serial_init (void)
#ifdef CONFIG_PL011_SERIAL
+int serial_init_called;
+
int serial_init (void)
{
struct pl01x_regs *regs = pl01x_get_regs(CONSOLE_PORT);
@@ -120,6 +122,7 @@ int serial_init (void)
readl(&regs->dr);
}
#endif
+ serial_init_called++;
/* First, disable everything */
writel(0, &regs->pl011_cr);
@@ -144,6 +147,7 @@ int serial_init (void)
writel(lcr, &regs->pl011_lcrh);
#ifdef CONFIG_PL011_SERIAL_RLCR
+#if 0
{
int i;
@@ -157,6 +161,9 @@ int serial_init (void)
writel(lcr, &regs->pl011_rlcr);
}
+#else
+ writel(lcr, &regs->pl011_rlcr);
+#endif
#endif
/* Finally, enable the UART */
writel(UART_PL011_CR_UARTEN | UART_PL011_CR_TXE | UART_PL011_CR_RXE,
@@ -167,6 +174,7 @@ int serial_init (void)
#endif /* CONFIG_PL011_SERIAL */
+
void serial_putc (const char c)
{
if (c == '\n')
@@ -184,7 +192,12 @@ void serial_puts (const char *s)
int serial_getc (void)
{
- return pl01x_getc (CONSOLE_PORT);
+ int data = pl01x_getc (CONSOLE_PORT);
+
+ if (!serial_init_called)
+ serial_init();
+
+ return data;
}
int serial_tstc (void)