]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
serial/ns16550: add an option to avoid hanging on broken platforms
authorJavier Martinez Canillas <javier@dowhile0.org>
Mon, 7 Jan 2013 01:35:20 +0000 (01:35 +0000)
committerTom Rini <trini@ti.com>
Thu, 10 Jan 2013 22:09:24 +0000 (15:09 -0700)
Some platforms (e.g. IGEPv2 board) has a broken ns16550 UART that
does not set the TEMT bit when the transmitter is empty in SPL.
This makes U-Boot to hang while waiting for TEMT to be set.

Add a new option to avoid this:

CONFIG_SYS_NS16550_BROKEN_TEMT

16550 UART set the Transmitter Empty (TEMT) Bit when all output
has finished and the transmitter is totally empty. U-Boot waits
for this bit to be set to initialize the serial console. On some
broken platforms this bit is not set in SPL making U-Boot to
hang while waiting for TEMT. Define this option to avoid it.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
README
drivers/serial/ns16550.c

diff --git a/README b/README
index 653ef6aa4a55d57686165e56eeec847dcd40b3f1..98dbe98c2ef5eee54256790eb24998a81ae720cb 100644 (file)
--- a/README
+++ b/README
@@ -616,6 +616,14 @@ The following options need to be configured:
                boot loader that has already initialized the UART.  Define this
                variable to flush the UART at init time.
 
+               CONFIG_SYS_NS16550_BROKEN_TEMT
+
+               16550 UART set the Transmitter Empty (TEMT) Bit when all output
+               has finished and the transmitter is totally empty. U-Boot waits
+               for this bit to be set to initialize the serial console. On some
+               broken platforms this bit is not set in SPL making U-Boot to
+               hang while waiting for TEMT. Define this option to avoid it.
+
 
 - Console Interface:
                Depending on board, define exactly one serial port
index bbd91ca247df995d2b5d11e865ea7ba391574239..87a09170864242b262c338dc72670cc46b9e9d97 100644 (file)
 
 void NS16550_init(NS16550_t com_port, int baud_divisor)
 {
+#if (!defined(CONFIG_SYS_NS16550_BROKEN_TEMT))
        while (!(serial_in(&com_port->lsr) & UART_LSR_TEMT))
                ;
+#endif
 
        serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
 #if (defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)) || \