[U-Boot] [PATCH] omap3_beagle: Enable CONFIG_SYS_NS16550_BROKEN_TEMT

Scott Wood scottwood at freescale.com
Thu Mar 21 23:28:30 CET 2013


On 03/21/2013 05:21:00 PM, Tom Rini wrote:
> On Thu, Mar 21, 2013 at 08:03:59PM +0100, Manfred Huber wrote:
> > From: Manfred Huber
> >
> > Beagleboard UART (ns16550) doesn't set the Transmitter Empty (TEMT)
> > Bit in SPL.

The serial port behaves differently based on the stage of U-Boot that  
is running?

Or is it that the bit doesn't get set until the port has been properly  
initialized?  Couldn't that happen in a case where SPL isn't used at  
all?

> > 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 <man.huber at arcor.de>
> > ---
> >  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
> 
> Scott, do you still have access to the failing systems that made us
> introduce this change to start with?

It was an intermittent failure seen on a development tree, so not  
really.  You could try testing it by printing something immediately  
before calling NS16550_init(), either in a situation where you know the  
serial port is already configured (e.g. by SPL) or by calling  
NS16550_init() twice.

> Could we perhaps go with the THRE test instead in all cases?  Thanks!

Wouldn't that still allow the last character to possibly be corrupted?

-Scott


More information about the U-Boot mailing list