summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-05-29 15:00:41 -0600
committerJett Rink <jettrink@chromium.org>2019-06-04 21:06:13 +0000
commit52ad88a8bded635a7fd28af33bd62eb2ec73cca8 (patch)
tree70d4915316c09c77fee0f4a05e93dbf5b6caef63
parentee69e28836c23f8ff668693947a5449ddd33721b (diff)
downloadchrome-ec-52ad88a8bded635a7fd28af33bd62eb2ec73cca8.tar.gz
ish: remove unnecessary task switch for UART
When starting to send UART data, we do not need to invoke the ISR for the UART. That only needs to be invoked if there is incoming RX messages (which it still is invoked) or the FIFO can accept more data and was full before. BRANCH=none BUG=none TEST=console input and output still works and takes much less time. Change-Id: Ib05c66ee704aad2d93836709bc6b706c627285c5 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1634620 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1643435
-rw-r--r--chip/ish/uart.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/chip/ish/uart.c b/chip/ish/uart.c
index e512b53588..1e5963daf2 100644
--- a/chip/ish/uart.c
+++ b/chip/ish/uart.c
@@ -73,8 +73,6 @@ void uart_tx_start(void)
disable_sleep(SLEEP_MASK_UART);
IER(ISH_DEBUG_UART) |= IER_TDRQ;
-
- task_trigger_irq(ISH_DEBUG_UART_IRQ);
}
}
@@ -98,7 +96,7 @@ void uart_tx_flush(void)
int uart_tx_ready(void)
{
- return 1;
+ return LSR(ISH_DEBUG_UART) & LSR_TDRQ;
}
int uart_rx_available(void)
@@ -112,7 +110,7 @@ int uart_rx_available(void)
void uart_write_char(char c)
{
/* Wait till reciever is ready */
- while ((LSR(ISH_DEBUG_UART) & LSR_TEMT) == 0)
+ while (!uart_tx_ready())
continue;
THR(ISH_DEBUG_UART) = c;