summaryrefslogtreecommitdiff
path: root/driver/usb_mux
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2020-06-25 14:56:28 -0600
committerCommit Bot <commit-bot@chromium.org>2020-07-01 23:21:16 +0000
commite8bd3c057ceb1c881ccd5112b577d94cd730b7d6 (patch)
tree615a5ead4a1577e875fce7022132d2af0cc945d9 /driver/usb_mux
parent0891b0f1d64c440fbb79f4c1beaf974e65b9c6f6 (diff)
downloadchrome-ec-e8bd3c057ceb1c881ccd5112b577d94cd730b7d6.tar.gz
bb_retimer: add power up timing
Ensure the Burnside Bridge is held in reset when the AP is off and add a delay to reset de-assertion to meet Burnside Bridge requirements. BUG=b:159743964 BRANCH=none TEST=make buildall TEST=Verify BB initialization is skipped when the AP is off (verified with extra debug) TEST=Verify operation of USB, DP, and USB4 devices on Burnside bridge. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I4a4f05aaf84bf93b3c3032998bc811591c8fbf35 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2271697 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'driver/usb_mux')
-rw-r--r--driver/usb_mux/usb_mux.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/driver/usb_mux/usb_mux.c b/driver/usb_mux/usb_mux.c
index 911558905d..cfc91352bc 100644
--- a/driver/usb_mux/usb_mux.c
+++ b/driver/usb_mux/usb_mux.c
@@ -149,16 +149,24 @@ static inline void exit_low_power_mode(int port)
void usb_mux_init(int port)
{
+ int rv;
+
ASSERT(port >= 0 && port < CONFIG_USB_PD_PORT_MAX_COUNT);
if (port >= board_get_usb_pd_port_count()) {
return;
}
- configure_mux(port, USB_MUX_INIT, NULL);
+ rv = configure_mux(port, USB_MUX_INIT, NULL);
- /* Device is always out of LPM after initialization. */
- flags[port] &= ~USB_MUX_FLAG_IN_LPM;
+ /*
+ * Mux may fail initialization if it's not powered. Mark this port
+ * as in LPM mode to try initialization again.
+ */
+ if (rv == EC_ERROR_NOT_POWERED)
+ flags[port] |= USB_MUX_FLAG_IN_LPM;
+ else
+ flags[port] &= ~USB_MUX_FLAG_IN_LPM;
}
/*