summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bb_retimer: Deprecate bb_retimer_set_usb3() APIstabilize-15183.14.B-mainCaveh Jalali2022-10-132-13/+0
| | | | | | | | | | | | | | | The bb_retimer_set_usb3() function is no longer used. Set USB_MUX_FLAG_CAN_IDLE in usb_mux.flags instead. BRANCH=none BUG=b:245753005 TEST='make buildall' passes Change-Id: I2ca48ae6e641ac7a8243a0ddac198d7234241d52 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3914996 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* zephyr test: VCONN Swap off via host commandAbe Levkoy2022-10-121-0/+16
| | | | | | | | | | | | | | | | With the TCPM as VCONN Source, use EC_CMD_USB_PD_CONTROL to initiate a VCONN Swap. Verify that the TCPM is not VCONN Source afterward. BUG=b:251485312 TEST=twister -s zephyr/test/drivers/drivers.usbc_vconn_swap BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ifa5bc067270f0744d74b0f7004b8820ba4f8b778 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3949613 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* test: move spi_flash_reg to its own moduleYuval Peress2022-10-1225-47/+125
| | | | | | | | | | | | | | | | | | | Move the logic of the spi_flash_reg.c from common/ to a separate directory. Also, move the tests. Update the build.mk system to still build this in the same manner as well as CMake to use it as a library. BRANCH=none BUG=b:246839061 TEST=make BOARD=dooly TEST=zmake build hoglin TEST=./twister -T common Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Icc6b4fce1619c2c6a86c040f30390b7788171a9d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3935025 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* tree: Remove CONFIG_SOFTWARE_PANICTom Hughes2022-10-1233-82/+4
| | | | | | | | | | | | | | | | | | | | | | | | It's always enabled in the core/<core>/core_config.h files. The following script demonstrates that it's enabled in all boards: for board in `make print-boards`; do make print-configs board="${board}" | grep -q CONFIG_SOFTWARE_PANIC if [ $? -ne 0 ]; then echo "${board} failed" exit 1 fi done BRANCH=none BUG=none TEST=make buildall Cq-Depend: chromium:3943248 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: If683b244f17b48bedf3699f2b24e83b5ad6e849e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3933255 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* util/build_with_clang: Add more boards that compileTom Hughes2022-10-121-1/+154
| | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=./util/build_with_clang.py Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I965583d9d147617b1f560cfd4cc78cedd6c39bb4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3947823 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Test shmem console commandAl Semjonovs2022-10-122-0/+25
| | | | | | | | | | | | | | | Validate shmem console command BUG=None BRANCH=NONE TEST=./twister -T zephyr/test Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: Ic17cd5bd2448a45795b6525502565a7fceb06b08 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3949472 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* include/ec_commands.h: Fix unaligned access warningsTom Hughes2022-10-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | When building with clang, it now warns if there is an unpacked struct nested in a packed struct: include/ec_commands.h:3053:4: error: field within 'struct ec_params_motion_sense::(unnamed at include/ec_commands.h:3044:3)' is less aligned than 'union ec_params_motion_sense::(anonymous at include/ec_commands.h:3053:4)' and is usually due to 'struct ec_params_motion_sense::(unnamed at include/ec_commands.h:3044:3)' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] union { ^ See https://github.com/llvm/llvm-project/issues/55520. 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: I5c89746d7e2e93183f4706376e6cda0be4589c01 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3946036 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ectool: modify output of temps commandHarsha B R2022-10-121-24/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fan speed displayed as part of temps command is the ratio of FAN_OFF and FAN_MAX wrt corresponding sensor temperature that tells the amount of cooling the respective sensor expects. This value of fan speed misinterprets as the actual fan_duty. Modify the output of temps command accordingly. CPU Console: localhost ~ # ectool temps all --sensor name -------- temperature -------- ratio (fan_off and fan_max) -- memory 310 K (= 37 C) 8% (308K and 333K) charger 305 K (= 32 C) 0% (308K and 333K) ambient 306 K (= 33 C) 0% (308K and 333K) ectool temps command description temps <sensorid> Print temperature and expected fan ratio (based on temperature, fan_off and fan max value). BUG=b:246929159 TEST=make buildall -j, make -j BOARD=gimble, check temps command description, verify ectool temps all command output in gimble, redrix, brya and nivviks BRANCH=none Signed-off-by: Harsha B R <harsha.b.r@intel.com> Change-Id: I96286ec7e110ebe64e277d5cfa27e3f489c5893e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3915760 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: Fix downstream driver includesKeith Short2022-10-122-0/+2
| | | | | | | | | | | | | | | | Zephyr now requires that drivers that use kernel APIs to explicitly include kernel.h. BUG=none BRANCH=none TEST=zmake build -a TEST=twister Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9e2fc39a1645511ac9ce7c8043cff90652c4cd99 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3949614 Reviewed-by: Aaron Massey <aaronmassey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Skyrim: Remove CONFIG_SYSTEM_UNLOCKEDDiana Z2022-10-121-2/+1
| | | | | | | | | | | | | | Skyrim is at a stage where this CONFIG can be removed. BRANCH=None BUG=b:215404321 TEST=zmake build skyrim; boot up on a D4 skyrim Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I12a1bbb42d49a836547e4d5f580b274c97204ade Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3949612 Reviewed-by: Jonathon Murphy <jpmurphy@google.com> Commit-Queue: Jonathon Murphy <jpmurphy@google.com>
* test: EC_CMD_HOST_SLEEP_EVENT s3 resumeAaron Massey2022-10-121-0/+39
| | | | | | | | | | | | | | | | | Add a test that verifies the EC_CMD_HOST_SLEEP_EVENT host command may be invoked with HOST_SLEEP_EVENT_S3_RESUME host sleep event where the chip-specific host sleep event handler propagates the number of sleep transitions that have taken place to the host. 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: Ib9584fcedac7c0e2ee33e2137be4076875aacfa4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3947526 Reviewed-by: Wai-Hong Tam <waihong@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: EC_CMD_HOST_SLEEP_EVENT s3 suspendAaron Massey2022-10-121-0/+28
| | | | | | | | | | | | | | | | | Add a test that verifies the EC_CMD_HOST_SLEEP_EVENT host command may be invoked with HOST_SLEEP_EVENT_S3_SUSPEND host sleep event and subsequently propagates the appropriate sleep context to the chip-specific host sleep event handler. 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: If58665b5ef33c028443cd55082f2a211199e1002 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3947525 Reviewed-by: Sam Hurst <shurst@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: EC_CMD_HOST_SLEEP_EVENT bad argAaron Massey2022-10-125-0/+97
| | | | | | | | | | | | | | | | | | | | Add a test that verifies the EC_CMD_HOST_SLEEP_EVENT host command may be invoked with an invalid sleep event and not return an error to the caller. Also verify that this invocation results in the bad event being propagated down to chip specific event handler with zero sleep transitions. Also adds a new test target for validating the power/host_sleep.c code. 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: I0f177dc660746740b5380254583df426c9b903ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3947524 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* chip/stm32: Remove self-assignmentTom Hughes2022-10-121-2/+2
| | | | | | | | | | | | | | | | | | | When building with clang it warns: chip/stm32/clock-stm32l4.c:400:9: error: explicitly assigning value of variable of type 'uint32_t' (aka 'unsigned int') to itself [-Werror,-Wself-assign] val = val; ~~~ ^ ~~~ BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=hyperdebug Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ie4fae7251747d27b96ed08c3ef166fddd5411b9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3947822 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* common/i2c_peripheral: Fix return typeTom Hughes2022-10-121-1/+1
| | | | | | | | | | | | | | | | | | | When building with clang it warns: common/i2c_peripheral.c:30:9: error: implicit conversion from enumeration type 'enum ec_error_list' to different enumeration type 'enum ec_status' [-Werror,-Wenum-conversion] return EC_SUCCESS; ~~~~~~ ^~~~~~~~~~ BRANCH=none BUG=b:172020503 TEST=none Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ifd3507a4bf08a768ad7e84abcafaf2ebc69503b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3946037 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* Makefile: Only build host-utils for BOARD=hostTom Hughes2022-10-122-1/+11
| | | | | | | | | | | | | | | | In EC terminology, "host" refers to the target platform on top of the EC. It only makes sense to build the host utilities for the host board, not the board running the EC firmware. BRANCH=none BUG=b:252817153 TEST=make buildall Force-Relevant-Builds: all Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I255024c6b2fa8cababdfbed6501730d5dd6308a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943248 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* test: Remove defunct support for zmakeAaron Massey2022-10-121-35/+0
| | | | | | | | | | | | | | | | | The CMakeLists in the test drivers tests maintained code to be backwards compatible with zmake. Since we haven't supported invoking tests in zmake for some time this is dead CMake code. Remove it. BRANCH=none BUG=none TEST=CQ Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I556c443f176f3a64af4c33711f2def5006434956 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3942834 Reviewed-by: Keith Short <keithshort@chromium.org>
* Pujjo: Set charger PROCHOT initial valuejimmy.wu2022-10-121-0/+10
| | | | | | | | | | | | | | | | | Change request by power team. AC PROCHOT 3.5A DC PROCHOT 6.5A BUG=b:253068153 BRANCH=none TEST=Power team verified PROCHOT function as expected behavior. Signed-off-by: jimmy.wu <jimmy.wu@lcfc.corp-partner.google.com> Change-Id: I008a733fd9a4bb6d57146f86c7cf02fbb268a3c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3948005 Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org>
* zephyr: Test ec_feature 'feat' console commandAl Semjonovs2022-10-122-0/+26
| | | | | | | | | | | | | | | Validate 'feat' console command output BUG=None BRANCH=NONE TEST=./twister -T zephyr/test Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: If8c5c102e3e1da6b8f0ce284a674e61ea88fe16c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3947528 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* include/common: Use noreturn attribute in test and non-test buildTom Hughes2022-10-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | In the test build, the "test_mockable_noreturn" helper adds the "__attribute__((weak))" attribute to allow overriding functions. It should still keep the "noreturn" attribute to be consistent with the non-test build. Otherwise, a function declared with "noreturn" that calls one of the functions that uses "test_mockable_noreturn" will fail to compile with: error: function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn] BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b all => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I6ebfc78b7b07e19f9305a22fbfeccf62b4000667 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3933258 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* util: Remove chromite from lcov_stencilJeremy Bettis2022-10-121-3/+15
| | | | | | | | | | | | | | | | | The dependency on chromite fails on gitlab, so remove it. BRANCH=None BUG=None TEST=Ran some commands Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I15ef7d77c91f91b4e36fd94bd45cd8d35fa2da74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3946032 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Aaron Massey <aaronmassey@google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* banshee: Switch to usb_mux idle APICaveh Jalali2022-10-112-25/+11
| | | | | | | | | | | | | | We now have an API for putting muxes in idle mode which can be used instead of board specific code, so switch to it. BRANCH=none BUG=b:245753005 TEST='make buildall' passes Signed-off-by: Caveh Jalali <caveh@chromium.org> Change-Id: I00d7d2b26d736e9615fa562a786a9271f314d7d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3914991 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* zephyr test: Increase timeout for usbc_alt_modeAbe Levkoy2022-10-111-0/+1
| | | | | | | | | | | | | Avoid flakes due to timeout. BUG=none TEST=twister -s zephyr/test/drivers/drivers.usbc_alt_mode BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I7f73ebfda60af558885c84aa0b7c0878bc2cd5bb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3945691 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr test: Verify that TCPM initiates VCONN SwapAbe Levkoy2022-10-111-0/+9
| | | | | | | | | | | | | | | Verify that TCPM will become VCONN Source if it can after attaching as not VCONN Source. BUG=b:251485312 TEST=twister -s zephyr/test/drivers/drivers.usbc_vconn_swap BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Icd094f1cdc1d8ab320bf18edb112182532385618 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943260 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* util: Add --os support to clangd_config.pyCraig Hesling2022-10-111-9/+58
| | | | | | | | | | | | | | | | | BRANCH=none BUG=b:236389226,b:176500425 TEST=./util/clangd_config.py bloonchipper TEST=./util/clangd_config.py --os auto bloonchipper TEST=./util/clangd_config.py --os ec bloonchipper TEST=./util/clangd_config.py --os zephyr bloonchipper # Expect error TEST=./util/clangd_config.py herobrine # Expect error Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Iee6c7d8626f046f4950bce48f5a5be0b84f4eeeb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3931851 Reviewed-by: Andrea Grandi <agrandi@google.com>
* Makefile.ide: Simplify cmd_json_list and std var formatCraig Hesling2022-10-111-6/+5
| | | | | | | | | | | | | BRANCH=none BUG=b:236389226,b:176500425 TEST=./util/clangd_config.py bloonchipper TEST=make -j16 all-ide-compile-cmds Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ied9b16e543f1d8113b7c0535d7aaa397518fa3ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3931850 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Andrea Grandi <agrandi@google.com>
* ec: New tool to merge lcov filesJeremy Bettis2022-10-113-27/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new tool to merge lcov files using one file as the template and including only lines that are present in the template file. The name is because you use the template file like a "stencil" and the matching coverage shows through. Not great, but it's not really a "set intersect" or a "merge" either. Switch firmware_builder.py and gitlab to use the new tool in place of the filename filtering. See https://jbettis.users.x20web.corp.google.com/www/herobrine_rpt/index.html for updated coverage output. BRANCH=None BUG=None TEST=Ran firmware_builder.py locally. Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I0e9672c346971b0df4602b0adce27fea6367c6b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943261 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* cq: Add coverage metric for kinglerJeremy Bettis2022-10-111-1/+1
| | | | | | | | | | | | | | | | | | Corsola want to track coverage of 2 models, so add kingler to the special boards list. BRANCH=None BUG=None TEST=None Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I7135c453d2e22cff92939de59871a1af3c1f9ef1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3946718 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* third_party: Fix print-tests for cryptoc usersCraig Hesling2022-10-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The use of this variable collides with another use of the variable. Since cryptoc was introduced, the print-tests target wouldn't work correctly for boards that used cryptoc. Instead of printing the test target symbolic name, it would print the full path to all test executable targets. BRANCH=none BUG=b:169156874,b:236389226,b:176500425 TEST=make BOARD=bloonchipper print-tests # Check that the full path isn't shown TEST=make BOARD=bloonchipper tests # Ensure that cryptoc is being built for tests TEST=make host-fp # Ensure cryptoc is being built TEST=make BOARD=bloonchipper # Ensure cryptoc is being built TEST=./util/compare_build.sh -bfp # verdict was match Change-Id: Ia0c0aa9b57c224395df6e2e5551fbc71b7db00fa Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3937046 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Zephyr: mtlrvpp_npcx: Correct the debounce delay for SYS_RESET_L signalRajesh Kumar2022-10-111-0/+1
| | | | | | | | | | | | | | | | | | | | RVP uses MAX6818 to digitize the apreset physical button. The EC SYS_RESET_L is connected to input of the digitizer. From MAX6818 Data sheet, range of 'Debounce Duration' is Minimum - 20 ms, Typical - 40 ms, Maximum - 80 ms. Hence, configured appropriate sys-reset-delay in dts configuration. BUG=none BRANCH=none TEST=zmake build mtlrvpp_npcx EC console command 'apreset' is working and triggers a warm reboot. Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Change-Id: I7530aa6c3933ac26b59770b6b0db7e3f305dc00f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3939619 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Brandon Breitenstein <brandon.breitenstein@intel.corp-partner.google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* Pujjo: Fw_config bit5 to divide tablet/non-tabletjimmy.wu2022-10-112-0/+23
| | | | | | | | | | | | | | | | | | FW_CONFIG bit5 0: non-tablet 1: tablet BUG=none BRANCH=none TEST=set fw_config bit5=0 can disable motion sense. Signed-off-by: jimmy.wu <jimmy.wu@lcfc.corp-partner.google.com> Change-Id: I03416248601b23c35748282426c81b8049fe1a56 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3944305 Commit-Queue: Andrew McRae <amcrae@google.com> Reviewed-by: Andrew McRae <amcrae@google.com> Code-Coverage: Andrew McRae <amcrae@google.com>
* ec_commands.h: Remove ec_current_image compatibility macroTom Hughes2022-10-111-10/+1
| | | | | | | | | | | | BRANCH=none BUG=b:149987779 TEST=make buildall -j Force-Relevant-Builds: all Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I06cc11dba1f8a37e209ffc3d37a8307832847567 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3404686 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr test: Improve pd_check_vconn_swapAbe Levkoy2022-10-111-1/+1
| | | | | | | | | | | | | | | | Modify stub implementation of pd_check_vconn_swap to allow VCONN swap if "board" is not in G3, similar to what herobrine and some other boards support. BUG=b:251485312 TEST=twister -T zephyr/test/ BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ide7634fd4fa64f2877e240b5451f7015892e42d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943259 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr test: Deflake PD rev 3.0 suiteAbe Levkoy2022-10-111-2/+11
| | | | | | | | | | | | | | | | | | | | | | | In the before function for suite usb_attach_5v_3a_pd_source_rev3, set the chipset power state to S0 before calling set_ac_enabled. Allow the tests in this suite to run individually without failing an assumption during set_ac_enabled. Also, after entering S5, wait for the chipset to enter G3, which may prompt a Hard Reset. Only send an Alert after that process has completed, to avoid the Alert being lost. BUG=b:251485312 TEST=twister-out/.../drivers.default/zephyr/zephyr.exe -test=usb_attach_5v_3a_pd_source_rev3:verify_startup_on_pd_button_press BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Icaa88ad977271c8738687106aba4e2a9eafb6b88 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943258 Reviewed-by: Jameson Thies <jthies@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr test: Add empty usbc_vconn_swap test targetAbe Levkoy2022-10-116-0/+159
| | | | | | | | | | | | | | | | | Add a new test target for future VCONN Swap tests. Add a suite with no tests but a common fixture and setup/before/after functions and a layer of indirection to allow those functions to be trivially but type-safely reused in other suites with "different" fixtures. BUG=b:251485312 TEST=./twister -s zephyr/test/drivers/drivers.usbc_vconn_swap BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I4639275ff66f1bf780495ef2c310c8382a234d09 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943257 Reviewed-by: Aaron Massey <aaronmassey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: Add new qcom testsJeremy Bettis2022-10-116-0/+403
| | | | | | | | | | | | | | | | | Several new test cases for power/qcom.c BRANCH=None BUG=b:236074354 TEST=Yes Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I47d5b66eab778e9d3ce1a6fbe99d0527cdd522c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3936946 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* test: pwm_hc.c EC_CMD_PWM_GET_DUTYAaron Massey2022-10-106-0/+82
| | | | | | | | | | | | | | | Add a new test binary that verifies the EC_CMD_PWM_GET_DUTY returns the raw up-to-date PWM value when invoked on a particular PWM. BRANCH=none BUG=b:236132469 TEST=twister --clobber -i -s zephyr/test/drivers/drivers.shim_pwm_hc Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Ie6c5ec65f7e1caf7071fdc9b6c650e00aaaea68a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3939621 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* pwm: Factor out PWM_RAW/PERCENT_TO_PERCENT/RAW()Aaron Massey2022-10-103-6/+5
| | | | | | | | | | | | | | | | | | | | | | | The shim and common pwm code both define the exact same macros to convert to PWM raw and percentage values. Factor these macros out as a single macro included in the pwm.h header that is already included by both the shim and common code. This has the other side-effect of exposing these macros for testing purposes. BRANCH=none BUG=b:236132469 BUG=b:236132199 TEST=zmake build -a TEST=make runhosttests TEST=CQ Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I8a8c19242b0122a1a18c26bba3eda08a0613d824 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3939620 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: shim: eSPI: enable host interface interrupts explictlyJun Lin2022-10-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | In PR:51013, we drop the enabling of host interface interrupts during driver initialization because it makes more sense to enable interrupts after we set the eSPI configuration and register callbacks. This CL implements the logic above in the eSPI shim by calling eSPI API to enable interrupts. BRANCH=none BUG=b:246963730 TEST=in npcx9_evb, test the kbc/pm channel/port80 communication are normal between EC and host emulator. TEST=in skyrim, the hostcmd broken after sysjump symptom is fixed by the related PR and CL. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: Ieea4fd6f52b809110c835df227443d368cf12093 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3936230 Tested-by: CH Lin <chlin56@nuvoton.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: avoid collisions with board.hYuval Peress2022-10-104-2/+4
| | | | | | | | | | | | | | | | | Rename the shim's board.h and add a conditional include in config.h. This avoids some older boards in zephyr/projects from accidentally including the wrong board since multiple include paths exist. BRANCH=none BUG=b:246839061 TEST=zmake build --all Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Ice559b83c021506f0cc310a30b4b774527d38f77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943255 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: shim rtc EC_CMD_RTC_SET/GET_ALARM hostcmdAaron Massey2022-10-101-1/+23
| | | | | | | | | | | | | | | Add test that verifies setting an rtc alarm and then retrieving the alarm value represents updated alarm values. BRANCH=none BUG=b:236160571 TEST=twister --clobber -i -s zephyr/test/drivers/drivers.shim_rtc Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I44a6038be5adba9c76343793ec43aaae08ab2492 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3939610 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* test: shim rtc EC_CMD_RTC_SET_ALARM hostcmdAaron Massey2022-10-102-0/+39
| | | | | | | | | | | | | | | Add test that verifies setting an rtc alarm when fired will invoke the initialized rtc callback function and accompanying host_event. BRANCH=none BUG=b:236160570 TEST=twister --clobber -i -s zephyr/test/drivers/drivers.shim_rtc Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I2a4aa421418a16944ffa8e452f8a297c000b7367 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3939609 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* redrix: enable usb_mux idleBoris Mittelberg2022-10-101-0/+8
| | | | | | | | | | | | | Use the new API to put the mux in idle mode on suspend BRANCH=none BUG=b:233975818 b:245753005 TEST=BBR USB3_Connection bit is correct in S0ix/S0 Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: Iadcbeb75b6918a69d183b1dbbc0d282804c3fd5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3938419 Reviewed-by: caveh jalali <caveh@chromium.org>
* util: Make image arg case-insensitive for clangd_config.pyCraig Hesling2022-10-101-2/+3
| | | | | | | | | | | | | BRANCH=none BUG=b:236389226,b:176500425 TEST=./util/clangd_config.py bloonchipper TEST=./util/clangd_config.py bloonchipper rO TEST=./util/clangd_config.py bloonchipper RW Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I7912e2f199ead1e144de923c3d9d4679ec0fa4b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3936922 Reviewed-by: Andrea Grandi <agrandi@google.com>
* test: shim system.c system_reset()Aaron Massey2022-10-103-1/+52
| | | | | | | | | | | | | | | | | Add test that verifies the system_reset() function saves system encoded reset flags, calls chip-specific cros system soc reset routine, and makes 1000 calls to watchdog_reload() if the SYSTEM_RESET_WAIT_EXT reset flag is set. BRANCH=none BUG=b:236074898 TEST=twister --clobber -i -s zephyr/test/system_shim/system_shim.default Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I2cdbb99028dc5b48a1b244380e76472624bad5e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3935639 Reviewed-by: Sam Hurst <shurst@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* core/cortex-m: Disable C++ exceptionsTom Hughes2022-10-102-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | __exidx_start and __exidx_end indicate the start and end of the exception index table, which is described in more detail in "Exception Handling ABI for ARM Architecture": https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/ehabi32/ehabi32.rst#54the-object-producer-interface __exidx_start and __exidx_end are referenced in libunwind, so they need to be defined. If __exidx_start and __exidx_end are equal, libunwind will interpret the exception index table as empty, which means the exception can not be caught, and std::terminate() is called, which is what we want. The test in https://crrev.com/c/3932262 verifies this behavior. See https://github.com/llvm/llvm-project/blob/b3c5da73b71908c59b12ef0feadfde56bad222b5/libunwind/src/AddressSpace.hpp#L515-L522 BRANCH=none BUG=b:234181908 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I8551ca94fce16ec34770f9204282af14667e7c43 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3857943 Reviewed-by: Andrea Grandi <agrandi@google.com>
* config: Define HOST_EVENT_REPORT_MASK by CONFIGAaron Massey2022-10-103-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | There were two separate masks for clearing the host events. CONFIG_HOST_EVENT_REPORT_MASK for 32 bit host events and CONFIG_HOST_EVENT64_REPORT_MASK for 64 bit host events. Per-build, only one of these would ever be used. At macro-expansion time, set CONFIG_HOST_EVENT_REPORT_MASK to the appropriate mask based on the definition of CONFIG_HOST_EVENT64. BRANCH=none BUG=none TEST=zmake build -a TEST=make runhosttests Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I40ddf978c3cf3dfa16dc0e486eaff26a6d56fbe4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3939623 Commit-Queue: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* test_util: Add assertion inside weakly-linked run_test()Andrea Grandi2022-10-101-0/+10
| | | | | | | | | | | | | | | | | | | | | | The weakly-linked definition of run_test() should never be executed. When it does, it's usually a symptom of an issue with the build of the real test. Add an assertion to make the error condition easier to detect and resolve. BUG=b:243700149 TEST=Run host test with bad definition of run_test() =>Error message is printed on console. BRANCH=none LOW_COVERAGE_REASON=New function is only called from invalid builds. Signed-off-by: Andrea Grandi <agrandi@google.com> Change-Id: Iaf6c8377618944efc5ad4d4557ed4c231c09be09 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3887968 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Bobby Casey <bobbycasey@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Skyrim: Enable SoC OCP InterruptDiana Z2022-10-104-2/+40
| | | | | | | | | | | | | | | | | | Enable interrupt for SoC OCP, and shutdown with a log print if one occurs. LOW_COVERAGE_REASON=no unit test for skyrim board yet: b/247151116 BRANCH=None BUG=b:237563166 TEST=on skyrim A4 and D4, verify system can boot with no unexpected shutdown Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I822e31dfdc91fdde14ea428a4958a15dfd179d87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749802 Reviewed-by: Robert Zieba <robertzieba@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* flash_fp_mcu: Add support for 5.15+ kernel on Zork and GuybrushPatryk Duda2022-10-101-15/+38
| | | | | | | | | | | | | | | | | | | | Zork-kernelnext and guybrush-kernelnext are using 5.15 kernel which assigns different number to GPIO (shifted by 512). Change config in 'flash_fp_mcu' accordingly. BUG=b:251236295 BRANCH=none TEST=Run 'flash_fp_mcu --hello' on zork, zork-kernelnext, guybrush, guybrush-kernelnext. Cq-Include-Trybots: luci.chromeos.cq:cq-orchestrator Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I9ed744bef6e74a55270ad7bc2ca4b0fdb68ed1f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3942064 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Patryk Duda <patrykd@google.com> Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Patryk Duda <patrykd@google.com>