diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-10-10 22:26:20 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-06 03:08:01 +0000 |
commit | ec32c12885a1800cb30916d2e28089432a794595 (patch) | |
tree | 0807071a02413c30b304721a39da4230c7a6928a /driver/retimer | |
parent | e541093661124cd63d3ef9ca1877676311df9861 (diff) | |
download | chrome-ec-ec32c12885a1800cb30916d2e28089432a794595.tar.gz |
TCPMv2: Add support for linear re-driver cables
The linear re-driver cables enumerate as passive cables in the Discover
mode SOP' response from the cable. But they have Active/Passive bit
(B25) in the discover mode SOP' response set. Hence, if the cable is
LRD, the port enters Thunderbolt mode SOP' before entering USB and
it also sets the cable as active in the mux and retimer setting.
USB4 PD flow for LRD cables:
Is Discover mode SOP'
B25? ----- N ----- Enter USB4 SOP with Gen 2 cable speed
|
y
|
Enter TBT SOP'
|
Enter USB4 SOP as per cable speed.
TBT PD flow for LRD cables:
Is Discover mode SOP'
B25? ----- N ----- Enter TBT SOP
|
y
|
Enter TBT SOP'
|
Enter TBT SOP
This CL also updates the retimer setting and Enter USB Data object for
USB4 according to the type of cable detected (LRD/Active/passive)
BUG=b:156749387
BRANCH=None
TEST=With Linear re-driver cable,
1. Able to enter USB4 mode
2. Able to enter Thunderbolt mode
3. Able to exit and re-enter USB4 on reboot
4. Able to exit and re-enter Thunderbolt mode on reboot
Change-Id: Ie5258f792e13a205dea71fc9f06b1d8987ec9194
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2470209
Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'driver/retimer')
-rw-r--r-- | driver/retimer/bb_retimer.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/driver/retimer/bb_retimer.c b/driver/retimer/bb_retimer.c index 7c5eacdb8b..b9fb42081b 100644 --- a/driver/retimer/bb_retimer.c +++ b/driver/retimer/bb_retimer.c @@ -130,7 +130,8 @@ __overridable void bb_retimer_power_handle(const struct usb_mux *me, int on_off) static void retimer_set_state_dfp(int port, mux_state_t mux_state, uint32_t *set_retimer_con) { - union tbt_mode_resp_cable cable_resp; + union tbt_mode_resp_cable cable_resp = { + .raw_value = pd_get_tbt_mode_vdo(port, TCPC_TX_SOP_PRIME) }; union tbt_mode_resp_device dev_resp; enum idh_ptype cable_type = get_usb_pd_cable_type(port); struct pd_discovery *disc; @@ -173,13 +174,12 @@ static void retimer_set_state_dfp(int port, mux_state_t mux_state, * set according to Discover mode SOP' response. */ if ((mux_state & BB_RETIMER_MUX_USB_ALT_MODE) && - (cable_type == IDH_PTYPE_ACABLE)) + ((cable_type == IDH_PTYPE_ACABLE) || + cable_resp.tbt_active_passive == TBT_CABLE_ACTIVE)) *set_retimer_con |= BB_RETIMER_ACTIVE_PASSIVE; 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); /* @@ -227,8 +227,9 @@ static void retimer_set_state_dfp(int port, mux_state_t mux_state, * 1 - Active with uni-directional LSRX communication * Set to "0" when passive cable plug */ - if (cable_type == IDH_PTYPE_ACABLE && - cable_resp.lsrx_comm == UNIDIR_LSRX_COMM) + if ((cable_type == IDH_PTYPE_ACABLE || + cable_resp.tbt_active_passive == TBT_CABLE_ACTIVE) && + cable_resp.lsrx_comm == UNIDIR_LSRX_COMM) *set_retimer_con |= BB_RETIMER_TBT_ACTIVE_LINK_TRAINING; /* |