summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/ap_vdm_control
Commit message (Collapse)AuthorAgeFilesLines
* zephyr/test: Update tests to use EC CMD APICaveh Jalali2023-02-161-20/+8
| | | | | | | | | | | | | | | | This refactors the unit tests to use the EC host command API. Calls to the generic host_command_process(...) are replaced with type-checked host command API calls that perform the same operation. BRANCH=none BUG=b:258110734 TEST='./twister -v -T zephyr/test' passes Change-Id: I1b925a04271dd50c3c7c0a3481cd30ba762b1561 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4172828 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* TCPMv2: Gate DP module support on a CONFIGDiana Z2023-02-072-0/+121
| | | | | | | | | | | | | | | | | | | | | | | Add a CONFIG option to gate DP mode support within the embedded controller. By default, turn the DP module off if the AP is controlling the VDMs for mode entry. For modules which do not implement the DP config option, the header now defines stubs for DP specific functions to use. This obsoletes some of the stub functions from older unit tests. BRANCH=None BUG=b:266714542 TEST=on skyrim, compile with DP disabled and observe 3162 bytes saved, run zmake compare-builds -a and util/compare_build.sh -b all, ./twister -T ./zephyr/test passes (note: ECOS compare builds needed all assert statements removed to pass, as they grab the line number, zephyr compare builds passed before HC mode entry was revamped) Change-Id: I9619eb5d34e418f1972c4bf16d4cf9c8d551eac5 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4201454 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr/test: Fix TYPEC_VDM_RESPONSE paramstabilize-15329.59.B-mainstabilize-15329.44.B-mainrelease-R111-15329.B-mainCaveh Jalali2023-01-261-1/+1
| | | | | | | | | | | | | | | | The EC_CMD_TYPEC_VDM_RESPONSE host command takes a 'struct ec_params_typec_vdm_response' as input, not 'struct ec_params_typec_status'. These structs are identical, so no functional change is introduced. BRANCH=none BUG=b:258110734,b:208884535 TEST='./twister -v -T zephyr/test' passes Change-Id: I583ed1b24eadf7cd3e4c751346337525342d4327 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4195665 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* TCPMv2: Clear DPM state on disconnectDiana Z2023-01-251-0/+61
| | | | | | | | | | | | | | When a partner disconnects, clear the DPM state so stale data from it won't be presented to the AP. BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test Change-Id: Idf800b6c5c223e67c72c2124fb111fad27ce6361 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4179363 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Test: Add test for VDM:Attention deliveryDiana Z2023-01-251-0/+247
| | | | | | | | | | | | | | Add unit tests to ensure we deliver VDM:Attention properly up to the AP with messages in the correct order. BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test Change-Id: I922b391e6d2fb9c969063be2b8d2e492fe8e74b3 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4171492 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Rearrange VDM response HC contentsDiana Z2023-01-251-13/+9
| | | | | | | | | | | | | | | | | | The AP would like to consume VDM:Attention packets in the same host command as the VDM responses. To support this, pull the previous return error into a response structure field instead. Also correct an incorrect struct for the VDM response test utility (though it is functionally equivalent to the TYPEC_STATUS struct). BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test Change-Id: I5d976dda6be40b72de15e84f4bbd9311d908a904 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4171489 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Test: Correct SVDM versions in AP VDM testDiana Z2023-01-191-13/+26
| | | | | | | | | | | | | | | Correct the SVDM versions which our VDMs use in this test. Since the port partner is PD 3.0, they should be using SVDM version 2.0. BRANCH=None BUG=None TEST=./zephyr -T ./zephyr/test Change-Id: I9643816be0aa3b673a57abc5a8154b0f15b18059 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4179362 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Zephyr test: Add tests for AP VDM repliesDiana Z2022-12-131-3/+188
| | | | | | | | | | | | | | | | | | | Add tests verifying we get the expected results for both ACK and NAK commands, as well as some error conditions. This also corrects a logical error in the previous tests for the VDM_REQ host command, which had not correctly verified the message passed through. BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I763d0270c7a38b92948ce1b0c2c7fc0dafb07150 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4048914 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr/test: Sort header filesJeremy Bettis2022-11-151-6/+7
| | | | | | | | | | | | | | | | | | | Sort all headers in zephyr/test with the clang-format rules used by the zephyr project. BRANCH=None BUG=b:247100970 TEST=CQ Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I2428eea11e18ee4bed6bc366fd69d4254d936c10 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022253 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Test: Add test for VDM REQ commandDiana Z2022-10-281-3/+237
| | | | | | | | | | | | | | | Add a test to exercise the parameter checking and message send from the VDM REQ command. BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I1cb1d2dbc8d04b7826b4981e8120b44f11b697f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3969860 Reviewed-by: Aaron Massey <aaronmassey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Zephyr test: Add test for AP-driven VDMsDiana Z2022-10-173-0/+52
Add a starter test for this feature. Note that the feature only currently reports its feature flag to the AP, so start the test out by verifying this flag is set. BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iec6a6e3559fdd042d38bb3f80fae32e43321c60f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953482 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>