summaryrefslogtreecommitdiff
path: root/common/usbc/tbt_alt_mode.c
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-051-579/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* usbpd: implement new api to access PD discovery dataDeepti Deshatty2021-09-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | API pd_get_am_discovery() sets the lock (task access bit) to keep track of EC tasks accessing the pd port discovery data. If any of the task access bits are set,EC host task typec discovery handler will return EC_RES_BUSY to host, indicating discovery data is modified while copying port discovery data to the host. Hence the lock/task access bit should be set only when the port discovery data is modified by any tasks. Setting of lock/task access is removed from pd_get_am_discovery() and implemented new api pd_get_am_discovery_and_notify_access() for this. pd_get_am_discovery() proto type is changed to return 'constant pointer' which forces developers to use pd_get_am_discovery_and_notify_access() when they intend to access and modify discovery data. summary of changes implemented. - Remove setting of task access bit from pd_get_am_discovery(). - modify pd_get_am_discovery() prototype to return constant pointer. - implement new api pd_get_am_discovery_and_notify_access() - Replace calls to pd_get_am_discovery() with new api wherever discovery data is accessed and modified. BRANCH=none BUG=b:197466819 b:190390784 TEST=Verified 50 cold boot cycling with TBT device attached. Device detected in every cycle. Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com> Change-Id: I5b6f1f2b91d92ddbe58f3bf994f684abee948c02 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3139858 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* TCPM: Rename enum tcpm_sop_type and its constantsAbe Levkoy2021-08-311-38/+39
| | | | | | | | | | | | | | | As a followup to CL:3104290, give the TCPCI TRANSMIT and RX_BUF_FRAME_TYPE types more consistent names. Most of them can be used for receiving, not just transmitting. Fix lint errors thus revealed. BUG=b:155476419 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I399ec479eacc18622fc4d3f55f8bdabf4560fcff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3125995 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPM: Rename enum tcpm_transmit_typeAbe Levkoy2021-08-181-4/+5
| | | | | | | | | | | | | | | Rename tcpm_transmit_type to tcpm_sop_type to reflect that it can be used for Rx as well. Describe it in comments. This prepares to consolidate enum pd_msg_type into this enum. BUG=b:155476419 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ife97d4ad51c48f2e832b94e007954919e236a309 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3104290 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Don't retry after failed alt mode entryAbe Levkoy2021-04-131-3/+6
| | | | | | | | | | | | | | | | If entering DP or TBT alt mode fails, leave the state machine in an inactive state. Allow the DPM to see that the mode entry process is done and stop trying to send more VDMs. BUG=b:184197145,b:179443762 TEST=make buildall TEST=Pass TDA.2.1.2.1 on Voxel with AP-driven mode entry TEST=Enter, exit, and reenter DP and TBT mode with host commands BRANCH=firmware-volteer-13672.B-main Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: If72b3410f9aa174c48c65a8ca908d79e2090fa62 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2798525
* TCPMv2: PE/DPM: Don't preemptively set modal flagScott Collyer2021-03-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Currently we are setting the modal flag as a DFP when the ENTER command is being sent, without confirmation of the ACK reply from the UFP. This CL keeps this behavior for TCPMv1, but moves the setting of the modal flag into the alt mode specific state machine. Currently, we only support DP and Thunderbolt alt modes. When the modal flag is set pre-emptively, we will fail the TDA.2.2.3: BMC-PROT-SEQ-DRSWAP compliance test. This is because we trigger a hard reset if the modal flag is set and we receive a data role swap request. BUG=b:180764800,b:159946351,b:181386294 BRANCH=None TEST=Verifed that TDA.2.2.3: BMC-PROT-SEQ-DRSWAP passes on quiche Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I4ae527903859e8ffdb01f355606c5d0f7d177def Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2751329 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* USB4: For AP mode entry, add support for active cablesAyushee Shah2021-03-101-0/+31
| | | | | | | | | | | | | | | | | | For AP mode entry, request to enter Thunderbolt cable mode entry prior to entering USB4 mode if - 1. Thunderbolt Mode SOP' VDO active/passive bit (B25) is TBT_CABLE_ACTIVE or 2. It's an active cable with VDM version < 2.0 or VDO version < 1.3 BUG=b:181286325 BRANCH=None TEST=Able to enter USB4 mode with LRD cable Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Change-Id: Ie223fa3d95c2357a0e50aeea93444e6f7639cc3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2724653 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Update exit mode sequenceAyushee Shah2021-02-111-3/+6
| | | | | | | | | | | | | | | | | | On exit mode request - Instead to entering safe mode -> USB mode, this CL updates the sequence to - 1. Set Mux, retimer to disconnect 2. Send exit mode to cable/port-partner 3. Set mux and retimer to USB mode BUG=b:173459141 BRANCH=None TEST=Able to re-enter into alternate mode with AP driver approach Change-Id: I6f8f2d4523736100057de4425b3df64b90858e70 Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2643523 Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Update exiting Thunderbolt mode SOPAyushee Shah2021-01-071-1/+1
| | | | | | | | | | | | | | | | On receiving the ack for exiting thunderbolt mode SOP, call the tbt_exit_done() function instead of only clearing TBT_FLAG_RETRY_DONE flag. BUG=b:173459141 BRANCH=none TEST=Able to enter and exit AP driven Thunderbolt mode Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Change-Id: Icc941beec027f808aa2eafd5190c977640b7599e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2613727 Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* tcpm: Move tcpm.h into an include directorySimon Glass2020-12-221-1/+1
| | | | | | | | | | | | | | | | | | This header file is used from quite a few files, relying on the EC build system to find includes in the driver/tcpm directory. For Zephyr we don't want to add that as an include. It makes more sense for header files to be in an include directory, so move it and fix up the users. BUG=b:175434113 BRANCH=none TEST=build Zephyr and ECOS on volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I5851914b1a7d3fdc1ba911c0fbe9046afbaf6f5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597985 Reviewed-by: Keith Short <keithshort@chromium.org>
* TBT: Enter Thunderbolt mode if the cable response timesoutAyushee Shah2020-12-161-2/+1
| | | | | | | | | | | | | | | | | | | | If the passive superspeed cable doesn't support Intel SVID, then the Thunderbolt cable speed should be set to Passive Gen 2 cable. Ref: USB Type-C Cable and Connector Specification, Fig F-1. This commit, checks if the cable is superspeed before returning the thunderbolt cable speed and sets the overridable maximum speed supported by the board to TBT_SS_TBT_GEN3. BUG=b:172364575 BRANCH=None TEST=Tested on Voxel, able to enter Thunderbolt mode if the cable fails to respond to Discover SVID SOP' Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Change-Id: Ib5137670c08cbe17166f5a90241ddbcb77e059f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2582988 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Add support for linear re-driver cablesAyushee2020-11-061-8/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* TCPMv2: Allow alternate mode reentryAbe Levkoy2020-11-051-2/+5
| | | | | | | | | | | | | | When the EC is waiting for the AP to direct it to enter alternate modes, allow the AP to direct an Exit Mode followed by another Enter Mode. BUG=b:168030639 TEST=Exit and reenter DP and TBT alt modes BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I9edf0ca0a787ed025de2d5a5403d4225a6683e3b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2518612 Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMv2: Add support for USB4 active cableAyushee2020-11-051-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* TCPMv2: Avoid alt mode files from changing DPM statesAyushee2020-10-141-21/+32
| | | | | | | | | | | | | | | | | | | | | | | | USB4 mode: Added a function to check if the USB4 entry is completed Thunderbolt mode: Added 2 flags TBT_RETRY_DONE, TBT_EXIT_DONE to track the Thunderbolt mode's exit and if retry is needed and a new function to check if if the Thunderbolt mode entry is completed DisplayPort mode: Added a function to check if the DisplayPort entry is completed BUG=b:169169804 BRANCH=None TEST=1. Able to enter alternate mode on hotplug and reboot 2. Able to exit the alternate mode on chipset transition and on DPM's exit mode request. Change-Id: I09662449143ad8d94b30ae102ed5ce79db852687 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2421425 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TBT:Add support for exit mode SOP'/SOP'' on chipset transitionAyushee2020-10-141-22/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When chipset is transitioning to a new state or on sysjump, the EC re-negotiates to enter an alternate mode on booting up. This commit adds support for exiting Thunderbolt mode for SOP' and SOP'' for active cable on chipset transition and also moves all the alternate mode exit rotines to their respective files. It also delays deleting the SVID data until after the EXIT_MODE message has ACKed and avoids pd_dfp_exit_mode() from changing the alternate mode's internal states. This commit also makes sure that the mux is set to safe state before exiting the alternate mode and it is reconfigured according to the port's current data role on receiving ACK/NAK from the cable/port partner. BUG=b:151169925, b:159717794 BRANCH=none TEST=On reboot, able to exit and re-enter into DisplayPort mode, Thunderbolt mode with passive cable and thunderbolt mode with active cable. Change-Id: If1e48e9f31cd678e23fe89bd3494551b5d1a78f1 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2415082 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMv2: check active cable SVID supportli feng2020-10-131-3/+18
| | | | | | | | | | | | | | | | | According to TBT4 PD flow, SOP' discovery SVID should support USB_VID_INTEL to enable Thunderbolt Alt mode. BUG=none BRANCH=master TEST=1. Volteer EVT connects to TBT dock with TBT passive cable, EC can enter TBT mode 2. Volteer EVT connects to TBT dock with TBT active cable which supports SVID USB_VID_INTEL, EC can enter TBT mode. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: I10e16bff89175fe8425a6c7afc31141a6a5d573f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2441962 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Send SOP'/SOP'' VDM only when the port is VCONN srcAyushee2020-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | According to USB PD spec, section 2.5.4, only VCONN source can communicate with the cable plug. This CL checks if the port is the VCONN before sending SOP'/SOP'' messages. If there is a VCONN source failure, port retries swapping the VCONN times before marking the VDM as failed/naked. The CL also enables falling back to DP mode in case enter mode thunderbolt fails. BUG=b:148528713 BRANCH=None TEST=Tested on volteer, the port sends SOP'/SOP'' VDMs to the cable only if it's the VCONN source Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I5880104a7a42b3e7de9e472affd41e937d36f9a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2368066 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TBT: Enter DP mode if Thunderbolt mode isn't supportedAyushee2020-08-071-9/+16
| | | | | | | | | | | | | | | This commit checks if the Thunderbolt mode is supported at TBT_START. If the port/port-partner/cable doesn't support Thunderbolt mode, fall back on DP mode instead. BUG=b:162776463 BRANCH=None TEST=Able to detect Thunderbolt docks as Display port dock on port 0. Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I424772c96afa9f3f11e5d4d9daa562bbbb011381 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335883 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Add thunderbolt entry flow for active cableli feng2020-07-181-53/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Order of Enter Mode: SOP', SOP''(if supported), SOP Order of Exit Mode: SOP, SOP''(if supported), SOP' Entry flow start from TBT_START, state changes to TBT_ACTIVE if succeed; changes to TBT_INACTIVE if fail. Handling of NAK If any enter mode SOP* is NAK'ed, exit modes of all SOP* and retry enter. If any enter mode in retry is NAK'ed again, will exit modes of all SOP*, TBT entry failed. Special case: Exit in TBT_ACTIVE: start from TBT_ACTIVE, exit all modes of SOP*, then chagne state to TBT_INACTIVE. BUG=b:148528713 BRANCH=none TEST=1. Attach Thunderbolt dock and active cable, DUT enter Thunderbolt mode 2. Attach Thunderbolt dock and passive cable, DUT enter Thunderbolt mode Signed-off-by: li feng <li1.feng@intel.com> Change-Id: Iaaa63f70c4abc9c269cdbb2a504214f924155901 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2277487 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Add common exit mode for all the alternate modesAyushee2020-07-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | When chipset is transitioning to a new state or on sysjump, the SOC re-negotiates to enter an alternate mode on booting up. This commit: 1. Adds a common DPM function to check for all the active alternate modes one at a time, construct the VDM and send the DPM request to exit the mode. 2. Marks thunderbolt mode as inactive in DFP's thunderbolt mode exit function. BUG=b:152235216 BRANCH=None TEST=Tested on volteer: 1. On connecting a DP dongle, able to enter into DP alternate mode on reboot 2. On connecting a Thunderbolt dock, able to enter into Thunderbolt mode on reboot Change-Id: I7da6a4b08cab9abb3446c0dafdc7c9e9378ef00e Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2270877 Tested-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Remove alt mode VDM "sent" statesAbe Levkoy2020-07-131-21/+9
| | | | | | | | | | | | | | | | | | | | | | | | | In alt mode modules, don't change state after constructing a VDM for the PE to send. At that point, the VDM has not been sent, it may never be sent due to message discard, and if it is sent, the AMS may be interrupted. Wait to change state until the DPM notifies the alt mode module of some response or non-response to the sent VDM. By doing this, allow the alt mode modules to react gracefully to a discarded message or interrupted AMS. Otherwise, they would get into an unexpected state and give up on alt mode setup. Reduce flash size by 104 bytes on average (volteer RO: 192; RW: 184). BUG=b:160701588,b:158572770 TEST=Observe DP and TBT setup recover from interrupted VDM sequence TEST=Observe DP still working after power cycle on puff BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I3e556771f603312b1f0f574ce8d6e7884c19cf16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2274644 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* TCPMv2: Don't enter Thunderbolt mode if the port doesn't support itAyushee2020-07-071-2/+3
| | | | | | | | | | | | | | | | This commit checks if the port supports Thunderbolt speed before entering into Thunderbolt alternate mode. BUG=b:160273134 BRANCH=None TEST=Tested on Volteer board with a USB3 DB, Thunderbolt dock enters into USB+DP mode. Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I5c8497eaf20d505d2e863f010a57acc6d455b9b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2277498 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Add Entry flow for Thunderbolt modeAyushee2020-06-301-0/+241
Create a separate module for representing Thunderbolt mode which decides whether and how we can enter into Thunderbolt alternate mode. Modify the Device Policy Manger (usb_pd_dpm.c) to first check if the port partner and cable is a Thunderbolt Compatible. If not, continue the rest of the PD flow undisturbed. BUG=b:148528713 BRANCH=none TEST=1. Attach Thunderbolt dock, DUT should enter Thunderbolt mode 2. Attach Type-C dock, DUT should enter DP mode 3. Attach DP dongle, DUT should enter DP mode Change-Id: I369eb6337144676996c9d94a412eec060eacd273 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2250488 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>