summaryrefslogtreecommitdiff
path: root/zephyr/test
Commit message (Collapse)AuthorAgeFilesLines
* Zephyr test: Add HPD GPIO to DP alt mode testDiana Z2023-02-235-2/+151
| | | | | | | | | | | | | | Add the HPD GPIO configuration to the DP alt mode tests so the module can test for HPD to be set and cleared. BRANCH=None BUG=b:170372521,b:159856063 TEST=./twister -T ./zephyr/test Change-Id: I344631c7548ee70914c2ab434216aac73a3fad4c Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4283688 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* zephyr/test/skyrim: Kconfig cleanupRobert Zieba2023-02-221-3/+0
| | | | | | | | | | | | | Cleanup unneeded default values. BRANCH=none BUG=b:247151116 TEST=Ran skyrim tests Change-Id: I2d99543db54f0b96deab54b9e0cb1325dd8863b1 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4263561 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr/test/skyrim: Finish general refactorRobert Zieba2023-02-2213-2/+21
| | | | | | | | | | | | | Finish general refactor by moving remaining variant-specific code. BRANCH=none BUG=b:247151116 TEST=Ran skyrim tests Change-Id: I8c7f1c612292e96a66daf0df08e968c39293b168 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4263560 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr/test/skyrim: Refactor USB mux config testRobert Zieba2023-02-227-13/+42
| | | | | | | | | | | | | | Move USB mux config test to match new code structure. Add fake functions to allow frostflow test to compile pending implementation of full test. BRANCH=none BUG=b:247151116 TEST=Ran skyrim tests Change-Id: I63d62b9957846dd761c83db9f58f9900f722be45 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4263559 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr/test/skyrim: Refactor fan testRobert Zieba2023-02-224-5/+11
| | | | | | | | | | | | | | Move fan test to match new code structure. BRANCH=none BUG=b:247151116 TEST=Ran skyrim tests Change-Id: I0d243d0836b62526f73f89bce35d72e672833c27 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4263558 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr/test/skyrim: Refactor alt charger testsRobert Zieba2023-02-224-5/+11
| | | | | | | | | | | | | | Refactor alt charger tests to match new code structure. BRANCH=none BUG=b:247151116 TEST=Ran skyrim tests Change-Id: I18b6c4bd01c6451172d8bceb66e1ade73a87634b Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4263557 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr/test/skyrim: Refactor ppc_config testsRobert Zieba2023-02-227-15/+24
| | | | | | | | | | | | | | Move ppc_config tests to match new code structure. BRANCH=none BUG=b:247151116 TEST=Ran skyrim tests Change-Id: If6237b909a92b775006b9125eccf1b3c0bd341ee Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4263556 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr/test/skyrim: Refactor baseboard codeRobert Zieba2023-02-223-1/+6
| | | | | | | | | | | | | | Move baseboard pd tests to match new code structure. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: I180b2681db3b526966dd9e16020dfe77b998c488 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4263555 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr/test/skyrim: Refactor common codeRobert Zieba2023-02-223-1/+8
| | | | | | | | | | | | | | Move common code as the first step of a larger refactor. BRANCH=none BUG=b:247151116 TEST=Ran skyrim tests Change-Id: Ic527a71629d899e3f46463898373ded7314d9867 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4263554 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* mt8186,mt8188: force turning off PMIC at S3S5Eric Yilun Lin2023-02-221-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL ensures that before going to S5, the PMIC has turned off the power source to AP, and we can move SHUTDOWN_COMPLETE to S3S5. It did this by asserting EC_PMIC_EN_ODL at S3S5. For pressing button shutdown, the flow becomes: S0 -> hold powerkey 8 seconds -> S3 -> S3S5 -> hold EC_PMIC_EN_ODL for 8 seconds -> S5 -> G3 For the other shutdowns: S0 -> S3S5 -> hold EC_PMIC_EN_ODL for 8 seconds -> S5 -> G3 Also, the AP won't boot when it's turning off the PMIC (S3S5) until it goes to S5. BUG=b:242012415 b:267268982 TEST=On Steelix, Tentacruel and Geralt: * Cold reset: $ dut-control cold_reset:on sleep:0.2 cold_reset:off Result: G3 -> S0 * Long power press to shutdown: $ dut-control dut-control power_key:8.2 Result: S0 -> S5 -> G3 * Long power press to power-on but then shutdown: $ dut-control dut-control power_key:9.2 Result: G3 -> S0 -> S5 -> G3 * Short power press to power-on: $ dut-control dut-control power_key:tab Result: G3 -> S0 * Console command: apreset Result: S0 -> S0, AP reboots * Console command: apshutdown Result: S0 -> S5 -> G3 * Lid open to power-on: $ dut-control lid_open:no sleep:0.2 lid_open:yes Result: G3 -> S0 * AP console: reboots Reulst: S0 -> S0 * AP console: poweroff Reulst: S0 -> G3 * Short power press to power-on: $ dut-control dut-control power_key:tab Result: G3 -> S0 BRANCH=none Change-Id: Iacaa3dbcdafd61b2f3371e2ba376ebdcf29659ff Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4269797 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com>
* Remove CONFIG_HOST_EVENT64Tim Van Patten2023-02-211-4/+0
| | | | | | | | | | | | | | | | | | | The config option CONFIG_HOST_EVENT64 has been unconditionally enabled since 2017. This CL removes the option entirely, to clarify that 64 bit host event support is enabled by default. BRANCH=none BUG=b:261141172 TEST=Manually build and flash, verify device boots TEST=ectool version Change-Id: I806c12b8e69955dd19d32ad96587050fd189bea4 Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4255275 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Rob Barnes <robbarnes@google.com>
* zephyr/test: Add AMD STB dumping testRobert Zieba2023-02-166-0/+120
| | | | | | | | | | | | | | Add `amd.stb_dump` test. BRANCH=none BUG=b:246770811 TEST=Ran test Change-Id: I44b3afd2003b0792bc17cbcdfe31be1f6f4fd6a9 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4233498 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* system_safe_mode: Use common method for identifying critical tasksRob Barnes2023-02-161-0/+1
| | | | | | | | | | | | | | | | | | | Legacy EC uses tasks, Zephyr uses threads, so separate methods were used to identify critical tasks/threads. This change switches Zephyr EC to use task ids to identify critical tasks. This allows some duplicate code to be removed and avoids the CONFIG_THREAD_MONITOR dependency. This relies on the tasks shim for mapping between task ids and thread ids. BUG=b:266696987 BRANCH=None TEST=Observe threads being disabled when safe mode runs Change-Id: I87bcb7de87b0575cfc5d90bd12b21314ddeea093 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214562 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr/test: Update tests to use EC CMD APICaveh Jalali2023-02-1653-815/+385
| | | | | | | | | | | | | | | | 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>
* tasks: Add task_id_to_thread_id and thread_id_to_task_idRob Barnes2023-02-154-5/+120
| | | | | | | | | | | | | | | | | | | Add thread_id_to_task_id and thread_id_to_task_id for mapping between Zephyer thread ids and EC task ids. This change allows for looking up threads without the need of CONFIG_THREAD_MONITOR which costs ~1.5KB of additional flash. Add new tests for checking the mapping between tasks and threads. BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: I9c7ef4d14248bfac5aede9f14adc302342fbe9a6 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214561 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: test: Test 'flashread' console commandTristan Honscheid2023-02-151-0/+42
| | | | | | | | | | | | | | Test the operation, edge cases, and output formatting of the `flashread` console command BUG=None BRANCH=None TEST=./twister -s drivers/drivers.flash Change-Id: Ic572b4a34ebbe0436142b1214449944175af29f3 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4224879 Reviewed-by: Tomasz Michalec <tmichalec@google.com>
* zephyr: test: Test 'flashwrite' console commandTristan Honscheid2023-02-151-0/+47
| | | | | | | | | | | | | Test operation and various edge conditions of `flashwrite`. BUG=None BRANCH=None TEST=./twister -v -i -c -s drivers/drivers.flash Change-Id: I02e90d020719b96c88c0a5b8ff1cb9bb83e853ca Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4224878 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* tasks: Add extra MAIN task idRob Barnes2023-02-152-9/+9
| | | | | | | | | | | | | | | | | | Add TASK_ID_MAIN as a non-shimmed extra task. This task is only present when CONFIG_TASK_HOSTCMD_THREAD_DEDICATED is enabled. Add get_hostcmd_thread and get_main_thread helper methods. The hostcmd thread will be the same as the main thread when CONFIG_TASK_HOSTCMD_THREAD_MAIN is enabled. BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: If61dca427686a9c3cf6fb05dc5ca4e5a87b47127 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214560 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* tasks: Add local get_syswork_thread methodRob Barnes2023-02-151-0/+2
| | | | | | | | | | | | | | | Add local get_sysworkq_thread method. Also add HAS_TASK_SYSWORKQ. This just cleansup the handling of the syswork task id. BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: Ic665d33aa524edd5ab9902e5591bfa4b1a5263b0 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214558 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* tasks: Add extra IDLE task idRob Barnes2023-02-151-0/+5
| | | | | | | | | | | | | Add the idle task to the non-shimmed extra tasks list. BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: I87cbbcd32777ab65de09c053a9098031f0950c3e Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214557 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr/test: Add extra_tasks testRob Barnes2023-02-154-4/+74
| | | | | | | | | | | | | | | | | Add a new extra_tasks test case. Instead of defining new test tasks, this case checks that the default extra tasks are created. The test fixtures are pretty bare at the moment. More tests will be filled when more functionality is added to shim/tasks.c BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: I2cbd38a37770bec35aeb55da5c2ac279e0e2c09e Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4252003 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: test: Test 'flasherase' console commandTristan Honscheid2023-02-142-17/+114
| | | | | | | | | | | | | | Test the operation of the `flasherase` console command and various edge cases BUG=None BRANCH=None TEST=./twister -v -i -c -s drivers/drivers.flash Change-Id: If81b82c5879e178c4d34c111eef61feed9be0904 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4224877 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* shim/panic: Fix CODE_UNREACHABLE when running testRob Barnes2023-02-141-0/+1
| | | | | | | | | | | | | | | | | | CODE_UNREACHABLE inisde k_sys_fatal_error_handler is disabled during tests. This was disabled because system_safe_mode needs to test returning from k_sys_fatal_error_handler. However this change will mask asserts in some cases. Switch to __ASSERT_UNREACHABLE which can be disabled on a per test basis. BUG=None BRANCH=None TEST=Unit tests Change-Id: I32e20a5358d85d059985c0cdf4a65ce37e454a80 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4246960 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Jeremy Bettis <jbettis@chromium.org>
* system_safe_mode: Publish EC_HOST_EVENT_PANIC when safe mode startsRob Barnes2023-02-141-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Publish EC_HOST_EVENT_PANIC when safe mode starts. The event is published from a deferred function since publishing events from an ISR is not compatible with some systems. The kernel may use this event to clean up before the system is reset (e.g. sync the drive). This will be a no-op if the kernel doesn't handle it. This is a refactor of CL:4063818, which was reverted in CL:4225911. The original implementation triggered the event in the panic handler. This version triggers the event after safe mode starts. Since the system reboots immediately when safe mode isn't started, triggering the event outside of safe mode doesn't have any effect. BUG=b:258195448 BRANCH=None TEST=Observe event in kernel. Pass system_safe_mode unit test. Change-Id: I62c48590029bf2bf8f1e0bb7271f29499a8a28d7 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4226407 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: Fix YAML files to conform with upstream styleTristan Honscheid2023-02-141-2/+5
| | | | | | | | | | | | | | | | | cl:4177231 enabled YAML file linting for platform/ec/zephyr files based on upstream Zephyr's style but several of our YAML files do not currently conform. This CL has all the required corrections when running the linter on every YAML file. BUG=None TEST=util/zephyr_check_compliance.py modified to scan everything BRANCH=None Change-Id: I9dcf1d7f0c306028e4d6b368f20e88c882514169 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4247159 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: test: Update RTC driver testSam Hurst2023-02-111-2/+15
| | | | | | | | | | | | | | | | Update RTC driver test to compensate for the additional second added alarm time returned by system_get_rtc_sec(). BUG=b:261377404 BRANCH=None. TEST=twister -T zephyr/test/drivers Change-Id: I7bca42195bdbb066d214173972bc777960609641 Signed-off-by: Sam Hurst <shurst@.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4241078 Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Sam Hurst <shurst@google.com> Commit-Queue: Sam Hurst <shurst@google.com>
* zephyr/test: Unset CONFIG_ASSERT_TEST for driver testsRob Barnes2023-02-101-1/+3
| | | | | | | | | | | | | | | Unset CONFIG_ASSERT_TEST for driver tests. This flag will mask assert failures in tests. BUG=b:268638354 BRANCH=None TEST=Pass driver unit tests Change-Id: I2dff6e78fe62a9fce01b2079055008925de64203 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240495 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr/test: Move console_cmd_crash to separate testRob Barnes2023-02-106-1/+19
| | | | | | | | | | | | | | | | The console_cmd_crash test needs CONFIG_ASSERT_TEST set. Moving console_cmd_crash to be stand alone under drivers so this flag is not polluting any other tests. BUG=b:268638354 BRANCH=None TEST=Pass driver unit tests Change-Id: I5ee5de583b61c77cc483d41dc32c5a4eb0bf9585 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240330 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* tasks: Return TASK_ID_INVALID on errorRob Barnes2023-02-102-3/+18
| | | | | | | | | | | | | | | | | | Return `TASK_ID_INVALID` when `task_get_current` fails to find the current task instead of 0. 0 is a valid task id. `drivers.host_cmd_thread` test is also updated because it was dependent on this bug. By overriding `in_host_command_main` to return true when the fake main thread is running, `task_get_current` will return `TASK_ID_HOSTCMD` when the fake main thread is running. BUG=b:268477571 BRANCH=None TEST=Unit tests Change-Id: I2d5d6926cc9e2775a1c0e8141d760850bf25141b Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240327 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* Frostflow : PS8811 initial setting.Logan_liao2023-02-101-5/+5
| | | | | | | | | | | | | | | | | | Base on the Parade FAE, modify the PS8811 setting for 10G RX test. LOW_COVERAGE_REASON=test PS8811 retimer setting valid, use b/267711586 to tracking test. BUG=b:263458745 BRANCH=none TEST=local build for HW test 10G RX pass. Change-Id: I356eb04706866e3ededc493f8aa41c41af3f5a37 Signed-off-by: Logan_liao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199248 Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Chao Gui <chaogui@google.com> Commit-Queue: Chao Gui <chaogui@google.com>
* zephyr/test/skyrim: Add alt charger testRobert Zieba2023-02-095-0/+92
| | | | | | | | | | | | | Add alt charger test for crystaldrift and skyrim. BRANCH=none BUG=b:247151116 TEST=Ran tests and verified coverage results Change-Id: Ic186d18a2ceaf65f077ca997bc4f9e86f9901766 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4233934 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: move usbc interrupt handler to shimJason Yuan2023-02-0910-16/+98
| | | | | | | | | | | | | | | | | | | TCPC interrupt no longer uses gpio-int. Instead the shim tcpc completely handles its own interrupt. An optional config is added to allow projects to use the legacy tcpc interrupt. The program intelrvp is excluded from this CL. BUG=b:254148652 TEST=twister, usbc charging on villager, lazor, and xivu BRANCH=none Change-Id: Ieeb4fb61ca6cf8f44df212a6cf520d265cff5147 Signed-off-by: Jason Yuan <jasonyuan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4108942 Commit-Queue: zhi cheng yuan <jasonyuan@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Diana Z <dzigterman@chromium.org>
* zephyr/test/skyrim: Add fan testRobert Zieba2023-02-096-0/+144
| | | | | | | | | | | | | | Add fan test and enable test for skyrim, crystaldrift and markarth variants. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: I7d11d28c1a864b24e06a1464160662f994509adf Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4225008 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* TCPMv2: Obsolete AMODE commandsDiana Z2023-02-076-149/+28
| | | | | | | | | | | | | | | The AMODE host commands were created to support GFU mode, which we do not support in TCPMv2. Move these host commands to a TCPMv1 only file and remove references to them from the unit tests. BRANCH=None BUG=b:267562375 TEST=./twister -T ./zephyr/test Change-Id: I7bafcd8eded1f8eca4082560172aee91ebd7ff24 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4221975 Reviewed-by: Abe Levkoy <alevkoy@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/skyrim: Add variant specific logsRobert Zieba2023-02-075-1/+18
| | | | | | | | | | | | | | | Register crystaldrift, markarth, and skyrim logs to match what the board code does. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: If92ce6e8e01a160ab75056952f23f69a3079022b Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4225007 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* raa489000: never report ACOK when sourcing VBUSPeter Marheine2023-02-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | This chip sometimes ACOK when sourcing VBUS because the ACOK status bit actually indicates whether VBUS is above approximately 3.6V and the charger is not overcurrent or over-temperature, though it also seems to report ACOK correctly when the port comes up as a source rather than going through a PRS. This change makes raa489000_is_acok return a correct value (not-OK) in all situations when sourcing VBUS. BUG=b:263691951,b:262663436 TEST=On Nivviks, `hibernate` now correctly hibernates following fast role swap from sink to source on port C0 (with C1 disconnected), where previously it refused to hibernate with the "AC on, skip hibernate" message. BRANCH=nissa Change-Id: I314988d7dfcc8b4d576224f934cd5dc693e7f54f Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4222772 Reviewed-by: Adam Mills <adamjmills@google.com> Reviewed-by: Arthur Lin <arthur.lin@lcfc.corp-partner.google.com>
* Revert "panic: Publish EC_HOST_EVENT_PANIC on panic"Rob Barnes2023-02-065-78/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 98e00bb45940f1cf31216a20c7441364d43fd8fb. Reason for revert: On MKBP based boards, host_set_single_event will result in a mutex lock, which will fail when inside the panic ISR. See b/267681436. Original change's description: > panic: Publish EC_HOST_EVENT_PANIC on panic > > Publish EC_HOST_EVENT_PANIC when a panic occurs. > > The kernel may use this event to clean up before the system is reset > (e.g. sync the drive). > > This will be a no-op if the kernel doesn't handle it. > > BUG=b:258195448 > BRANCH=None > TEST=Observe event in kernel. Pass panic_event unit test. > > Change-Id: I34b9847778bf17dd113e81158bbbdf999ad2ca33 > Signed-off-by: Rob Barnes <robbarnes@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4063818 > Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> > Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Bug: b:258195448 Change-Id: I772ef77ec7e4661f1c98658b94e73941ad74d4f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4225911 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Ricardo Quesada <ricardoq@chromium.org> Commit-Queue: Rob Barnes <robbarnes@google.com> Auto-Submit: Rob Barnes <robbarnes@google.com>
* zephyr/test/ec_app: Add test for `PLATFORM_EC_BOOT_NO_SLEEP`Robert Zieba2023-02-023-0/+32
| | | | | | | | | | | | | Add test for `PLATFORM_EC_BOOT_NO_SLEEP`. BRANCH=none BUG=b:266968315 TEST=./twister -T zephyr/test/ec_app Change-Id: I7968d5a050772293382a2d6c09cd6239e8dbfa37 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4211269 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr/test/skyrim: Add usb mux config testsRobert Zieba2023-02-024-0/+76
| | | | | | | | | | | | | | | Add usb mux config tests for frostflow variant. Other variants require more emulator support which will be added later. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: I532aa8f24242a3756faf6374abcd4b7b3720db58 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4148777 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr/test/skyrim: Add PPC config testsRobert Zieba2023-02-026-1/+162
| | | | | | | | | | | | | Add PPC config tests for skyrim variants. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: Iaac4a930e2aa111452f284272ba6ef1d08d315e2 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4148776 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: test: Unmask Accept message after PRS testAbe Levkoy2023-02-011-0/+3
| | | | | | | | | | | | | | | | After changing how the partner handles Accept for a Power Role Swap test, restore the default behavior. Avoid disturbing future tests that depend on the partner receiving Accept. BUG=b:267369382 TEST=twister -s zephyr/test/drivers/drivers.default (with DRS test) BRANCH=none Change-Id: I5ed3eee62889f321d1350f3f2ee763d1b5f0f781 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4211270 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Commit-Queue: Al Semjonovs <asemjonovs@google.com>
* zephyr/test/skyrim: Add baseboard USB PD testsRobert Zieba2023-01-315-0/+308
| | | | | | | | | | | | | Add baseboard USB PD tests. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: Ie6e5ac2b6caa93e3d0f166c4d957ee96973e0c2d Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4148775 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr/test: Add initial skyrim test frameworkRobert Zieba2023-01-3111-0/+169
| | | | | | | | | | | | | Add the initial file structure for skyrim board tests. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: Ie557b9184f81b095e3840bec7ab1c976742e3525 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4148773 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: emul: update EMUL_DT_INST_DEFINE API usageFabio Baltieri2023-01-271-1/+1
| | | | | | | | | | | | | | | | | Update various instances of the EMUL_DT_INST_DEFINE to set the extra argument introduced in: 6062914cf2 emul: Add support for backend APIs BRANCH=none BUG=none TEST=./twister Cq-Depend: chromium:4200298 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I2bcec5786e78840fd552dcbde1b50f6941a23f05 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4188744 Reviewed-by: Keith Short <keithshort@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-252-14/+10
| | | | | | | | | | | | | | | | | | 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>
* herobrine: Delay enabling 5V if battery is disconnectedYu-An Chen2023-01-241-2/+37
| | | | | | | | | | | | | | | | Wait negotiated VBUS transition before enabling 5V rail when battery is disconnected BUG=b:260192201 BRANCH=none TEST=zmake build evoker TEST=./twister -T zephyr/test/herobrine Change-Id: Ieebd10ea32b26e9f1f3f3e438351ba519ae1b337 Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4123671 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>