Cr50: Fix uart_tx_flush() to really flush

We were just checking to see if the UART TX unit was idle. We
also need to be sure there aren't any bytes in the TX FIFO that
haven't been clocked out yet.

BUG=none
BRANCH=none
TEST=make buildall, manual

Before, "crash watchdog" would truncate the trace dump as it
rebooted. Now it doesn't.

Change-Id: Icff828445801ce61a0a8f296b3d3e9fb300b7efc
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/311299
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
This commit is contained in:
Bill Richardson
2015-11-06 10:15:06 -08:00
parent 576444aa13
commit 71133a0d80

View File

@@ -57,8 +57,9 @@ void uart_tx_stop(void)
int uart_tx_in_progress(void)
{
/* Transmit is in progress if the TX idle bit is not set */
return !(GR_UART_STATE(0) & GC_UART_STATE_TXIDLE_MASK);
/* Transmit is in progress unless the TX FIFO is empty and idle. */
return !(GR_UART_STATE(0) & (GC_UART_STATE_TXIDLE_MASK |
GC_UART_STATE_TXEMPTY_MASK));
}
void uart_tx_flush(void)