summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add EC_CMD_SET_TABLET_MODE handlerfactory-corsola-15196.B-mainTim Van Patten2023-04-123-2/+151
| | | | | | | | | | | | | | | | | | | | | | | | Add the EC_CMD_SET_TABLET_MODE host command handler. This will update the tablet mode status in the EC, based on the parameters of the EC_CMD_SET_TABLET_MODE command. BRANCH=none BUG=b:256015402 TEST=CQ TEST=./twister -v -i --coverage -p native_posix \ -p unit_testing -s zephyr/test/drivers/drivers.host_cmd https://luci-milo.appspot.com/ui/inv/u-timvp-2022-11-04-18-57-00-c115adba47827acf Change-Id: Ia7d8ad44a284742bb347004ba355a8419d047faa Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3994295 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Raul Rangel <rrangel@chromium.org> (cherry picked from commit 42d6df2a6bc0659b8f6b5b6837b1fa39bbb46c58) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4413756 Commit-Queue: Knox Chiou <knoxchiou@chromium.org> Tested-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
* Add EC_CMD_SET_TABLET_MODETim Van Patten2023-04-121-0/+16
| | | | | | | | | | | | | | | | | | | | Add EC host command EC_CMD_SET_TABLET_MODE, which will be used by 'ectool' to set the tablet mode. BRANCH=none BUG=b:256015402 TEST=CQ Change-Id: I7eae634bcebcdeee21fc170afaa8c844b3278e80 Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3994294 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Raul Rangel <rrangel@chromium.org> (cherry picked from commit 0fe46137f42b811762bcaedcd93f2f4587f6ccfa) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4413755 Commit-Queue: Knox Chiou <knoxchiou@chromium.org> Tested-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
* Add ectool command tabletmodeTim Van Patten2023-04-121-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ectool command tabletmode. This matches the EC console command tabletmode, which turns tablet mode on/off. BRANCH=none BUG=b:256015402 TEST=ectool tabletmode on 22-11-03 16:01:49.043 [151.513200 HC 0x0002] 22-11-03 16:01:51.496 [151.515300 HC 0x000b] 22-11-03 16:01:51.501 [15[151.520400 event clear 0x0000000010000000] 22-11-03 16:01:51.504 [151.523200 ACPI query = 29] 22-11-03 16:01:51.507 1.516400 HC 0x0031] 22-11-03 16:01:51.510 [151.517200 tablet mode enabled] 22-11-03 16:01:51.512 [151.518000 mkbp switches: 3] 22-11-03 16:01:51.518 [151.519200 event set 0x0000000010000000] 22-11-03 16:01:51.521 [151.527200 HC 0x0067 err 9] 22-11-03 16:01:51.527 [151.533000 lid-accel ODR: 12500 - roundup 1 from config 0 [AP 12500]] TEST=ectool tabletmode off 22-11-03 16:02:17.579 [180.879700 HC 0x0002] 22-11-03 16:02:21.199 [180.882200 HC 0x000b] 22-11-03 16:02:21.205 [180.883300 HC 0x003[180.887300 event clear 0x0000000010000000] 22-11-03 16:02:21.210 [180.891000 ACPI query = 29] 22-11-03 16:02:21.213 1] 22-11-03 16:02:21.213 [180.884100 tablet mode disabled] 22-11-03 16:02:21.216 [180.884800 mkbp switches: 1] 22-11-03 16:02:21.221 [180.885600 event set 0x0000000010000000] 22-11-03 16:02:21.224 [180.897300 HC 0x0067 err 9] 22-11-03 16:02:21.230 [180.900500 lid-accel ODR: 12500 - roundup 1 from config 1 [AP 0]] TEST=ectool tabletmode reset 22-11-03 16:02:54.397 [216.057600 HC 0x0002] 22-11-03 16:02:56.776 [216.060100 HC 0x000b] 22-11-03 16:02:56.782 [216.061200 HC 0x0031[216.065300 event clear 0x0000000010000000] 22-11-03 16:02:56.787 [216.069000 ACPI query = 29] 22-11-03 16:02:56.790 ] 22-11-03 16:02:56.790 [216.062000 tablet mode disabled] 22-11-03 16:02:56.793 [216.062800 mkbp switches: 1] 22-11-03 16:02:56.798 [216.063500 event set 0x0000000010000000] 22-11-03 16:02:56.801 [216.073700 HC 0x0067 err 9] Change-Id: I1fd435dc2ac32e94384402407c7efaf6997387e2 Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3994296 Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> (cherry picked from commit d81eb64c92a80bcc7211bf522f91a6839d6fc8a5) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4410550 Commit-Queue: Knox Chiou <knoxchiou@chromium.org> Tested-by: Mike Lee <mike5@huaqin.corp-partner.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>
* tree: Disable false positive warning when building with clangTom Hughes2022-10-155-0/+16
| | | | | | | | | | | BRANCH=none BUG=b:172020503, b:253292373 TEST=./util/build_with_clang.py Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I1ef6244d426c8b611be8766575916bbd38429772 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953489 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* util/build_with_clang: Enable trogdor-based boardsTom Hughes2022-10-151-8/+8
| | | | | | | | | | | | | Now that LTO is enabled, there is enough flash space. BRANCH=none BUG=b:172020503 TEST=./util/build_with_clang.py Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: If716209190bd75c1df92739e35230e184f823ce0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3952910 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* driver/als_si114x.c: Fix LED enableTom Hughes2022-10-141-2/+2
| | | | | | | | | | | | | | | | https://crrev.com/c/2603076 introduced a change that inadvertently used SI114X_PARAM_CHLIST_EN_PS3, regardless of the number of LEDs. This was found on inspection when fixing https://crrev.com/c/3949622. BRANCH=none BUG=b:172020503 TEST=make BOARD=eve Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Iccc77d0cfc6c70635df8553406dbf28e5f37f129 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957419 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* test: power_set/get_host_sleep_state()Aaron Massey2022-10-141-0/+11
| | | | | | | | | | | | | | | Add a test that verifies setting a host sleep event state will result in subsequently getting the input host event sleep state. BRANCH=none BUG=b:252887178 TEST=twister -s zephyr/test/drivers/drivers.power_host_sleep Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I4c2b4672634b89e8a2698ab5bbfea73152c9f9e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3956205 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: test: ps8xxx: Add test coverage to ps8xxxSam Hurst2022-10-142-0/+174
| | | | | | | | | | | | | | | | Add test coverage for ps8xxx drivers BUG=b:246762616 TEST=./twister -T zephyr/test/drivers/ BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ie66d341f7e105086108b30c758e2cce9d3535776 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3929259 Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: emul: ps8xxx: Add REG_ID registerSam Hurst2022-10-142-0/+39
| | | | | | | | | | | | | | | | | Add REG_ID Register used to distinguish between the PS8745 and PS8815 chips BUG=None TEST=./twister -T zephyr/test/drivers BRANCH=None Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ib7ed8f7d5c3dc4d978342fabfb1046b1e531d82e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3950209 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Keith Short <keithshort@chromium.org>
* test: pwm_hc.c EC_CMD_PWM_SET_DUTYAaron Massey2022-10-142-0/+49
| | | | | | | | | | | | | | | | | | | | | | Add test that verifies the EC_CMD_PWM_SET_DUTY sets the duty values for PWMs associated with either display light or keyboard backlight. Scenarios: * Set KBlight duty * Set Displaylight duty * Set invalid PWM type duty BRANCH=none BUG=b:252817310 TEST=twister --clobber -i -s zephyr/test/drivers/drivers.shim_pwm_hc Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I81156f79c0b57ff6a64a64b59396cc8aa2a6c090 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957263 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* core/host/task.c: Fix typo in commentBobby Casey2022-10-141-1/+1
| | | | | | | | | | | | | BUG=none BRANCH=none TEST=none Signed-off-by: Bobby Casey <bobbycasey@google.com> Change-Id: Ia4e032b80ade37a8ad0dcfda1f4236ad6cdb2277 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3956159 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util/build_with_clang: Print failed boards in sorted orderTom Hughes2022-10-141-0/+1
| | | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=./util/build_with_clang.py Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ia3c5840dc32d9fba6913eb33d82ebf46bda3bdf0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953935 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* baseboard/trogdor: Enable LTOTom Hughes2022-10-141-0/+2
| | | | | | | | | | | | | | | | | | | Before (homestar): RO: 5376 bytes in flash and 28448 bytes in RAM still available RW: 5536 bytes in flash and 28448 bytes in RAM still available After (homestar): RO: 16272 bytes in flash and 28832 bytes in RAM still available RW: 16428 bytes in flash and 28832 bytes in RAM still available BRANCH=none BUG=b:172020503 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I48613449cab4977c59a47d98255e0ab683a46fbf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3952909 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* util: add script useful to parse thousands of crash reportsRicardo Quesada2022-10-141-0/+269
| | | | | | | | | | | | | | | | | | | | | | | This CL adds a script that is useful to parse thousands of crash reports. It is useful to parse watchdog crash reports where only the PC is provided. And by analyzing thousands of watchdog crash reports, chances are that we find the function that triggers the watchdogs. This CL should be used together with this other script: https://source.corp.google.com/piper///depot/google3/experimental/users/ricardoq/crashpad/main.py which lives in Google3 since it has to perform an SQL query. BUG=None TEST=crash_analyzer.py lite -m ~/tmp/rammus_193.map -f /tmp/dumps And it generated valid report. BRANCH=None Change-Id: I954c8b89a01dd2b55c07e19111b3ba887b119215 Signed-off-by: ricardoq@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953260 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* Redrix: Add other chip names in port list for I2C7Daisuke Nojiri2022-10-141-1/+1
| | | | | | | | | | | | | | I2C7 also has a main battery charger and a wlc charger. This patch adds them so that i2cscan can show them. BUG=None BRANCH=None TEST=Redrix Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I6fb7ccd7e7c8524730d97aa07b06dbaf4a2b64ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953262 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* test: host_sleep.c suspend then resume w/ timeoutAaron Massey2022-10-141-0/+42
| | | | | | | | | | | | | | | | | | | | | | | Add a host_sleep.c test that: 1. Starts the suspend process 2. Registers the suspend state transition 3. Starts the resume process 4. Timesout during the resume process state transition. 5. Finally completes resume process state transition. As a whole, this test validates that suspend/resume state transitions are being tracked and also cancel hang timeout deferred hooks. BRANCH=none BUG=b:252887178 TEST=twister -s zephyr/test/drivers/drivers.power_host_sleep Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I3f9dcdf12698015d5df2816198dfaf36a5ee458b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953259 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* test: host_sleep.c sleep_set_notifyAaron Massey2022-10-143-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | | Add a test that verifies behavior from sleep_set_notify and correspondly sleep_notify_transition. Scenarios: * Setting notify state and sleep_notify_transition can fire hook * Setting notify state and sleep_notify_transition clears notify state. * sleep_notify_transition can start a hook with NONE sleep notify state Also conducted two small refactor fixes: * Made privately used variable static * Changed an int type to how it's actually used (enum sleep_notify_type) BRANCH=none BUG=b:252887178 TEST=twister -s zephyr/test/drivers/drivers.power_host_sleep Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I9d63d1377359035b316ac6aa5de87376b3bb203f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953317 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: host_sleep sleep_start_suspend infinite timeAaron Massey2022-10-141-0/+15
| | | | | | | | | | | | | | | | | | Add a test that weakly verifies a call to sleep_start_suspend() with an infinite timeout adds a hook with infinite deferred time meaning it never gets executed and call chip-specific handlers. This is a weak verification because it cannot prove the deferred call would never be executed. BRANCH=none BUG=b:252887178 TEST=twister -s zephyr/test/drivers/drivers.power_host_sleep Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Iee1b59096248c83fe6b513ec327f3309d1954772 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953316 Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: host_sleep sleep_start_suspend default timeAaron Massey2022-10-143-1/+28
| | | | | | | | | | | | | | | | | | | | Add a test that verifies a call to sleep_start_suspend() propagates a timeout deferred call to board/chip-specific timeout handlers after the default delay. Also clarified documentation that previously made testing the default timing functionality non-obvious and potentially confuse callers of the API. BRANCH=none BUG=b:252887178 TEST=twister -s zephyr/test/drivers/drivers.power_host_sleep Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Id585b5bb4ee9015c7448b4da26460a690e2990b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953474 Reviewed-by: Yuval Peress <peress@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* ec: Replace dir in path with *Jeremy Bettis2022-10-143-4/+4
| | | | | | | | | | | | | | | BRANCH=None BUG=b:253647573 TEST=None Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I1f91b8123a2e44ea5a137f9644645ca1b4494aaa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3956204 Reviewed-by: Bobby Casey <bobbycasey@google.com> Commit-Queue: Bobby Casey <bobbycasey@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* print_temps: Modify the description output of temps cmdHarsha B R2022-10-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fan speed of temps command is the calculated ratio of Fan_off and fan_max with respect to corresponding sensor temperature. Update the description accordingly so that the output of temps command is not misinterpreted. Also modify the outpu of temps command to display fan_off and fan_max values. EC console ec:~$ temps all memory 310 K (= 37 C) 8% (308 K and 333 K) charger 308 K (= 35 C) 0% (308 K and 333 K) ambient 306 K (= 33 C) 0% (308 K and 333 K) temps command description from EC console, help temps Usage: temps Print temp sensors and temp ratio. BUG=b:246929159 TEST=make -j BOARD=gimble, zmake build nivviks, check temps description BRANCH=none Signed-off-by: Harsha B R <harsha.b.r@intel.com> Change-Id: Iabdd81876985b40da56d2dc669e14bd87eb7ca1a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3915726 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* zmake: Split out build argumentsKeith Short2022-10-142-30/+37
| | | | | | | | | | | | | | Create a subset of arguments used for build commands. This will be used by the compare builds option added later. BUG=none BRANCH=none TEST=zmake/run_tests.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I4ac520c56059fcff75831eabd4cc7e3f3fa2dcbe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957414 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* cq: Expand coverage exclusionsJeremy Bettis2022-10-142-7/+62
| | | | | | | | | | | | | | | | | | | | | There were some test files that were not getting excluded by the test filter. Most importantly, some tests are mixed into the same directories, but named _test.c. BRANCH=None BUG=None TEST=./firmware_builder.py --code-coverage test lcov --list-full-path --list build/zephyr/lcov_no_tests.info | \ sed -e 's|/mnt/host/source/src/||' | egrep 'mock|emul|test|host' Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I4d8335c4185ba373f93fbfe6bf2ed99aaa7a0ba0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957418 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>