diff options
author | Mary Ruthven <mruthven@chromium.org> | 2016-05-25 10:24:02 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-05-27 18:08:51 -0700 |
commit | 9139071b7188dc63e19ddf31fb748e35add79ebf (patch) | |
tree | 0e61b4ce3e2a3a69216307a7c46a0acf6146fa23 /chip/g | |
parent | f89b5a9b5be725cbd5f24c73a9f4a30c606f2bf2 (diff) | |
download | chrome-ec-9139071b7188dc63e19ddf31fb748e35add79ebf.tar.gz |
cr50: disable UART peripheral when the device is powered off.
When the AP or EC is off, the RX line is low. Holding the UART RX line
low causes an interrupt storm. This change disables the UART TX and RX
on the peripheral when the device is powered off so the interrupts wont
be triggered.
BUG=chrome-os-partner:53514,b:28885578
BRANCH=none
TEST=run taskinfo on cr50 and make sure the IRQ count for 181 is a
reasonable number.
Change-Id: I42c779253860a2b1dd27ab41fb7097c887cc23ff
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347355
Diffstat (limited to 'chip/g')
-rw-r--r-- | chip/g/uartn.c | 15 | ||||
-rw-r--r-- | chip/g/uartn.h | 6 |
2 files changed, 20 insertions, 1 deletions
diff --git a/chip/g/uartn.c b/chip/g/uartn.c index eac35d1577..17cd5e51b8 100644 --- a/chip/g/uartn.c +++ b/chip/g/uartn.c @@ -113,6 +113,19 @@ void uartn_enable_interrupt(int uart) } +/* Enable TX and RX. Disable HW flow control and loopback */ +void uartn_enable(int uart) +{ + /* TX and RX enable */ + GR_UART_CTRL(uart) = 0x03; +} + +/* Disable TX, RX, HW flow control, and loopback */ +void uartn_disable(int uart) +{ + GR_UART_CTRL(uart) = 0; +} + void uartn_init(int uart) { long long setting = (16 * (1 << UART_NCO_WIDTH) * @@ -131,7 +144,7 @@ void uartn_init(int uart) * TX enable, RX enable, HW flow control disabled, no * loopback */ - GR_UART_CTRL(uart) = 0x03; + uartn_enable(uart); /* enable RX interrupts in block */ /* Note: doesn't do anything unless turned on in NVIC */ diff --git a/chip/g/uartn.h b/chip/g/uartn.h index 50554f80bc..e13c2f6552 100644 --- a/chip/g/uartn.h +++ b/chip/g/uartn.h @@ -82,4 +82,10 @@ void uartn_tx_connect(int uart); /* Disable UART output */ void uartn_tx_disconnect(int uart); + +/* Enable TX and RX. Disable HW flow control and loopback */ +void uartn_enable(int uart); + +/* Disable TX, RX, HW flow control, and loopback */ +void uartn_disable(int uart); #endif /* __CROS_EC_UARTN_H */ |