summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2015-11-06 10:15:06 -0800
committerBill Richardson <wfrichar@chromium.org>2015-11-10 22:39:23 +0000
commit71133a0d80dcb6f15e3bd57dd0c4e29d978b1e66 (patch)
tree29c6b7919175aa2d9cb1f788183af90356dfb0d7
parent576444aa1364d548ff6d29b3f5e7224975bffda6 (diff)
downloadchrome-ec-71133a0d80dcb6f15e3bd57dd0c4e29d978b1e66.tar.gz
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>
-rw-r--r--chip/g/uart.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/chip/g/uart.c b/chip/g/uart.c
index 665d893e11..f7219d5d4c 100644
--- a/chip/g/uart.c
+++ b/chip/g/uart.c
@@ -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)