diff options
author | li feng <li1.feng@intel.com> | 2021-07-07 09:48:57 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-19 17:49:15 +0000 |
commit | acc12b843cb90e117374a2395f5b318e336db338 (patch) | |
tree | 02da78feef75bf9c2a10e61e2c53e4fe8d0df4eb /common | |
parent | 2dd687f160dcda988ba9cb93ffb07d58680de572 (diff) | |
download | chrome-ec-acc12b843cb90e117374a2395f5b318e336db338.tar.gz |
retimer: clear unused mux bits
During retimer firmware update, EC passes mux value to Coreboot/kernel.
Coreboot/kernel checks mux value to know if PD port is NDA, or if port
connection is set to what retimer firmware update sequence expects.
Some bits of mux value are not used by Coreboot/kernel. This patch
clears unused bits; and keeps alternate mode bits and safe mode bit in
the mux value.
BUG=none
BRANCH=none
TEST=On ADL RVP, verified NDA port retimer firmware update working.
TEST=On Voxel DVT, verified NDA port retimer firmware update working
with both Chromium solution and upstream solution.
Signed-off-by: li feng <li1.feng@intel.com>
Change-Id: I1becc09a0f5c5d4e1fb845c5fe33fa748d44bd4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3010482
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usbc/usb_retimer_fw_update.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/common/usbc/usb_retimer_fw_update.c b/common/usbc/usb_retimer_fw_update.c index 2634081e2e..1ff198c78f 100644 --- a/common/usbc/usb_retimer_fw_update.c +++ b/common/usbc/usb_retimer_fw_update.c @@ -91,6 +91,11 @@ static void deferred_pd_suspend(void) } DECLARE_DEFERRED(deferred_pd_suspend); +static inline mux_state_t retimer_fw_update_usb_mux_get(int port) +{ + return usb_mux_get(port) & USB_RETIMER_FW_UPDATE_MUX_MASK; +} + void usb_retimer_fw_update_process_op_cb(int port) { switch (last_op) { @@ -118,26 +123,26 @@ void usb_retimer_fw_update_process_op_cb(int port) pd_set_suspend(port, RESUME); break; case USB_RETIMER_FW_UPDATE_GET_MUX: - last_result = usb_mux_get(port); + last_result = retimer_fw_update_usb_mux_get(port); break; case USB_RETIMER_FW_UPDATE_SET_USB: usb_mux_set(port, USB_PD_MUX_USB_ENABLED, USB_SWITCH_CONNECT, pd_get_polarity(port)); - last_result = usb_mux_get(port); + last_result = retimer_fw_update_usb_mux_get(port); break; case USB_RETIMER_FW_UPDATE_SET_SAFE: usb_mux_set_safe_mode(port); - last_result = usb_mux_get(port); + last_result = retimer_fw_update_usb_mux_get(port); break; case USB_RETIMER_FW_UPDATE_SET_TBT: usb_mux_set(port, USB_PD_MUX_TBT_COMPAT_ENABLED, USB_SWITCH_CONNECT, pd_get_polarity(port)); - last_result = usb_mux_get(port); + last_result = retimer_fw_update_usb_mux_get(port); break; case USB_RETIMER_FW_UPDATE_DISCONNECT: usb_mux_set(port, USB_PD_MUX_NONE, USB_SWITCH_DISCONNECT, pd_get_polarity(port)); - last_result = usb_mux_get(port); + last_result = retimer_fw_update_usb_mux_get(port); break; default: break; |