summaryrefslogtreecommitdiff
path: root/common/usb_pd_host_cmd.c
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-09-24 15:40:07 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-05 04:11:47 +0000
commit1a265d194969d8778fdd759e1eed891f0638202b (patch)
tree9644b49b6c118bc0120c051530b16995d4bc5a78 /common/usb_pd_host_cmd.c
parente609f07eef8b851b19bf4b59b5263ac702d8b871 (diff)
downloadchrome-ec-1a265d194969d8778fdd759e1eed891f0638202b.tar.gz
TCPMv2: Add support for USB4 active cable
USB4 PD flow for active cables: Structured VDM version (cable revision)-- <2.0 -------->| | | >=2.0 | | | VDO version---- <1.3 -------> Modal op? -- N --| (B21:23 of | | Discover ID SOP'- y | Active cable VDO1) | | | TBT SVID? -- N --| >=1.3 | | | y | Cable USB4 support? - N | | | | Gen4 cable? - N - Skip USB4 mode entry y Skip USB4 | | mode entry | Enter USB4 y (SOP',SOP'',SOP) | | |<---- NAK ----- Enter mode TBT SOP'<---| | | | | ACK | | | | |<---- NAK ----- Enter mode TBT SOP'' | | | | Exit TBT mode SOP ACK | | | | ACK/NAK Enter USB4 mode | | SOP | Exit TBT mode SOP'' | | | ACK/NAK | | | Exit TBT mode SOP' | | | ACK/NAK | | | |--------Retry done? ---- N ------------| | y | Skip USB4 mode entry The CL also checks if the port is VCONN source before sending Enter USB SOP' and SOP'' messages and requests for a vconn swap is it isn't In case of reboot, the port sends exit Thunderbolt mode SOP' and SOP'' and skips sending exit Thunderbolt mode for SOP, since it didn't enter Thunderbolt mode SOP prior to reboot. Note: 1. This is only applicable when the port enters USB4 mode SOP and Thunderbolt mode with the cable plug. 2. It is a temporary behaviour until data reset feature is in place (b/141363146) BUG=b:156749387 BRANCH=None TEST=1.Able to enter into USB4 with active cable. 2.Able to exit Thunderbolt mode SOP' and SOP'' on reboot and re-enter into USB4 mode with active cable. Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I828c7ca0fd9b7b1025f13bcc86c511692b9f9895 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2432868 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common/usb_pd_host_cmd.c')
-rw-r--r--common/usb_pd_host_cmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/usb_pd_host_cmd.c b/common/usb_pd_host_cmd.c
index 11174ee7d4..62b7045630 100644
--- a/common/usb_pd_host_cmd.c
+++ b/common/usb_pd_host_cmd.c
@@ -372,7 +372,9 @@ static enum ec_status hc_usb_pd_control(struct host_cmd_handler_args *args)
if (mux_state & USB_PD_MUX_USB4_ENABLED) {
r_v2->cable_speed =
get_usb4_cable_speed(p->port);
- } else 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) {
r_v2->cable_speed =
get_tbt_cable_speed(p->port);
r_v2->cable_gen =