diff mbox

[U-Boot,RFC,17/17] ns16550: wait for TENT before initializing

Message ID 1348272087-29608-18-git-send-email-scottwood@freescale.com
State RFC
Headers show

Commit Message

Scott Wood Sept. 22, 2012, 12:01 a.m. UTC
This prevents output problems (including a loss of synchronization
observed on p2020 that persisted for quite a while) if SPL has output
still on its way out.  I'm not sure why this is only now beginning to
happen, though.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 drivers/serial/ns16550.c |    3 +++
 1 file changed, 3 insertions(+)

Comments

Timur Tabi Oct. 1, 2012, 2:27 p.m. UTC | #1
Scott Wood wrote:
> This prevents output problems (including a loss of synchronization
> observed on p2020 that persisted for quite a while) if SPL has output
> still on its way out.  I'm not sure why this is only now beginning to
> happen, though.

The subject line says "TENT", but the macro says "TEMT".

Also, it would be nice to see a description of this bit somewhere.

> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
>  drivers/serial/ns16550.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> index 0c23955..66201b6 100644
> --- a/drivers/serial/ns16550.c
> +++ b/drivers/serial/ns16550.c
> @@ -36,6 +36,9 @@
>  
>  void NS16550_init(NS16550_t com_port, int baud_divisor)
>  {
> +	while (!(serial_in(&com_port->lsr) & UART_LSR_TEMT))
> +		;
> +
>  	serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
>  #if (defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)) || \
>  					defined(CONFIG_AM33XX)
diff mbox

Patch

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 0c23955..66201b6 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -36,6 +36,9 @@ 
 
 void NS16550_init(NS16550_t com_port, int baud_divisor)
 {
+	while (!(serial_in(&com_port->lsr) & UART_LSR_TEMT))
+		;
+
 	serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
 #if (defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)) || \
 					defined(CONFIG_AM33XX)