summaryrefslogtreecommitdiff
path: root/test/usb_tcpmv2_compliance_common.c
Commit message (Collapse)AuthorAgeFilesLines
* TCPM: Rename enum tcpm_sop_type and its constantsAbe Levkoy2021-08-311-36/+36
| | | | | | | | | | | | | | | 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: Remove enum pd_msg_typeAbe Levkoy2021-08-181-18/+18
| | | | | | | | | | | | | Convert usages of this enum to tcpm_sop_type. BUG=b:155476419 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I5fed273d72e7ad0e191db0cb0d121b70bdd9ecdb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3104291 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Compliance Unit Test - allow PROC.PD.E3 flexibilityDenis Brockus2021-03-191-50/+121
| | | | | | | | | | | | | | | | | Allow the startup messages to be optional and don't require a specific ordering. Also add PR_Swap when PD_ROLE_UFP. BUG=none BRANCH=none TEST=make run-usb_tcpmv2_compliance Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ifef6fa558a789c2ce34a9f9fbf38529dc90d5e6f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774580 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* tcpmv2: Only issue SOP' soft reset following PR swapKeith Short2021-02-161-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | Entry to the PE_SNK_Startup and PE_SRC_Startup states resets the protocol layer, and clears the message IDs for all SOP types. These states are entered during initial connect, hard reset, and after a power role swap. The cable should automatically clear it's message IDs on the initial connect (because it didn't have power) and on a hard reset, so modify the PE policy to only send SOP' soft reset after power role swaps. BUG=b:179325862 BRANCH=volteer TEST=Connect TBT loopback device, verify no SOP' soft reset is sent and that TBT entry is successful. TEST=Connect USB+DP monitor when EC starts as SRC/DFP and VCONN source. Verify EC sends SOP' soft reset is sent after power role swap. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I2c133eec0e76c1ecb7b79cea94a541fdb55ee9c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2691423 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Process DPMs before discoveryDiana Z2021-01-141-16/+16
| | | | | | | | | | | | | | | | | | | | | | Some devices may reply to discovery differently if they're not yet being offered sufficient current. Process DPM requests before running discovery in order to get these devices into the best state for discovery probing. This also moves the cable soft reset DPM request up to the common DPM request function. Otherwise, it will be considered an unhandled request and dropped before attempting discovery. BRANCH=volteer BUG=b:177303467,b:177001425 TEST=verify we can reliably receive DiscoverSVIDs ACK from LaCie SSD Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I0917476c2aeb0cb9551edde3df14ddd1fd47fcab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2627805 Tested-by: Utkarsh H Patel <utkarsh.h.patel@intel.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* tcpmv2: always issue SOP' soft resetKeith Short2021-01-091-1/+8
| | | | | | | | | | | | | | | | | | | After entering a PD contract, always issue an SOP' soft reset before sending any discovery VDMs to the cable. BUG=b:172364575 BRANCH=volteer TEST=connect monitor with emarked cable, verify SOP' soft reset is sent when EC starts as SNK/DFP. TEST=Connect monitor with non-emark cable. Verify SOP' soft reset is sent once regardless of starting role. TEST=Connect USB4 dock, verify USB4 entry. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Id5026a2c8c9877b860e1356dd33763bad3e51841 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2596838 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Compliance Unit Test - cleanup mock_tcpci_tx_msg_id_resetDenis Brockus2021-01-081-10/+10
| | | | | | | | | | | | | | | | | nit request to rename mock_tcpci_tx_msg_id_reset to be partner_tx_msg_id_reset BUG=none BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I0bb2bf7937e9c6f858697a1ecd835337652cb29b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2615626 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* TCPMv2: Compliance Unit Test - make tx msg id per sop typeDenis Brockus2021-01-071-5/+12
| | | | | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I9de64e1921029ec4bb5e09ae3aa2c07bf39c692b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2613725 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* Move tcpic.h header into include/driverSimon Glass2021-01-071-1/+1
| | | | | | | | | | | | | | | | | | This header cannot currently be accessed by Zephyr since it is in a driver directory, not an include directory. This header has quite a bit of public stuff in it, so it seems reasonable to consider everything public. Move the header file and update all users. BUG=b:175434113 BRANCH=none TEST=make buildall -j30 build volteer on zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ibba37f47a06783fafb5095f853f2a68d92b6df87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2607745
* TCPMv2: Compliance Unit Test - PROC.PD.E1 generalizationDenis Brockus2020-12-301-61/+70
| | | | | | | | | | | | | | | | | Allow caller to control the first part of attach and the already attached portion of the code. BUG=none BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I52419f41501c5d828bbc4a14a5a7b9d89e17f17f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2606565 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* TCPMv2: Compliance Unit Test - cleanup common codeDenis Brockus2020-12-291-78/+147
| | | | | | | | | | | | | | | | | | | PROC.PD.E1 and PROC.PD.E3 used common code that was also peppered through out some of the tests. Make a common copy that they can all use. BUG=b:176249915 BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I82505fa8ac61db2ee941f2a236a22bdf3e69ae2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2604562 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Unit Test TD.PD.SNK3.E12Edward Hill2020-12-171-3/+4
| | | | | | | | | | | | | | | | | | Add PD compliance test TD.PD.SNK3.E12.Soft_Reset sent regardless of Rp value. As Provider (DFP), the Tester forces the UUT to send Soft_Reset and verifies Soft_Reset is sent regardless even though the Rp value is SinkTxNG. BUG=b:161835483 BRANCH=none TEST=make run-usb_tcpmv2_compliance Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I13bc474e361cb385dbda58c5142fdd36a9974c45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2595543 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Unit Test TD.PD.SRC3.E26Edward Hill2020-12-171-1/+51
| | | | | | | | | | | | | | | | | | Add PD compliance test TD.PD.SRC3.E26.Soft_Reset sent regardless of Rp value. As Consumer (UFP), the Tester forces the UUT to send Soft_Reset and verifies Soft_Reset is sent regardless of the Rp value is SinkTxOK or SinkTxNG. BUG=b:161835483 BRANCH=none TEST=make run-usb_tcpmv2_compliance Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I2bdd61abad611edc41400f6b96d65bd840e70e6e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2595539 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Unit Test TD.PD.LL.E3 Soft Reset UsageDenis Brockus2020-12-171-0/+289
BUG=b:175144677 BRANCH=none TEST=make run-usb_tcpmv2_compliance Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I629e2811b2cba5aa9821d8c855e039a6cfaa32ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2595816 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>