From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manfred Huber Date: Thu, 21 Mar 2013 20:03:59 +0100 Subject: [U-Boot] [PATCH] omap3_beagle: Enable CONFIG_SYS_NS16550_BROKEN_TEMT In-Reply-To: References: <1679653192.50708.1361970554739.JavaMail.ngmail@webmail21.arcor-online.net> <51447012.6010303@arcor.de> <20130319144957.GF25919@bill-the-cat> Message-ID: <514B599F.8040804@arcor.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Manfred Huber Beagleboard UART (ns16550) doesn't set the Transmitter Empty (TEMT) Bit in SPL. Only Transmitter Hold Register Empty (THRE) Bit is set. This makes SPL to hang while waiting for TEMT. Adding the CONFIG_SYS_NS16550_BROKEN_TEMT config option and waiting for THRE avoid this issue. Signed-off-by: Manfred Huber --- drivers/serial/ns16550.c | 5 ++++- include/configs/omap3_beagle.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index b2da8b3..6379bcc 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -36,7 +36,10 @@ void NS16550_init(NS16550_t com_port, int baud_divisor) { -#if (!defined(CONFIG_SYS_NS16550_BROKEN_TEMT)) +#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SYS_NS16550_BROKEN_TEMT) + while (!(serial_in(&com_port->lsr) & UART_LSR_THRE)) + ; +#else while (!(serial_in(&com_port->lsr) & UART_LSR_TEMT)) ; #endif diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 48ce4c0..6ab46d5 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -82,6 +82,9 @@ #define CONFIG_SYS_NS16550_REG_SIZE (-4) #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK +/* define to avoid U-Boot to hang while waiting for TEMT */ +#define CONFIG_SYS_NS16550_BROKEN_TEMT + /* * select serial console configuration */