On 9 August 2018 at 13:04, Simon Goldschmidt
<simon.k.r.goldschm...@gmail.com> wrote:
> If _debug_uart_putc() is called before _debug_uart_init(), the
> ns16550 debug uart driver hangs in a tight loop waiting for the
> tx FIFO to get empty.
>
> As this can happen via a printf sneaking in before the port calls
> debug_uart_init(), let's rather ignore characters before the debug
> uart is initialized.
>
> This is done by reading the baudrate divisor and aborting if is zero.
>
> Tested on socfpga_cyclone5_socrates.
>
> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschm...@gmail.com>
> ---
> v2:
>  - this patch is new in v2 of the series. It replaces the printf/debug
>   change in reset_manager_gen5.c from v1
>
>  drivers/serial/ns16550.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)

We cannot use global_data before it is set up, so I think this is the
best solution.

Acked-by: Simon Glass <s...@chromium.org>

Regards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to