summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* battery: extend BATTERY_GET_STATIC hostcmd for 32-byte stringsfactory-nissa-15199.B-mainPeter Marheine2023-02-093-32/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Smart Battery Specification defines a string as up to 31 characters, and nissa project has encountered some batteries where the existing 11-character strings for v1 of BATTERY_GET_STATIC are insufficient to differentiate some batteries that can be used on a given device. This change adds a new version of this host command that extends the strings fields to each accommodate up to 31 characters of data, which should be enough to support all smart batteries compliant with the latest version of the specification. BUG=b:263920422 TEST=`ectool battery` with updated ectool works on Nereid and uses the new hostcmd version. If EC support for v2 or v1 is disabled, older command versions are used. BRANCH=nissa Change-Id: Ia6a3a917051d5e641e7d38ef6936ec7174cb8aab Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4150669 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> (cherry picked from commit 19b4b94a0589a15fa40f7694ec79b3136e3219c6) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4173089 Commit-Queue: Clark Chung <ckclark@chromium.org> Tested-by: Clark Chung <ckclark@chromium.org>
* gitlab: Fix a typo in lcov commandJeremy Bettis2022-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | There was a "" that should have been " BRANCH=None BUG=None TEST=None Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I54f056b3798b1ee8eec937a9eab3145bdbeaff52 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3966677 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Aaron Massey <aaronmassey@google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Yuval Peress <peress@google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> (cherry picked from commit a86cbeb75a9079e741a0209eebf47c824ec3fbf9) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3994435 Commit-Queue: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* gitlab: Fix yaml errorJeremy Bettis2022-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | Fix yaml formatting BRANCH=None BUG=None TEST=yaml syntax checker Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I304499f88c7198c28c4f193be04a3e5d6650e123 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965506 Commit-Queue: Yuval Peress <peress@google.com> Reviewed-by: Yuval Peress <peress@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> (cherry picked from commit 7fd787724f592015723e3141eca07604583bf30a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3994434 Commit-Queue: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* dps: limit the minimum operating power when AC onlyWill Tsai2022-10-194-29/+96
| | | | | | | | | | | | | | | | | | | We found that the system will fail to boot without battery if PDO 5V/3A is selected. To prevent boot failed, limit the minimum operating power to the larger PDO when the system is booting up without battery. BUG=b:240533589 TEST=On Joxer, confirm the selected power is equal to 9V when system booting, and the system boot up successfully. TEST=./twister -v -i --coverage -p native_posix -p unit_testing BRANCH=none Signed-off-by: Will Tsai <will_tsai@wistron.corp-partner.google.com> Change-Id: I5d9655b09eead6791c5a3bf161e574f26f6beb02 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3878627 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* gitlab: Align merged_coverage with CQJeremy Bettis2022-10-191-37/+33
| | | | | | | | | | | | | | | | | | | The sed + xargs is overflowing the command line length and xargs is running two commands, therefore overwriting the output. Change commands to match what firmware_builder.py does. BRANCH=None BUG=None TEST=Ran in docker. New all_builds_filtered.info is 44.8% Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Ic608dd6da0fd4932ad238c1f6408f7a6e121f3b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3964535 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Tomasz Michalec <tmichalec@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
* kuldax: Add board_led_auto_controlben chen2022-10-191-0/+10
| | | | | | | | | | | | | | | | | Check power state to change led status while receive the auto contorl command. BUG=b:254018663 BRANCH=none TEST="ectool led power auto" can show correct led behavior immediately. Change-Id: I550e7a85ccda71b07d68a2960681905e5b68f820 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960513 Reviewed-by: Derek Huang <derekhuang@google.com> Reviewed-by: TH Lin <t.h_lin@quanta.corp-partner.google.com> Commit-Queue: Derek Huang <derekhuang@google.com>
* zephyr: reduce priority of shell threadPeter Marheine2022-10-192-11/+1
| | | | | | | | | | | | | | | | | | | | | | | Using EC task priority alone ignores other zephyr threads and tends to give the shell thread higher priority than makes sense; higher priority than motion sensors and power sequencing for instance. Reduce the default shell thread priority to be prioritized after most threads except the work queue and idle tasks. This removes the explicit call to k_thread_priority_set in shell initialization because the EC kconfig defaults already request a custom priority by setting CONFIG_SHELL_THREAD_PRIORITY_OVERRIDE so it is redundant to set the priority again after shell_init(). BUG=b:240485526 TEST=Nereid still works normally (though performance doesn't seem improved) BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I62bf4bc41da78d1d992e3bc0b762eb329fc8ea82 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3944072 Reviewed-by: Yuval Peress <peress@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* winterhold: Update battery parameterLeila Lin2022-10-194-20/+20
| | | | | | | | | | | | | | | | | | Update sunwoda's battery parameter for winterhold. BUG=b:242491702 BRANCH=none TEST=zmake build winterhold LOW_COVERAGE_REASON=Skyrim board tests not created yet: b/247151116 Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com> Change-Id: Ifd27a65c9c11f22543390ca5acaad8b6c2058ed2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960471 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Tested-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Commit-Queue: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com>
* winterhold: modify get vbus voltage the configMatt Wang2022-10-191-1/+5
| | | | | | | | | | | | | | | | | Winterhold chager cannot support get the vbus voltage. So modify the config let get the vbus voltage from TCPC. BUG=b:252974232 BRANCH=none TEST=winterhold ectool usbpdpower can get the vbus voltage LOW_COVERAGE_REASON=Skyrim board tests not created yet: b/247151116 Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I010ab38aba7c2d905b69cb9471007b5321791b94 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3951753 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* tcpc: modify nct38xx and fusb302 get vbus voltage functionMatt Wang2022-10-194-11/+17
| | | | | | | | | | | | | | | | | | Modify nct38xx and fusb3802 get vbus voltage function to use the tcpm_drv API. BUG=b:252974232 BRANCH=none TEST=zmake build skyrim winterhold adlrvp_npcx ass TEST=Winterhold with this function ectool usbpdpower can get the voltage LOW_COVERAGE_REASON=we don't have an NCT emulator yet Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: Iedd7165aad0c471c60f750cc4b207eef609d2eed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3951752 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* moli: update custom fan controlElsie Shih2022-10-191-9/+9
| | | | | | | | | | | | | | Follow "Moli DVT Fan Table_20221018.xlsx" to update thermal table. BUG=b:236294162 BRANCH=none TEST=make BOARD=moli Signed-off-by: Elsie Shih <elsie_shih@wistron.corp-partner.google.com> Change-Id: Ie47b1eddb000b8c32edaee1f005b188ba2346985 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3954785 Reviewed-by: Boris Mittelberg <bmbm@google.com> Tested-by: Scott Chao <scott_chao@wistron.corp-partner.google.com>
* zephyr test: EC_CMD_TYPEC_STATUS invalid paramsAbe Levkoy2022-10-181-0/+17
| | | | | | | | | | | | | | | Verify that invalid parameters to the Type-C status command result in errors. BUG=b:236075106 TEST=twister -s zephyr/test/drivers/drivers.host_cmd BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ifdf0aa41b105a6c36f6df776197055fddd12b5bb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3961321 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* test: add tests for all paths leading to sysrq eventYuval Peress2022-10-182-0/+151
| | | | | | | | | | | | | | | | | Add tests for all the code paths (including error and timeout cases) that lead up to a sysrq event being added to the mkbp fifo. Extend the timeout (due to all the logs of the EC during the sleep calls). BRANCH=none BUG=none TEST=twister Signed-off-by: Yuval Peress <peress@google.com> Change-Id: If5bf0ff6e9eccb7d6547b6ce6722a41f8c1709c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960567 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* hooks: Update rc handling for deferred callsMark Hasemeyer2022-10-181-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old Zephyr workqueue api was deprecated in 2.6, and recenty removed: https://github.com/zephyrproject-rtos/zephyr/pull/46812 The hooks module is using the new api, but the return code handling needs updating. k_work_schedule() replaces k_delayed_work_submit_to_queue(), and its return values are different. In the old api, `-EINVAL` is returned when a "Work item is being processed or has completed its work.": https://docs.zephyrproject.org/2.5.0/reference/kernel/threads/index.html#c.k_delayed_work_submit_to_queue In the new api, a value >= 0 is returned when work has been (or is) properly scheduled: https://docs.zephyrproject.org/3.2.0/kernel/services/threads/workqueue.html#c.k_work_schedule_for_queue Update the return code handling in hook_call_deferred() to correctly process the return values produced by the new workqueue api. BUG=b:251872865 BRANCH=none TEST=`chargen 36 50000` with chromium:3943262 cherry-picked Change-Id: I4511e9bd5a9f50caa3473e78619ab042026970ca Signed-off-by: Mark Hasemeyer <markhas@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3964352 Commit-Queue: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr test: EC_CMD_TYPEC_CONTROL invalid paramsAbe Levkoy2022-10-181-0/+21
| | | | | | | | | | | | | | | | Verify that invalid parameters passed to Type-C control host command produce error results. BUG=b:236075405 TEST=twister -s zephyr/test/drivers/drivers.host_cmd BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I9e9ac49915d7b8db19d2df5b31161156f7abdfd2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3961320 Commit-Queue: Aaron Massey <aaronmassey@google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* cq: Remove unnecessary lcov commandJeremy Bettis2022-10-181-20/+1
| | | | | | | | | | | | | | | | | | There is a lcov command that is merging 2 files that are already combined. Remove it, and change the dependent steps. BRANCH=None BUG=None TEST=Ran before and after and diffed the metrics Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Ifb78cbec97983198baf00077c3bb945ec31f350f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3964534 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* util: crash_analyzer include BIOS versionRicardo Quesada2022-10-181-16/+48
| | | | | | | | | | | | | | | | | This CL adds the BIOS version to the reports generated by crash_analyzer.py. This BIOS information is useful since it includes the version when FW Qual as approved. BUG=None TEST=./crash_analyzer [lite|full] and it generated valid reports. BRANCH=None Change-Id: I647d66ce9af35f7130da8b47498d42fa21d0c7e1 Signed-off-by: ricardoq@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3961147 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* util/build_with_clang: Enable adlrvpp_npcxTom Hughes2022-10-181-1/+1
| | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=adlrvpp_npcx Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ia446e30b71e1a0c3b87bd5cf22f3773d99cd0bcc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953256 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* util/build_with_clang: Enable vellTom Hughes2022-10-181-1/+1
| | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=vell Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I87ec7a3ce4987efb96f64b50ed6af61973881c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953258 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* board/vell: Fix compilation with clangTom Hughes2022-10-181-13/+5
| | | | | | | | | | | | BRANCH=none BUG=b:172020503, b:202062363 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I8131e8a38cea468c1bbe2fbd37d8eba89b6d28b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953257 Reviewed-by: Keith Short <keithshort@chromium.org>
* flash_reg: Add missing LTO propertyYuval Peress2022-10-181-0/+19
| | | | | | | | | | | | | | | | This will eventually be factored out to a common library construct either upstream or in our own extensions.cmake. For now its better to just have it done locally so that when it is extracted we can show all the places that are affected. BRANCH=none BUG=none TEST=zmake build --all Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I30f86f377d796750b9d80ad4013aff93ab050f28 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960903 Reviewed-by: Keith Short <keithshort@chromium.org>
* ec: Fix cros lint warnings, and add new disablesJeremy Bettis2022-10-183-22/+27
| | | | | | | | | | | | | | | | | | Fix all the cros lint warnings in util/config_option_check.py except for too-many-nested-blocks and too-few-public-methods which are really just opinions and have nothing to do with formatting or potential errors. BRANCH=None BUG=None TEST=cros lint util/config_option_check.py Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I443dd7f8fc4906d7eee979c1a9b666babd4e2ad8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957261 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Sam Hurst <shurst@google.com> Commit-Queue: Sam Hurst <shurst@google.com>
* krabby: limit max current to 1.5ATing Shen2022-10-182-4/+2
| | | | | | | | | | | | | | | | | See http://b/249216000#comment13 for detail. BUG=b:249216000 TEST=none BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Id97e9ea70282c27d51a3735b6128d10bc06c5f4f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3935440 Tested-by: Ting Shen <phoenixshen@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Alvis Hsu <alvishsu@google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* kuldax: modify power led color green to whitefactory-corsola-15197.B-mainben chen2022-10-183-20/+20
| | | | | | | | | | | | | | | Supports power led color to white from green type BUG=b:254014264 BRANCH=cros/main TEST="ectool led power white=100" can show correct led color. Change-Id: If55c5f480444933949eeb5bd60f88f658ffb83b5 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960512 Tested-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* test: cleanupYuval Peress2022-10-182-0/+9
| | | | | | | | | | | | | | | | Add missing extern "C" in the test_state header and missing include dependency in vboot_hash.c BRANCH=none BUG=none TEST=twister Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I8bf87e5974bdbcfc6645fc12dcbd778651f23718 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960557 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Tomasz Michalec <tmichalec@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: Fix unittest missing clang linkingYuval Peress2022-10-181-0/+4
| | | | | | | | | | | | | | | | | | | | Add a check for clang toolchain and add missing linker flags to include the llvm gcov library. This technically needs to be done upstream and will be reverted once complete. BRANCH=none BUG=none TEST=./twister -v -i -c -p unit_testing -T common/spi/flash_reg/ \ --coverage -x CMAKE_VERBOSE_MAKEFILE=ON \ -x CMAKE_C_COMPILER=/usr/bin/clang TEST=./twister -v -i -c -p unit_testing -T common/spi/flash_reg/ \ --coverage -x CMAKE_VERBOSE_MAKEFILE=ON \ -x CMAKE_C_COMPILER=/usr/bin/gcc Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I06a495f7208f8e63fcdca9787a64a00d6369d1d0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960902 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* common/button.c: Add tests for failed paths through ACTIVEYuval Peress2022-10-187-11/+149
| | | | | | | | | | | | | | | | | | | Add tests for several failed paths when a simulated recovery button is used. These include: - Pressing the volume up/down buttons for too short of a time - Pressing only one volume button - Transitioning to ACTIVE then timing out BRANCH=none BUG=none TEST=twister -s zephyr/test/drivers/drivers.button Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Ibbeb99985a59be03f48a2d158a77d8edc46153c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960558 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* lisbon: Initial EC imageTommy Chung2022-10-1815-0/+2120
| | | | | | | | | | | | | | | | | | | Create the initial EC image for the lisbon variant by copying the brask reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.5.0). BUG=b:246657849 BRANCH=None TEST=make BOARD=lisbon Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I1b10f39144a035a5877cbdf588c2e7485b8d3db2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3935722 Commit-Queue: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Devin Lu <devin.lu@quantatw.com>
* test: Add panic testTom Hughes2022-10-188-0/+141
| | | | | | | | | | | | | | | | | | | | Add a test for ARM that verifies that exception_panic() correctly preserves the registers we expect it to. BRANCH=none BUG=b:172020503 TEST=./test/run_device_tests.py --board bloonchipper -t panic TEST=make BOARD=discovery-stm32f072 test-panic openocd -c "set BOARD discovery-stm32f072" \ -c "set BUILD_DIR build/discovery-stm32f072/panic" \ -f board/discovery-stm32f072/openocd-flash.cfg screen /dev/ttyUSB1 > runtest Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I592483c922652df8a4fb2b0a0a5fb57b1480b8b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3288761 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* docs: Update Zephyr testing documentationYuval Peress2022-10-173-228/+189
| | | | | | | | | | | | | | | | Update the documentation for testing on Zephyr to reflect the latest tools and features. Removed docs/zephyr/zephyr_testing.md since it was only intended to be used for the fix-it week. BRANCH=none BUG=none TEST=none Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I54cb53af7d051e2ea1c3813f3907773c4e52f83a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3945693 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zmake: add compare-builds optionKeith Short2022-10-174-0/+360
| | | | | | | | | | | | | | | | | | | | Add compare-builds as a sub command to zmake. This sub command performs two separate checkouts of the EC repo and verifies the resulting binaries are unchanged. The zephyr and module repos are checked out at HEAD from the respective repos. Typical usage compares the EC repo at HEAD and HEAD~ zmake compare-builds -a BUG=none BRANCH=none TEST=zmake compare-builds -a TEST=modify skyrim build, verify only skyrim board doesn't compare Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I6ffa0e41bbcb649f4376853a86778baa3b9e62f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957415 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: Add success test for qcom chipset_resetJeremy Bettis2022-10-171-1/+93
| | | | | | | | | | | | | | | | | | A successful test case for warm_reset_seq where the AP responds with a GPIO_AP_RST_L pulse. BRANCH=None BUG=None TEST=./twister Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I9d32d57a921b3ef2461a2a6cd847f0e1cd03caf3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957417 Tested-by: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
* nissa: enable SB type-A power if sub-board is unconfiguredPeter Marheine2022-10-171-2/+9
| | | | | | | | | | | | | | | | | It's safe to enable this output with every sub-board, and it's useful to have functioning type-A USB on the sub-board even if CBI isn't fully configured yet; in particular for factory provisioning. BUG=b:251055188 TEST=SB type-A now works with unprovisioned fw_config BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ia73bb09c37fac0d633d55ec78662fd474431ca1c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3954782 Commit-Queue: Andrew McRae <amcrae@google.com> Reviewed-by: Andrew McRae <amcrae@google.com> Code-Coverage: Andrew McRae <amcrae@google.com>
* driver/als_si114x: Add missing case statementTom Hughes2022-10-171-0/+3
| | | | | | | | | | | | | | | | | | | | When building with clang it warns: driver/als_si114x.c:317:10: error: no case matching constant switch condition '0' [-Werror] switch (SI114X_NUM_LEDS) { ^~~~~~~~~~~~~~~ ./driver/als_si114x.h:35:25: note: expanded from macro 'SI114X_NUM_LEDS' ^~~~~~~~~~~~~~~~~~~~~~~~~~ BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=eve Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I94db5530c681c438db53bb065c45b223caea7917 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3949622 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* baseboard/intelrvp: Add castsTom Hughes2022-10-171-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with clang it warns: baseboard/intelrvp/adlrvp.c:235:23: error: implicit conversion from enumeration type 'enum ioex_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] .retimer_rst_gpio = IOEX_USB_C3_BB_RETIMER_RST, ^~~~~~~~~~~~~~~~~~~~~~~~~~ baseboard/intelrvp/adlrvp.c:236:21: error: implicit conversion from enumeration type 'enum ioex_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] .usb_ls_en_gpio = IOEX_USB_C3_BB_RETIMER_LS_EN, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ baseboard/intelrvp/adlrvp.c:310:44: error: implicit conversion from enumeration type 'const enum gpio_signal' to different enumeration type 'enum ioex_signal' [-Werror,-Wenum-conversion] ioex_set_level(bb_controls[me->usb_port].usb_ls_en_gpio, 1); ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ baseboard/intelrvp/adlrvp.c:319:44: error: implicit conversion from enumeration type 'const enum gpio_signal' to different enumeration type 'enum ioex_signal' [-Werror,-Wenum-conversion] ioex_set_level(bb_controls[me->usb_port].retimer_rst_gpio, 1); ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ BRANCH=none BUG=b:172020503 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I5ba7821d47b07a14925274fadbfaf963d061a4b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953253 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* power/icelake: add casts for power signalsTom Hughes2022-10-171-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with clang, it warns: power/icelake.c:43:11: error: implicit conversion from enumeration type 'enum espi_vw_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] .gpio = SLP_S3_SIGNAL_L, ^~~~~~~~~~~~~~~ include/power/intel_x86.h:36:25: note: expanded from macro 'SLP_S3_SIGNAL_L' ^~~~~~~~~~~ Although "enum espi_vw_signal" and "enum gpio_signal" are not directly compatible, it appears that the code in power/common.c takes that into account by calling espi_signal_is_vw(). clang also produces another warning: power/icelake.c:267:19: error: implicit conversion from enumeration type 'enum espi_vw_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] gpio_set_flags(SLP_S3_SIGNAL_L, GPIO_ODR_LOW); ~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~ include/power/intel_x86.h:36:25: note: expanded from macro 'SLP_S3_SIGNAL_L' ^~~~~~~~~~~ However, this warning should not be emitted because this code is inside an IS_ENABLED(CONFIG_CHIPSET_SLP_S3_L_OVERRIDE) block. Changing IS_ENABLED(CONFIG_CHIPSET_SLP_S3_L_OVERRIDE) to "#if defined(CONFIG_CHIPSET_SLP_S3_L_OVERRIDE)" works around this. BRANCH=none BUG=b:172020503 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I1fe6bbb1881572a3eff756220ee960d397344c69 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953255 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr test: EC_CMD_TYPEC_DISCOVERY response sizeAbe Levkoy2022-10-171-0/+13
| | | | | | | | | | | | | | | Verify that getting discovery data does not return discovered SVIDs when the provided response buffer does not contain enough space for them. BUG=b:236075403 TEST=twister -s zephyr/test/drivers/drivers.usbc_alt_mode BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I6ae934dd4781a158c73c952c13aadc0c87c77930 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960780 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* Zephyr test: Add test for AP-driven VDMsDiana Z2022-10-176-0/+60
| | | | | | | | | | | | | | | | 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>
* Zephyr test: Add verification of AP mux control flagDiana Z2022-10-171-0/+9
| | | | | | | | | | | | | | | Add code to verify our AP mux control flag is being set when this feature is enabled. BRANCH=None BUG=None TEST=./twister -T ./zephyr/test Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I2c4dcd791c4150e02a4a1985af641ddf3b1ab8ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953481 Reviewed-by: Aaron Massey <aaronmassey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Zephyr test: Add EC features helperDiana Z2022-10-171-0/+18
| | | | | | | | | | | | | | | Add a helper to query the EC features, which can be used to validate that the AP will see a new feature present. BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test/drivers Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I27e149a9f4ca3735fdec32a1c996c878bd0d027e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953480 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* Features: Add feature flag to advertise AP VDM controlDiana Z2022-10-172-0/+7
| | | | | | | | | | | | | | | Add a feature flag so the AP can know that this system is capable of letting the AP compose VDMs to send to a port partner. BRANCH=None BUG=b:208884535 TEST=CQ+1 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I2adf73307e6d003246d9b61c83a2655ba01336a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953479 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Config: Introduce CONFIG to allow AP driven VDMsDiana Z2022-10-173-0/+18
| | | | | | | | | | | | | | | This CONFIG will be used to gate behavior for the tidal flow feature where we allow the AP to drive our VDMs. For now, the CONFIG does nothing. BRANCH=None BUG=b:208884535 TEST=CQ+1 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I11b4b34ebc9e77129569e4ade0de9243ded3dfeb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953478 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* util: crash_analyzer recognizes div-0 crashesRicardo Quesada2022-10-171-2/+2
| | | | | | | | | | | | | | | This CL improves the Regexp to parse the crash reports. Now it supports both "HANDLER" and "PROCESS" exception crash reports. BUG=None TEST=./crash_analyzer.py lite -d /tmp/burnet/ -m /tmp/burnet.map Tested with Burnet crashes where most of them are Div-0 BRANCH=None Change-Id: I58da56c29f6ce5b7b90fe9cbf9fe05f3a354ae92 Signed-off-by: ricardoq@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3956391 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr test: EC_CMD_TYPEC_DISCOVERY invalid argsAbe Levkoy2022-10-171-0/+22
| | | | | | | | | | | | | | | | Verify that getting discovery data fails with and invalid port number or invalid SOP type. BUG=b:236075403 TEST=twister -s zephyr/test/drivers/drivers.host_cmd BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I03e06e5d7505b162e12e69016ad071d1ac08a6a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3960779 Reviewed-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Aaron Massey <aaronmassey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* it83xx: espi: reset pltrst# virtual wire signal during espi resetDino Li2022-10-172-0/+5
| | | | | | | | | | | | | | | | | | | | EC software reset doesn't reset pltrst# by default. This change was made to reset pltrst# during espi reset. So Ampton won't get stuck after watchdog reset. BRANCH=octopus BUG=b:235443631 TEST=Ampton won't get stuck after watchdog reset. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: Ice77a902185046757d6b7bc70edee53eb81e64dc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3959261 Commit-Queue: Henry Sun <henrysun@google.com> Reviewed-by: luluboy luluboys <luluboy5208@gmail.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Tested-by: Luluboy Jian <luluboy_jian@asus.corp-partner.google.com> Tested-by: luluboy luluboys <luluboy5208@gmail.com> Reviewed-by: Luluboy Jian <luluboy_jian@asus.corp-partner.google.com>
* Prism: Enable host command in RODaisuke Nojiri2022-10-172-7/+3
| | | | | | | | | | | | | | | | This patch enables host command interface for a RO copy. This allows the host to read console messages in case KBMCU get stuck in RO. 1708 bytes in RAM still available on prism RO. BUG=b:247611061,b:233404167 BRANCH=None TEST=Vell Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: If06e5bd39f9859f11770d4f928e01beebc162a94 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3956544 Reviewed-by: caveh jalali <caveh@chromium.org>
* Prism: Increase console buffer size to 4096Daisuke Nojiri2022-10-172-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch increases the console buffer size to 4096 bytes so that the host can read more messages for debugging. HOOKS task RAM is reduced in half since Prism doesn't need to support complex hooks. Before: 3288 bytes in RAM still available on prism RW Task Ready Name Events Time (s) StkUsed 0 R << idle >> 00000000 1723.816181 144/256 1 HOOKS 00000000 0.112402 528/2048 2 RGBKBD 00000000 0.000123 168/2048 3 HOSTCMD 00000000 0.000009 208/768 4 R CONSOLE 00000000 0.058197 376/1024 After: 472 bytes in RAM still available on prism RW Task Ready Name Events Time (s) StkUsed 0 R << idle >> 00000000 956.595198 144/256 1 HOOKS 00000000 0.064036 528/1024 2 RGBKBD 00000000 0.000124 168/2048 3 HOSTCMD 00000000 0.000009 208/1024 4 R CONSOLE 00000000 0.029240 376/1024 BUG=b:247611061,b:233404167 BRANCH=None TEST=Vell Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I9858be681f6d724f7fb82176aca17d7d67b98458 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3956543 Reviewed-by: Keith Short <keithshort@chromium.org>
* Prism: Correct comments in bulid.mkDaisuke Nojiri2022-10-171-5/+2
| | | | | | | | | | | | | | This patch corrects comments in build.mk. There is no functionality change. BUG=None BRANCH=None TEST=None Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ia1919e0d7eb0e38860759f8792f5e7fa02c0dabf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957857 Reviewed-by: Keith Short <keithshort@chromium.org>
* tree: Remove chip/mec1322 and referencesTom Hughes2022-10-1731-5322/+1
| | | | | | | | | | | | | There are no longer any boards that use chip/mec1322. BRANCH=none BUG=none TEST=CQ passes Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ie03535c6c62c61c86fc2714ec4e7bc48eb0e2d79 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953934 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* flash_fp_mcu: Do not exit if FPMCU UART device id is missingPatryk Duda2022-10-171-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | On boards with UART transport (e.g. zork, guybrush) cros-ec-uart is not bound at the end of flash_fp_mcu script, because rebinding AMDI0020:01 destroys the serial bus used by cros-ec-uart. As a result, running flash_fp_mcu twice causes the latter run to fail, because the script can't get cros-ec-uart device id. See b:189992450 for more details. Actually, missing cros-ec-uart device id is not critical when UART transport is used. That's because underlying dw-apb-uart device is still present. BUG=b:253033860 BRANCH=none TEST=Run 'flash_fp_mcu --hello' twice on Zork. Make sure that the script finishes successfully. TEST=Run 'flash_fp_mcu --hello' twice on Hatch. Make sure that the script finishes successfully. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I1ef931f0c12d1dfc1970558840b556062e63cb65 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3955897 Reviewed-by: Josie Nordrum <josienordrum@google.com> Tested-by: Patryk Duda <patrykd@google.com> Commit-Queue: Patryk Duda <patrykd@google.com>