summaryrefslogtreecommitdiff
path: root/test/usb_tcpmv2_tcpci.c
Commit message (Collapse)AuthorAgeFilesLines
* TCPMv2: Remove test/usb_tcpmv2_tcpci.cEdward Hill2020-12-181-405/+0
| | | | | | | | | | | | | | Remove test/usb_tcpmv2_tcpci.c to avoid duplication with test/usb_tcpmv2_compliance.c BUG=none BRANCH=none TEST=make run-usb_tcpmv2_compliance Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Ie62d0f7e2cc30c3086e03103a43dede5515006b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597598 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* TCPMv2 test: Check all transmitsEdward Hill2020-12-171-2/+3
| | | | | | | | | | | | | | | | | Be explicit about checking all transmitted messages to avoid getting out of sync. Fix retries check in TD.PD.LL.E3, retries are handled by TCPC. BUG=b:175144677 BRANCH=none TEST=make run-usb_tcpmv2_compliance Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I017244c669e0c50e49b8974a7462007625c354ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597597 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* task_set_event: remove the wait argumentDawid Niedzwiecki2020-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | There is an option in the task_set_event function which force the calling task to wait for an event. However, the option is never used thus remove it. This also will help in the Zephyr migration process. BUG=b:172360521 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* TCPMv2: Always probe sink capsDiana Z2020-11-201-0/+12
| | | | | | | | | | | | | | | | | | | | | This commit adds the ability to always probe the partner for sink capabilities, and re-names the state to reflect that sources may use it now too. This also fixes some issues in the state to get sink capabilities, including correcting the message detection and soft resetting with the SOP* of the unexpected message. This also updates the unit tests to expect a Get_Sink_Caps message as a part of typical startup. BRANCH=None BUG=b:168862110,b:160009733 TEST=on drawcia, observe sink caps are requested from source and sink partners Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I5da3adc17ccec71f6cad9e8f152b9570ec99691d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2540389 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Add DPM_REQUEST_GET_SRC_CAPDenis Brockus2020-09-021-4/+27
| | | | | | | | | | | | | | | | | | | | | As a SRC that runs on battery it can be handy to determine if the connected partner has unconstrained power available so we can try to PR_Swap to let them power us. This only requests the information, if it is not already available, and leaves it to other code to determine if the swap is a good idea. BUG=b:166446426 BRANCH=none TEST=connect a sink device and determine it performed the action Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: If45801a33df8b75e541989d7ee8f36ed316ffcc6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2381408 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* test: Soft_Reset sent regardless of Rp valueEdward Hill2020-08-121-3/+44
| | | | | | | | | | | | | | | Add test for TD.PD.SRC3.E26.Soft_Reset sent regardless of Rp value. BUG=b:161835483 BRANCH=none TEST=make -j run-usb_tcpmv2_tcpci Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I972bffcb1c7a330aef4ebdff98fcd33af9a667be Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2340486 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* tcpmc2: fix TD.PD.LL3.E2 Retransmission testJett Rink2020-08-061-10/+84
| | | | | | | | | | | | | | | | | | | | | | | We are retrying in both the TCPC hardware (4 total) and in the Protocol layer (3 total) when we do not get a GoodCRC back from the port partner. We are only suppose to retry up to nRetryCount times which is 2. This means we should be sending 3 total replies. Also correct a misinterpretation of the spec around SOP' and SOP" retries. We were not retrying those packets, but we should be retry them as the SOP. The SOP' device will not retry, but we (as the SOP) should retry packet that we are sending to them. The TCPM is not fast enough to meet the timing for tRetry (195 usec), so we need to perform the retries in the TCPC hardware layer. BRANCH=none BUG=b:150617035 TEST=Verify passing compliance test with GRL-C2 on Trembyle Change-Id: I55c4ab2f5ce8f64acf21af943862d96d9088622d Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2248960
* test: Add PD TX and RX to usb_tcpmv2_tcpciEdward Hill2020-08-051-2/+99
| | | | | | | | | | | | | BUG=b:162369240 BRANCH=none TEST=make -j run-usb_tcpmv2_tcpci Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I61a9f99a10c3432135a91699ac04ff65690388e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335455 Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* tcpmv2: Add usb_tcpmv2_tcpci testEdward Hill2020-07-151-0/+157
Add a new test that runs a full set of TCPMv2 layers and state machines, talking to a simulated TCPC via I2C. Initial test cases: 1) Plug in a non-PD power supply -> we connect as sink. 2) AP S5 > S3 > S0 -> auto-toggle + low power. BUG=b:161167893 BRANCH=none TEST=make -j run-usb_tcpmv2_tcpci Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: If8b8eb2cca722ed01cbe1d6000fb3e4f4b70149c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2283911 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>