diff options
author | Madhusudanarao Amara <madhusudanarao.amara@intel.corp-partner.google.com> | 2021-03-25 23:27:25 +0530 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-31 21:18:51 +0000 |
commit | e1aade50d6e4bae6cb338705afe78e51934492c0 (patch) | |
tree | 05e7cd255e844cd3bd3f2ff129592496e442317c /common | |
parent | 50f3ba5687d9ad6b4939610cfb61a0dda1337d4c (diff) | |
download | chrome-ec-e1aade50d6e4bae6cb338705afe78e51934492c0.tar.gz |
TCPMv2: Enter safe mode before entering TBT/USB4 mode for the cable.
Before sending Enter Mode/Enter USB to the cable plug (SOP' and SOP'')
the usb mux and retimer should be configured to safe mode
BUG=b:183781477
BRANCH=None
TEST=TBT/USB4 device enumerates fine on coldboot, warmboot and hotplug
with MBR and passive cables.
Change-Id: Ia8fe95d9183f7febdb118bca51ea9a137870832c
Signed-off-by: Madhusudanarao Amara <madhusudanarao.amara@intel.corp-partner.google.com>
Signed-off-by: Ayushee Shah <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2786883
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_pd_alt_mode_dfp.c | 9 | ||||
-rw-r--r-- | common/usbc/usb_mode.c | 15 |
2 files changed, 15 insertions, 9 deletions
diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c index c671616da6..700af4ea25 100644 --- a/common/usb_pd_alt_mode_dfp.c +++ b/common/usb_pd_alt_mode_dfp.c @@ -962,13 +962,18 @@ int enter_tbt_compat_mode(int port, enum tcpm_transmit_type sop, VDO_CMDT(CMDT_INIT) | VDO_SVDM_VERS(pd_get_vdo_ver(port, enter_mode_sop)); + /* + * Enter safe mode before sending Enter mode SOP/SOP'/SOP'' + * Ref: Tiger Lake Platform PD Controller Interface Requirements for + * Integrated USB C, section A.1.2 TBT as DFP. + */ + usb_mux_set_safe_mode(port); + /* For TBT3 Cable Enter Mode Command, number of Objects is 1 */ if ((sop == TCPC_TX_SOP_PRIME) || (sop == TCPC_TX_SOP_PRIME_PRIME)) return 1; - usb_mux_set_safe_mode(port); - dev_mode_resp.raw_value = pd_get_tbt_mode_vdo(port, TCPC_TX_SOP); cable_mode_resp.raw_value = pd_get_tbt_mode_vdo(port, TCPC_TX_SOP_PRIME); diff --git a/common/usbc/usb_mode.c b/common/usbc/usb_mode.c index 6f8d4a7fe9..54034c8f19 100644 --- a/common/usbc/usb_mode.c +++ b/common/usbc/usb_mode.c @@ -269,14 +269,20 @@ uint32_t enter_usb_setup_next_msg(int port, enum tcpm_transmit_type *type) switch (usb4_state[port]) { case USB4_START: disc_sop_prime = pd_get_am_discovery(port, TCPC_TX_SOP_PRIME); + /* + * Ref: Tiger Lake Platform PD Controller Interface Requirements + * for Integrated USBC, section A.2.2: USB4 as DFP. + * Enter safe mode before sending Enter USB SOP/SOP'/SOP'' + * TODO (b/156749387): Remove once data reset feature is in + * place. + */ + usb_mux_set_safe_mode(port); if (pd_get_vdo_ver(port, TCPC_TX_SOP_PRIME) < VDM_VER20 || disc_sop_prime->identity.product_t1.a_rev30.vdo_ver < VDO_VERSION_1_3 || get_usb_pd_cable_type(port) == IDH_PTYPE_PCABLE) { usb4_state[port] = USB4_ENTER_SOP; - /* Ref: TBT4 PD Discover Flow */ - usb_mux_set_safe_mode(port); } else { usb4_state[port] = USB4_ENTER_SOP_PRIME; *type = TCPC_TX_SOP_PRIME; @@ -290,11 +296,6 @@ uint32_t enter_usb_setup_next_msg(int port, enum tcpm_transmit_type *type) break; case USB4_ENTER_SOP: *type = TCPC_TX_SOP; - /* - * Set the USB mux to safe state to avoid damaging the mux pins, - * since they are being re-purposed for USB4. - */ - usb_mux_set_safe_mode(port); break; case USB4_ACTIVE: return -1; |