summaryrefslogtreecommitdiff
path: root/board/cr50/rdd.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2017-08-17 13:01:32 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-08-25 19:54:11 -0700
commit1154a307e1c4acee37aaf4e7a6beebe2d2ed67db (patch)
tree4b522d0865f35f94de84f8ee786ccfc64a1f7870 /board/cr50/rdd.c
parent07d646ced0da75061ca6b977806954559eafa2b8 (diff)
downloadchrome-ec-1154a307e1c4acee37aaf4e7a6beebe2d2ed67db.tar.gz
cr50: Split EC state machine into its own file
The device state machines aren't quite similar enough to use common code. Split the EC state machine out, the way we split out BattPrsnt and CCD_MODE. BUG=b:35587387 BRANCH=cr50 TEST=manual Pull CCD_MODE_L high, so Cr50 detects/enables CCD Pull EC_DETECT high. reboot -> 'EC RX only', then 'EC on' at 1 second Pull EC_DETECT low --> See 'EC off' message ccd --> EC UART disabled Pull EC_DETECT high --> See 'EC on' message ccd --> EC UART RX+TX Pull EC_DETECT low for <1 sec then back high (don't see EC off/on messages) ccd --> EC UART RX+TX Reboot with EC_DETECT still low -> EC off at 1 second Reboot with EC_DETECT still low and then assert EC_DETECT within a second -> EC RX only, then EC connect at 1 second. Change-Id: I71687e651d625cadd656934f4cb2bbadc0b58816 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/619750 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'board/cr50/rdd.c')
-rw-r--r--board/cr50/rdd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/board/cr50/rdd.c b/board/cr50/rdd.c
index 074ffac858..bfc58a136c 100644
--- a/board/cr50/rdd.c
+++ b/board/cr50/rdd.c
@@ -21,13 +21,12 @@
struct uart_config {
const char *name;
- enum device_type device;
int tx_signal;
};
static struct uart_config uarts[] = {
- [UART_AP] = {"AP", DEVICE_AP, GC_PINMUX_UART1_TX_SEL},
- [UART_EC] = {"EC", DEVICE_EC, GC_PINMUX_UART2_TX_SEL},
+ [UART_AP] = {"AP", GC_PINMUX_UART1_TX_SEL},
+ [UART_EC] = {"EC", GC_PINMUX_UART2_TX_SEL},
};
int rdd_is_connected(void)
@@ -84,7 +83,7 @@ void uartn_tx_connect(int uart)
return;
}
- if (device_get_state(uarts[uart].device) == DEVICE_STATE_ON)
+ if (uart == UART_AP ? ap_is_on() : ec_is_on())
uart_select_tx(uart, uarts[uart].tx_signal);
else if (!uart_tx_is_connected(uart))
CPRINTS("%s is powered off", uarts[uart].name);