diff options
author | li feng <li1.feng@intel.com> | 2020-09-30 22:41:33 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-13 22:31:59 +0000 |
commit | 061d6259110a0b8d913015d9579dcb50f5de5800 (patch) | |
tree | d6acb9a7ad0902c852ecb8b895c2fd368ebf9c91 | |
parent | 449221a82b6bb789bcb279169a0daffcf0c57a1d (diff) | |
download | chrome-ec-061d6259110a0b8d913015d9579dcb50f5de5800.tar.gz |
TCPMv2: check active cable SVID support
According to TBT4 PD flow, SOP' discovery SVID should support
USB_VID_INTEL to enable Thunderbolt Alt mode.
BUG=none
BRANCH=master
TEST=1. Volteer EVT connects to TBT dock with TBT passive cable,
EC can enter TBT mode
2. Volteer EVT connects to TBT dock with TBT active cable which
supports SVID USB_VID_INTEL, EC can enter TBT mode.
Signed-off-by: li feng <li1.feng@intel.com>
Change-Id: I10e16bff89175fe8425a6c7afc31141a6a5d573f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2441962
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r-- | common/usbc/tbt_alt_mode.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/common/usbc/tbt_alt_mode.c b/common/usbc/tbt_alt_mode.c index 4b79f26efb..619d8a5b2e 100644 --- a/common/usbc/tbt_alt_mode.c +++ b/common/usbc/tbt_alt_mode.c @@ -316,9 +316,24 @@ static bool tbt_mode_is_supported(int port, int vdo_count) const struct pd_discovery *disc = pd_get_am_discovery(port, TCPC_TX_SOP); - return disc->identity.idh.modal_support && - is_tbt_cable_superspeed(port) && - get_tbt_cable_speed(port) >= TBT_SS_U31_GEN1; + if (!disc->identity.idh.modal_support) + return false; + + if (!(is_tbt_cable_superspeed(port) && + get_tbt_cable_speed(port) >= TBT_SS_U31_GEN1)) + return false; + + /* + * TBT4 PD Discovery Flow Application Notes Revision 0.9: + * Figure 2: for active cable, SOP' should support + * SVID USB_VID_INTEL to enter Thunderbolt alt mode + */ + if (get_usb_pd_cable_type(port) == IDH_PTYPE_ACABLE && + !pd_is_mode_discovered_for_svid( + port, TCPC_TX_SOP_PRIME, USB_VID_INTEL)) + return false; + + return true; } int tbt_setup_next_vdm(int port, int vdo_count, uint32_t *vdm, |