summaryrefslogtreecommitdiff
path: root/include/usb_pd_vdo.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesstabilize-quickfix-15278.72.B-ishstabilize-quickfix-15183.78.B-ishstabilize-15446.B-ishstabilize-15439.B-ishstabilize-15432.B-ishstabilize-15429.B-ishstabilize-15415.B-ishstabilize-15395.B-ishstabilize-15393.48.B-ishstabilize-15381.B-ishstabilize-15364.B-ishstabilize-15361.B-ishstabilize-15359.B-ishstabilize-15359.58.B-ishstabilize-15359.50.B-ishstabilize-15359.45.B-ishstabilize-15335.B-ishstabilize-15329.59.B-ishstabilize-15329.44.B-ishstabilize-15317.B-ishstabilize-15301.B-ishstabilize-15300.B-ishstabilize-15278.64.B-ishstabilize-15251.B-ishstabilize-15245.B-ishstabilize-15236.66.B-ishstabilize-15208.B-ishstabilize-15207.B-ishstabilize-15185.B-ishstabilize-15185.7.B-ishstabilize-15183.82.B-ishstabilize-15183.69.B-ishstabilize-15183.14.B-ishstabilize-15174.B-ishstabilize-15167.B-ishstabilize-15129.B-ishstabilize-15122.B-ishstabilize-15120.B-ishstabilize-15117.86.B-ishstabilize-15117.48.B-ishstabilize-15117.111.B-ishrelease-R114-15437.B-ishrelease-R113-15393.B-ishrelease-R112-15359.B-ishrelease-R111-15329.B-ishrelease-R110-15278.B-ishrelease-R109-15237.B-ishrelease-R109-15236.B-ishrelease-R108-15183.B-ishrelease-R107-15117.B-ishishfirmware-ti50-prepvt-15315.B-ishfirmware-skyrim-15390.B-ishfirmware-skyrim-15369.B-ishfirmware-nissa-15217.B-ishfirmware-nissa-15217.45.B-ishfirmware-nissa-15217.126.B-ishfirmware-duplo-15151.B-ishfirmware-corsola-15194.B-ishfactory-trogdor-15210.B-ishfactory-skyrim-15384.B-ishfactory-nissa-15199.B-ishfactory-corsola-15197.B-ishfactory-corsola-15196.B-ishfactory-brya-15231.B-ishMike Frysinger2022-09-141-1/+1
| | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: I5b357b85ae9473a192b80983871bef4ae0d4b16f Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3893394 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* honeybuns: Add full usb-pd support for C0Scott Collyer2021-03-241-2/+2
| | | | | | | | | | | | | | | | | | | | | This CL adds config options and board level structs to fully support USB-PD on port C0 for both gingerbread and quiche. This includes all the svdm response functions required for support of DP Alt-mode as a UFP_D. This also includes honeybuns specific version of usb-pd policy functions. BUG=b:175660576 BRANCH=None TEST=Verify that C0 port can establish PD contract, enter ALT-DP mode and extend display over DP/HDMI connectors. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I11edee85e63381f00114e9fbe012a37fd8174279 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2699455 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* TCPMV2: Add support for (CT) Vconn Powered DevicesSam Hurst2021-03-171-0/+19
| | | | | | | | | | | | | | | | | | | | | Add support for Charge Through Vconn Powered Devices BUG=b:165934405 BRANCH=none TEST=make runtests 1) Verified that Apple VPD audio device worked. 2) With charger plugged into Chocodile_Vpdmcu, verified that a Voxel could be charged. 3) FAILED: Plugging Chocodile_Vpdmcu into Voxel first and then plugging in charger to Chocodile_Vpdmcu, Chocodile is detected as a Debug Accessory (CC1 = Rd and CC2 = Rd) and VCONN is never applied. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I977b316dc531aa33bb6a236523c8ddbbb23014d0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748429 Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMV2: Add explicit setting of VPD VDO CT CurrentSam Hurst2021-03-121-2/+9
| | | | | | | | | | | | | | | | | | Add the capablility to explicity set a CTVPDs VDO current. BUG=b:165934405 BRANCH=none TEST=make runtests Verified that returned VDO from chocodile_vpdmcu was correct. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I2292024986fa89b228b56678d61d1aef2866c817 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748427 Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Sam Hurst <shurst@google.com>
* TCPMV2: Fix the VPD_VDO returned by VPDsSam Hurst2021-03-121-1/+1
| | | | | | | | | | | | | | | | A device that supports Vconn Powered functionality must reflect this by setting bit0 of its VPD VDO to 1 or 0 if said functionality isn't supported. BUG=b:165934405 BRANCH=none TEST=make runtests Verified that returned VDO from chocodile_vpdmcu was correct. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I2f7b6a66c09221f1d5c12831cd2e4b56510aecdd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748426 Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMv2: support TBT Alt mode as UFPli feng2020-12-211-1/+106
| | | | | | | | | | | | | | | | | | | Implemented SVDM responders for TBT Alt mode BUG=b:148528713,b:157163664,b:162986785 BRANCH=none TEST=1. Build ec with CL:2382634; OS CPFE 13447, CB CPFE 13535 2. Boot up Volteer, run "pd trysrc 0" on EC console; 3. Then connect port 1 to TGL Windows RVP TBT port; 4. Thunderbolt connection is established. Volteer port 1 as UFP, Windows RVP TBT port as DFP. From host console, thunderbolt0 is listed as network interface in ifconfig. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: If4c80418677f541e9c1c7c8c84446357000aaecb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2370045 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Aashay Shringarpure <aashay@google.com>
* BB retimer: Update USB4 related bitsAyushee2020-11-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* TCPMv2: Add support for USB4 active cableAyushee2020-11-051-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* TCPM: Correct VDO structuresDiana Z2020-09-021-51/+53
| | | | | | | | | | | | | | | | | When defined bit fields for a unit8_t cross byte boundaries, this can cause unexpected packing. In this case, all of the VDO unions were actually of size 8, rather than size 4. This change alters the fields to be defined in a uint32_t, and adds build asserts to ensure the unions remain the correct size. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ia3d585820dcb3e825c02f8732791b53fbdff96af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2379992 Reviewed-by: Jett Rink <jettrink@chromium.org>
* BB retimer: Add 'USB2_connection' bitVijay Hiremath2020-05-211-1/+6
| | | | | | | | | | | | | | | | | | USB2_CONNECTION bit is set to 1 if the cable is either Passive or a Gen3 active cable with USB2.0 support. Hence, added a function that indicates if the cable supports USB2 connection. Ref: Burnside Bridge spec Table 13: Connection state register BUG=b:152544514 BRANCH=None TEST=Tested on volteer by connecting a dock using a Gen3 Active cable with a USB2.0 connected to the dock, able to set USB2_connection bit. Change-Id: I125182b23becaa7d00011f6eadb1916b48c79803 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2139278 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* USB4: Correct getting product type from VDOAyushee2020-04-281-0/+12
| | | | | | | | | | | | | | | | | | Earlier, the product type was extracted from the Product VDO. But, according to USB PD Spec 3.0 version 2.0 and USB PD spec 2.0 version 1.3 ID Header VDO gives the UFP product type. Also added a check to ensure the port receives a valid UFP product VDO. BUG=b:154900425 BRANCH=None TEST=Checked on Volteer, able to enter into USB4 mode Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I2efa6885701684df4a39d12c064f8bb658efb8a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2166484 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* PD: Create unified structure for all SOP* identityDiana Z2020-04-071-0/+95
| | | | | | | | | | | | | | | | | Creates a structure to be used by all SOP* types to store identity information. Combines the full response size storage currently used for SOP, as well as some of the structure accessibility introduced with the cable attributes. Currently not all product type VDOs have defined structures, but these may be added as needed by the code. BRANCH=None BUG=b:152417977 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I7b57b43447653dfbe1024b8fe71375916e0821b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2130475 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv1: Add support for USB4.0Ayushee Shah2020-01-311-1/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* TCPMv1: Correct the TBT3 Discovery and Entry FlowVijay Hiremath2020-01-101-0/+643
Ref: USB Type-C Cable and Connector Specification 2.0 F.2 TBT3 Discovery and Entry Flow - Corrected the TBT3 Discovery flow - Corrected the TBT3 Entry Flow - Enabled the Active cable TBT3 mode entry - Refactored TBT & Cable VDO code on TCPMv1 so that same VDO structures can be used for TCPMv2 - Corrected getting the cable version - Cleaned up the code for super speed cable detection BUG=b:146006708, b:140643923, b:147134610 BRANCH=none TEST=Make buildall -j Able to detect Thunderbolt-compatible devices on TGLRVP Change-Id: I65f82e241d0cc2187050913e7d16942fdaa0ebd4 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1981276 Reviewed-by: Diana Z <dzigterman@chromium.org>