Add a fence between the write to the UART transmit register and the
subsequent read from the transmit status register, to ensure that the
status correctly reflects the occurrence of the write.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
.macro print_char_uart_8250
early_uart_reg_base a7
sb a0, EARLY_UART_8250_TX(a7)
+ fence
early_uart_8250_wait_\@:
lbu a1, EARLY_UART_8250_LSR(a7)
andi a1, a1, EARLY_UART_8250_LSR_THRE
.macro print_char_uart_sifive
early_uart_reg_base a7
sw a0, EARLY_UART_SIFIVE_TXFIFO(a7)
+ fence
early_uart_sifive_wait_\@:
lw a1, EARLY_UART_SIFIVE_TXFIFO(a7)
bltz a1, early_uart_sifive_wait_\@