[PATCH] serial: ns16550: Wait in debug_uart_init until tx buffer is empty

Tom Rini trini at konsulko.com
Fri Jul 8 18:39:21 CEST 2022


On Thu, Jun 23, 2022 at 02:13:56PM +0200, Pali Rohár wrote:

> Commit d293759d55cc ("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 at kernel.org>
> Reviewed-by: Stefan Roese <sr at denx.de>

Applied to u-boot/next, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220708/c4552036/attachment.sig>


More information about the U-Boot mailing list