From 60f008c7af5bd6a47659bad2d242f9ddeed55bd7 Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Wed, 8 Feb 2017 11:02:30 -0800 Subject: [PATCH] cr50: reenable ap uart on servo disconnect The ap uart tx signal is disconnected if servo is attached, but it is never reconnected when servo is detached. The 'ccd uart enable' command only reconnects the EC uart tx signal, so if servo is detached the only way to reenable ap uart tx is to detach and reattach suzyq. This can cause cr50 to lose some ccd state. This change reconnects the ap uart when servo is detached. BUG=none BRANCH=none TEST=manual disconnect servo attach suzyq verify the ap console is read write attach servo verify the ap console is read only detach servo verify the ap console is read write Change-Id: I11cdd932b14d968ec77b18adf93dd0d3808fb2e9 Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/439704 Reviewed-by: Scott Collyer --- board/cr50/board.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/board/cr50/board.c b/board/cr50/board.c index afa9826f68..660bdd66c1 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -725,7 +725,12 @@ static void servo_deferred(void) if (servo_state_unknown()) return; - device_powered_off(DEVICE_SERVO); + /* + * If servo was detached reconnect the AP uart making it read write + * again. + */ + if (device_powered_off(DEVICE_SERVO) == EC_SUCCESS) + uartn_tx_connect(UART_AP); } DECLARE_DEFERRED(servo_deferred);