Dear Hong Xu,
> Before reset dbgu transmitter, we just wait TXEMPTY to drain the
> transmitter register. If not doing this, we may sometimes see several
> weird characters from DBGU.
>
> A short delay is also added to make sure the new serial settings are
> settled.
>
> Signed-off-by: Hong Xu<hong...@atmel.com>
> ---
> Change since V1:
> - Fix comment for easy reading
>
>   drivers/serial/atmel_usart.c |    8 +++++++-
>   1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
> index e326b2b..6f9c2de 100644
> --- a/drivers/serial/atmel_usart.c
> +++ b/drivers/serial/atmel_usart.c
> @@ -49,17 +49,23 @@ int serial_init(void)
>   {
>       atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
>
> +     /* Just in case: drain transmitter register */
> +     while (!(readl(&usart->csr)&  USART3_BIT(TXEMPTY)))
> +             ;
> +

You still have not addressed my concern about a possible hang situation here!
I rather have _some_ weird characters than an apparently dead board...
When do we have the possibility of weird characters anyway?
Only if a preloader makes output and transfers to u-boot before its output
has been flushed. Any other situations?

Best Regards,
Reinhard
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to