summaryrefslogtreecommitdiff
path: root/include/usb_mode.h
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 /include/usb_mode.h
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 'include/usb_mode.h')
-rw-r--r--include/usb_mode.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/usb_mode.h b/include/usb_mode.h
index 728d7abc44..69170594ab 100644
--- a/include/usb_mode.h
+++ b/include/usb_mode.h
@@ -40,13 +40,22 @@ bool enter_usb_entry_is_done(int port);
void enter_usb_failed(int port);
/*
- * Returns True if port, port partner and cable supports USB4 mode
+ * Returns True if port partner supports USB4 mode
*
* @param port USB-C port number
- * @return True if USB4 mode is supported,
+ * @return True if USB4 mode is supported by the port partner,
* False otherwise
*/
-bool enter_usb_is_capable(int port);
+bool enter_usb_port_partner_is_capable(int port);
+
+/*
+ * Returns True if cable supports USB4 mode
+ *
+ * @param port USB-C port number
+ * @return True if USB4 mode is supported by the cable,
+ * False otherwise
+ */
+bool enter_usb_cable_is_capable(int port);
/*
* Handles accepted USB4 response
@@ -68,7 +77,8 @@ void enter_usb_rejected(int port, enum tcpm_transmit_type type);
* Constructs the next USB4 EUDO that should be sent.
*
* @param port USB-C port number
+ * @param type Transmit type (SOP, SOP', SOP'') for request
*/
-uint32_t enter_usb_setup_next_msg(int port);
+uint32_t enter_usb_setup_next_msg(int port, enum tcpm_transmit_type *type);
#endif