summaryrefslogtreecommitdiff
path: root/driver/retimer
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-10-14 15:00:33 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-05 20:54:15 +0000
commit7fcb1a8a8dc0cb59e432118eac4ce366132a65f7 (patch)
treed0c2b35cfd9f7ad4a42efb4aaa2034c4ca4e5c44 /driver/retimer
parentcb5058d798c53a8cb46c7cf67c2cf77f76670f3a (diff)
downloadchrome-ec-7fcb1a8a8dc0cb59e432118eac4ce366132a65f7.tar.gz
BB retimer: Update USB4 related bits
This CL updates the following bits: Bit 4: USB3 bit - If active cable V3, according to Discover Idenitity SOP response, Product VDO 2 B5. else set to 1 Bit 16: Thunderbolt support - According to B3:B5 of Discover Identity SOP response. Bit 19: VPro Support - If host is vPro capable and according to Discover Mode SOP response B26/B31. This CL also updates the thunderbolt related bits for the retimer if the thunderbolt mode SOP' and SOP'' is entered. BUG=b:156749387 BRANCH=None TEST=Able to update the retimer bits on entering USB4 mode Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: Ic083001dee73d854379f1f3dfd85bebe5ee6ef5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2473597 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'driver/retimer')
-rw-r--r--driver/retimer/bb_retimer.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/driver/retimer/bb_retimer.c b/driver/retimer/bb_retimer.c
index 64ffa2b4dd..7c5eacdb8b 100644
--- a/driver/retimer/bb_retimer.c
+++ b/driver/retimer/bb_retimer.c
@@ -133,8 +133,11 @@ static void retimer_set_state_dfp(int port, mux_state_t mux_state,
union tbt_mode_resp_cable cable_resp;
union tbt_mode_resp_device dev_resp;
enum idh_ptype cable_type = get_usb_pd_cable_type(port);
+ struct pd_discovery *disc;
- if (mux_state & USB_PD_MUX_USB_ENABLED) {
+ if (mux_state & USB_PD_MUX_USB_ENABLED ||
+ mux_state & USB_PD_MUX_TBT_COMPAT_ENABLED ||
+ mux_state & USB_PD_MUX_USB4_ENABLED) {
/*
* Bit 4: USB2_CONNECTION (ignored if BIT5=0).
* 0 - No USB2 Connection
@@ -173,7 +176,8 @@ static void retimer_set_state_dfp(int port, mux_state_t mux_state,
(cable_type == IDH_PTYPE_ACABLE))
*set_retimer_con |= BB_RETIMER_ACTIVE_PASSIVE;
- if (mux_state & USB_PD_MUX_TBT_COMPAT_ENABLED) {
+ if (mux_state & USB_PD_MUX_TBT_COMPAT_ENABLED ||
+ mux_state & USB_PD_MUX_USB4_ENABLED) {
cable_resp.raw_value =
pd_get_tbt_mode_vdo(port, TCPC_TX_SOP_PRIME);
dev_resp.raw_value = pd_get_tbt_mode_vdo(port, TCPC_TX_SOP);
@@ -246,7 +250,18 @@ static void retimer_set_state_dfp(int port, mux_state_t mux_state,
*/
*set_retimer_con |= BB_RETIMER_TBT_CABLE_GENERATION(
cable_resp.tbt_rounded);
- } else if (mux_state & USB_PD_MUX_USB4_ENABLED) {
+ }
+ if (mux_state & USB_PD_MUX_USB4_ENABLED) {
+ disc = pd_get_am_discovery(port, TCPC_TX_SOP);
+
+ /*
+ * Bit 16: TBT_CONNECTION
+ * 0 - Port partner doesn't support TBT3
+ * 1 - Port partner supports TBT3
+ */
+ if (PD_PRODUCT_IS_TBT3(disc->identity.product_t1.raw_value))
+ *set_retimer_con |= BB_RETIMER_TBT_CONNECTION;
+
/*
* Bit 27-25: USB4 Cable speed
* 000b - No functionality
@@ -294,6 +309,9 @@ static void retimer_set_state_ufp(mux_state_t mux_state,
* Bit 2: RE_TIMER_DRIVER:
* Set according to b20:19 of enter USB.
*
+ * Bit 16: TBT_CONNECTION:
+ * Set according to b14 of enter USB.
+ *
* Bit 18: CABLE_TYPE:
* For Thunderbolt-compat mode, set according to bit 21 of enter mode.
* For USB/DP/USB4, set according to bits 20:19 of enter mode.