diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-05-28 16:37:44 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-05 10:15:38 +0000 |
commit | 5fceb8b92e1fc492036d57d1d0f9df81c6c3e2ff (patch) | |
tree | 233b50aabac969285ad4ccd1c2174caa6f0b7d55 /common/usb_pd_policy.c | |
parent | c9e0e383c9279c07ddcfa12c604a259da665bebb (diff) | |
download | chrome-ec-5fceb8b92e1fc492036d57d1d0f9df81c6c3e2ff.tar.gz |
usb_pd: USB4: Limit the cable speed
Added 'get_usb4_cable_speed()' to return USB4 speed as per the port, the
speed supported by DUT's port or cable speed whichever is lowest.
Added configuring the cable speed in cros_ec_usb_pd_control according to
the mux setting.
Removed 'set_max_usb4_cable_speed()' to retain cable's actual VDO
response.
BUG=b:157671582
BRANCH=none
TEST=1. Able to set USB4/USB3.2 Gen2 cable speed when DFP isn't gen 3
capable.
2. Able to limit cable speed according to the port, if the cable
speed is higher.
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Change-Id: I21bba7e5a2aa8ca54f304ef8418320f319f020b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2220826
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/usb_pd_policy.c')
-rw-r--r-- | common/usb_pd_policy.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index 38bb04f83b..8a92ac879f 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -346,28 +346,6 @@ static inline void disable_usb4_mode(int port) } /* - * For Cable rev 3.0: USB4 cable speed is set according to speed supported by - * the port and the response received from the cable, whichever is least. - * - * For Cable rev 2.0: Since board_is_tbt_usb4_port() should not enabled if the - * port supports speed less than USB_R20_SS_U31_GEN1_GEN2, USB4 cable speed is - * set according to the cable response. - */ -static void set_max_usb4_cable_speed(int port) -{ - /* - * Converting Thunderbolt-Compatible board speed to equivalent USB4 - * speed. - */ - enum usb_rev30_ss max_usb4_speed = - board_get_max_tbt_speed(port) == TBT_SS_TBT_GEN3 ? - USB_R30_SS_U40_GEN3 : USB_R30_SS_U32_U40_GEN2; - - if (max_usb4_speed < cable[port].attr.p_rev30.ss) - cable[port].attr.p_rev30.ss = max_usb4_speed; -} - -/* * Ref: USB Type-C Cable and Connector Specification * Figure 5-1 USB4 Discovery and Entry Flow Model. * @@ -410,7 +388,6 @@ static bool is_cable_ready_to_enter_usb4(int port, int cnt) is_vdo_present(cnt, VDO_INDEX_PTYPE_CABLE1)) { switch (cable[port].rev) { case PD_REV30: - set_max_usb4_cable_speed(port); switch (cable[port].attr.p_rev30.ss) { case USB_R30_SS_U40_GEN3: case USB_R30_SS_U32_U40_GEN1: |