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 <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/439704
Reviewed-by: Scott Collyer <scollyer@chromium.org>
This commit is contained in:
Mary Ruthven
2017-02-08 11:02:30 -08:00
committed by chrome-bot
parent b456101158
commit 60f008c7af

View File

@@ -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);