Some implementations of 16550-compatible UARTs (e.g. the DesignWare
UART) are known to ignore writes to the line control register while
the transmitter is active.
Wait for the transmitter to become empty before attempting to write to
the line control register.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
if ( ns16550_read ( ns16550, NS16550_SCR ) != 0xae )
return -ENODEV;
+ /* Wait for UART to become idle before modifying LCR */
+ ns16550_flush ( uart );
+
/* Configure divisor and line control register, if applicable */
ns16550_write ( ns16550, NS16550_LCR,
( NS16550_LCR_8N1 | NS16550_LCR_DLAB ) );