u-boot/drivers/serial
Pali Rohár 5e998b4de3 serial: ns16550: Wait in debug_uart_init until tx buffer is empty
Commit d293759d55 ("serial: ns16550: Add support for
SPL_DEBUG_UART_BASE") fixed support for setting correct early debug UART
base address in SPL.

But after this commit, output from Marvell A385 BootROM is truncated or
lost and not fully present on serial console.

Debugging this issue showed that BootROM just put bytes into UART HW output
buffer and does not wait until UART HW transmit all characters. U-Boot
ns16550 early debug is initialized very early and during its initialization
is resetting UART HW and flushing remaining transmit buffer (which still
contains BootROM output).

Fix this issue by waiting in init function prior resetting UART HW until
TxEmpty bit in UART Line Status Register is set. TxEmpty is set when all
remaining bytes from HW buffer are transmitted.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
[trini: Add comment, move ';' to new line per checkpatch.pl]
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-07-08 12:20:04 -04:00
..
Kconfig arm: Remove PXA architecture support 2022-07-07 09:29:08 -04:00
Makefile arm: Remove PXA architecture support 2022-07-07 09:29:08 -04:00
altera_jtag_uart.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
altera_uart.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
arm_dcc.c
atmel_usart.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
atmel_usart.h
lpc32xx_hsuart.c
ns16550.c serial: ns16550: Wait in debug_uart_init until tx buffer is empty 2022-07-08 12:20:04 -04:00
sandbox.c serial: sandbox: Fix buffer underflow in puts 2022-06-23 12:58:18 -04:00
serial-uclass.c serial: Fix _serial_puts using \n\r instead of \r\n 2022-04-14 15:39:15 -04:00
serial.c serial: Add semihosting driver 2022-04-01 15:03:13 -04:00
serial_ar933x.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_arc.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_bcm283x_mu.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
serial_bcm283x_pl011.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
serial_bcm6345.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_coreboot.c
serial_cortina.c
serial_efi.c efi: serial: Support arrow keys 2021-12-31 06:45:01 +01:00
serial_htif.c serial: Add RISC-V HTIF console driver 2022-02-10 11:18:12 +08:00
serial_intel_mid.c
serial_linflexuart.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_lpuart.c
serial_mcf.c
serial_meson.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_mpc8xx.c
serial_msm.c
serial_msm_geni.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_mt7620.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_mtk.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_mvebu_a3700.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_mxc.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_npcm.c serial: npcm: Add support for Nuvoton NPCM SoCs 2022-05-05 09:28:47 -04:00
serial_ns16550.c
serial_nulldev.c serial: remove nulldev_serial_input 2022-02-09 12:30:13 -07:00
serial_octeon_bootcmd.c
serial_octeon_pcie_console.c
serial_omap.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_owl.c
serial_pic32.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_pl01x.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_pl01x_internal.h
serial_rockchip.c rockchip: serial: rename U_BOOT_DRIVER name to rockchip_uart 2022-04-18 11:25:13 +08:00
serial_s5p.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_sbi.c
serial_semihosting.c serial: smh: Fake tstc 2022-06-06 18:01:21 -04:00
serial_sh.c
serial_sh.h
serial_sifive.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_sti_asc.c
serial_stm32.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_stm32.h
serial_uniphier.c
serial_xen.c
serial_xuartlite.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
serial_zynq.c serial: Replace CONFIG_DEBUG_UART_BASE by CONFIG_VAL(DEBUG_UART_BASE) 2022-06-06 18:01:21 -04:00
usbtty.c
usbtty.h arm: Remove PXA architecture support 2022-07-07 09:29:08 -04:00