diff options
author | Ayushee Shah <ayushee.shah@intel.com> | 2021-02-08 10:03:51 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-08 21:40:23 +0000 |
commit | 517510614956497be60604ff5b936e6a7ab75c8f (patch) | |
tree | 93dc793f7a1fb5d1dc46a08469e4d6ed742837ef | |
parent | 529b46f93d64a5106aa46101d14487ce8c00026d (diff) | |
download | chrome-ec-517510614956497be60604ff5b936e6a7ab75c8f.tar.gz |
USB4: Correct get_usb4_cable_speed()
Only check for discover identity superspeed signaling bits i.e. B2:0
when it's a Revision 3.0 active cable with vdo version greater than or
equal to 1.3
BUG=None
BRANCH=None
TEST=Able to enter USb4 with 20G with MBR cables
Signed-off-by: Ayushee Shah <ayushee.shah@intel.com>
Change-Id: I29f535f2ac65870bd9dffc7d4d4765ebf115a8fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2682769
Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r-- | common/usb_pd_alt_mode_dfp.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c index cc479823f3..fe9e46f35b 100644 --- a/common/usb_pd_alt_mode_dfp.c +++ b/common/usb_pd_alt_mode_dfp.c @@ -920,7 +920,6 @@ __overridable enum tbt_compat_cable_speed board_get_max_tbt_speed(int port) */ enum usb_rev30_ss get_usb4_cable_speed(int port) { - struct pd_discovery *disc; enum tbt_compat_cable_speed tbt_speed = get_tbt_cable_speed(port); enum usb_rev30_ss max_usb4_speed; @@ -935,11 +934,17 @@ enum usb_rev30_ss get_usb4_cable_speed(int port) max_usb4_speed = tbt_speed == TBT_SS_TBT_GEN3 ? USB_R30_SS_U40_GEN3 : USB_R30_SS_U32_U40_GEN2; - if (is_pd_rev3(port, TCPC_TX_SOP_PRIME)) { - disc = pd_get_am_discovery(port, TCPC_TX_SOP_PRIME); + if ((get_usb_pd_cable_type(port) == IDH_PTYPE_ACABLE) && + is_pd_rev3(port, TCPC_TX_SOP_PRIME)) { + struct pd_discovery *disc = + pd_get_am_discovery(port, TCPC_TX_SOP_PRIME); + union active_cable_vdo1_rev30 a_rev30 = + disc->identity.product_t1.a_rev30; - return max_usb4_speed < disc->identity.product_t1.p_rev30.ss ? - max_usb4_speed : disc->identity.product_t1.p_rev30.ss; + if (a_rev30.vdo_ver >= VDO_VERSION_1_3) { + return max_usb4_speed < a_rev30.ss ? + max_usb4_speed : a_rev30.ss; + } } return max_usb4_speed; |