diff options
author | Ayushee Shah <ayushee.shah@intel.com> | 2019-12-17 12:00:54 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-31 01:49:45 +0000 |
commit | 6d26f78208fbaab8a41264b52bee36eee3668bcc (patch) | |
tree | 58f65d76a37ee756b5fa5bda0932672b944b964a /include/usb_pd_vdo.h | |
parent | d682d368eeeaae56063859b2503c75fc4299022b (diff) | |
download | chrome-ec-6d26f78208fbaab8a41264b52bee36eee3668bcc.tar.gz |
TCPMv1: Add support for USB4.0
USB4 is based on the Thunderbolt 3 protocol specification. It
supports 40 Gbit/s throughput, is compatible with Thunderbolt 3,
and backwards compatible with USB 3.2, USB 2.0.
USB4.0 PD Flow:
Ref: USB Type-C Cable and Connector Specification 2.0
Figure 5-1 USB4 Discovery and Entry Flow Model
USB PD Explicit Contract
Discover ID SOP -------- USB4 compatible?
|
-------------yes------------|------No----- Exit USB4 Discovery
|
Discover ID SOP' --------- Product type
|
Passive cable----------|----Active Cable---USB4?
| |
| (Not implemented in this CL)
USB Signaling -----------------------
| | |
| USB4 with USB4 active cable Exit USB4
| Discovery
---------------------------------------------
| | | |
USB4 Gen3 USB3.2 Gen2 USB3.2 Gen1 USB2.0
| | | |
Enter USB4 with | Enter USB4 with Exit USB4 Discovery
USB4 Gen3 | USB4 Gen1
Passive cable | Passive cable
|
DFP Gen3 capable?
|
------yes---- |---------No--------
| |
Discover SVID SOP Enter USB4 with USB3.2 Gen2 Passive Cable
|
Discover SVID SOP'
|
Discover Mode SOP
|
Discover Mode SOP' --------Is TBT3?
|
-----yes----|-----No----
| |
Enter USB4 with TBT3 Enter USB4 with TBT
Gen3 passive cable Gen2 passive cable
BUG=b:140819518
BRANCH=None
TEST=With Gatkex creek 3 device, TGLRVP can enter to USB4.0 mode
Change-Id: Id861661c66c53a0a32679388bb7e2e81aae3ceb5
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1926382
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include/usb_pd_vdo.h')
-rw-r--r-- | include/usb_pd_vdo.h | 119 |
1 files changed, 118 insertions, 1 deletions
diff --git a/include/usb_pd_vdo.h b/include/usb_pd_vdo.h index b813bda933..d141d878f1 100644 --- a/include/usb_pd_vdo.h +++ b/include/usb_pd_vdo.h @@ -25,6 +25,35 @@ /*****************************************************************************/ /* + * Table 6-35 UFP VDO 1 + * ------------------------------------------------------------- + * <31:29> : UFP VDO version + * <28> : Reserved + * <27:24> : Device Capability + * 0001b = USB2.0 Device capable + * 0010b = USB2.0 Device capable (Billboard only) + * 0100b = USB3.2 Device capable + * 1000b = USB4 Device Capable + * <23:6> : Reserved + * <5:3> : Alternate Modes + * 001b = Supports TBT3 alternate mode + * 010b = Supports Alternate Modes that reconfigure + * the signals on the [USB Type-C 2.0] connector + * – except for [TBT3] + * 100b = Supports Alternate Modes that do not + * reconfigure the signals on the [USB Type-C 2.0] + * connector + * <2:0> : USB Highest Speed + * 000b = USB 2.0 only, no SuperSpeed support + * 001b = USB 3.2 Gen1 + * 010b = USB 3.2/USB4 Gen2 + * 011b = USB4 Gen3 + * 100b…111b = Reserved, Shall Not be used + */ +#define PD_PRODUCT_IS_USB4(vdo) ((vdo) >> 27 & 0x1) + +/*****************************************************************************/ +/* * Table 6-38 Passive Cable VDO * ------------------------------------------------------------- * <31:28> : HW Version @@ -265,6 +294,11 @@ union active_cable_vdo1_rev30 { * 1b = Gen 2 or higher * Note: see VDO1 USB Highest Speed for details of Gen supported. */ +enum retimer_active_element { + ACTIVE_REDRIVER, + ACTIVE_RETIMER, +}; + union active_cable_vdo2_rev30 { struct { uint8_t usb_gen : 1; @@ -275,7 +309,7 @@ union active_cable_vdo2_rev30 { uint8_t usb_20_support : 1; uint8_t usb_20_hub_hop : 2; uint8_t usb_40_support : 1; - uint8_t active_elem : 1; + enum retimer_active_element active_elem : 1; uint8_t physical_conn : 1; uint8_t u3_to_u0 : 1; uint8_t u3_power : 3; @@ -640,4 +674,87 @@ enum ama_usb_ss { AMA_USBSS_BBONLY, }; +/* + * Enter USB Data Object (Ref: USB PD 3.2 Version 2.0 Table 6-47) + * ----------------------- + * <31> : Reserved + * <30:28> : USB Mode + * 000b - USB2.0 + * 001b - USB3.2 + * 010b - USB4 + * <27> : Reserved + * <26> : USB4 DRD + * 0b: Not capable of operating as a [USB4] Device + * 1b: Capable of operating as a [USB4] Device + * <25> : USB3 DRD + * 0b: Not capable of operating as a [USB 3.2] Device + * 1b: Capable of operating as a [USB 3.2] Device + * <24> : Reserved + * <23:21> : Cable Speed + * 000b - [USB 2.0] only, no SuperSpeed support + * 001b - [USB 3.2] Gen1 + * 010b - [USB 3.2] Gen2 and [USB4] Gen2 + * 011b - [USB4] Gen3 + * 111b..100b: Reserved, Shall not be used + * <20:19> : Cable Type + * 00b - Passive + * 01b - Active Re-timer + * 10b - Active Re-driver + * 11b - Optically Isolated + * <18:17> : Cable Current + * 00b = VBUS is not supported + * 01b = Reserved + * 10b = 3A + * 11b = 5A + * <16> : PCIe Supported ? (1b == Yes, 0b == No) + * <15 : DP Supported ? (1b == Yes, 0b == No) + * <14> : TBT Supported ? (1b == Yes, 0b == No) + * <13> : Host present ? (1b == Yes, 0b == No) + * <12:0> : Reserved + */ +enum usb_mode { + USB_PD_20, + USB_PD_32, + USB_PD_40, + USB_PD_INVALID_3, + USB_PD_INVALID_4, + USB_PD_INVALID_5, + USB_PD_INVALID_6, + USB_PD_INVALID_7, +}; + +enum usb4_cable_current { + USB4_CABLE_CURRENT_INVALID, + USB4_CABLE_CURRENT_RESERVED, + USB4_CABLE_CURRENT_3A, + USB4_CABLE_CURRENT_5A, +}; + +enum usb4_cable_type { + CABLE_TYPE_PASSIVE, + CABLE_TYPE_ACTIVE_RETIMER, + CABLE_TYPE_ACTIVE_REDRIVER, + CABLE_TYPE_ISOLATED, +}; + +union enter_usb_data_obj { + struct { + uint16_t reserved3 : 13; + uint8_t host_present : 1; + uint8_t tbt_supported : 1; + uint8_t dp_supported : 1; + uint8_t pcie_supported : 1; + enum usb4_cable_current cable_current : 2; + enum usb4_cable_type cable_type : 2; + enum usb_rev30_ss cable_speed : 3; + uint8_t reserved2 : 1; + uint8_t usb3_drd_cap : 1; + uint8_t usb4_drd_cap : 1; + uint8_t reserved1 : 1; + enum usb_mode mode : 3; + uint8_t reserved0 : 1; + }; + uint32_t raw_value; +}; + #endif /* __CROS_EC_USB_PD_VDO_H */ |