summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* presubmit: Don't use chromite in presubmit hookTristan Honscheid2023-05-171-9/+10
| | | | | | | | | | | | | | | | | We can do the things chromite.lib was doing in other ways while making it easier to run the presubmit hooks outside of the chroot. Replace the command line parsing with `argparse` and use `subprocess` for interfacting with Git. BUG=None TEST=./util/check_low_coverage_reason.py Change-Id: I6ecc692ae26d1646604f2cabd52c76337404a481 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4545398 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Tristan Honscheid <honscheid@google.com> Auto-Submit: Tristan Honscheid <honscheid@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* presubmit: Require bug in LOW_COVERAGE_REASONTristan Honscheid2023-05-161-0/+58
| | | | | | | | | | | | | | | | | Enforce having a bug listed in the LOW_COVERAGE_REASON to track the issue that impedes coverage for that specific CL. This encourages developers to go back and fix those problems. Also update the documentation. BUG=None TEST=util/check_low_coverage_reason.py Change-Id: If35f918b11771d10944e0b6e7a4aeeba84e05eaf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4537010 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Tristan Honscheid <honscheid@google.com> Tested-by: Tristan Honscheid <honscheid@google.com>
* ec_openocd: flip the logic for verify, change to --no-verifyFabio Baltieri2023-05-161-7/+6
| | | | | | | | | | | | | | The current verify option has to be used with --verify=0, which is a bit unintuitive. Replace it with a --no-verify, or -n. BUG=none TEST=./util/ec_openocd.py --board rex flash -n Change-Id: Ib2747c52b9a07c8ff3985dd0c7416331e2b042b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4534336 Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Robert Zieba <robertzieba@google.com>
* battery: Deprecate CONFIG_BATTERY_LEVEL_NEAR_FULLwen zhang2023-05-111-1/+0
| | | | | | | | | | | | | | | | | | Atlas, coral, corori, eve, morphius, primus, and rammus are setting CONFIG_BATTERY_LEVEL_NEAR_FULL to custom values. This causes their LEDs show 'full' while the display battery percentages are still < 100%. We'll make these boards define CONFIG_BATT_HOST_FULL_FACTOR, instead. And fix LED dts for some zephyr projects. BUG=b:280818345 TEST=build pass Change-Id: I98f97798ea99cc812671d5b31d64e92d55a1e05a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4523043 Commit-Queue: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* flash_ec: Fix shellcheck warning SC2009Bobby Casey2023-05-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The error was: Hook script "cros lint ${PRESUBMIT_FILES}" failed with code 1: In util/flash_ec line 854: if ps -o cmd= "${pid}" | grep -qE "(servod|/sbin/init)"; then ^ SC2009 (info): Consider using pgrep instead of grepping ps output. Unfortunately, per this thread crrev.com/c/3864978/4/util/flash_ec#857 it seems like the ps / grep solution is our best bet so shellcheck exclusion was added. BRANCH=none BUG=b:242127759 TEST=util/flash_ec --board=dartmonkey --image build/dartmonkey/ec.bin Change-Id: I271384dae6d0edd9a84546883b799a5a8fe64207 Signed-off-by: Bobby Casey <bobbycasey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3864978 Reviewed-by: Josie Nordrum <josienordrum@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util: preupload: make filename argument optionalFabio Baltieri2023-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | The filename argument is meant to take ${PRESUBMIT_FILES} from the presubmit config, but the file list can be empty if the commit only contains deleted files. Change the argument nargs value from "+" to "*" to allow running the scripts with no arguments, they become a noop in this case instead of failing with: check_cprints.py: error: the following arguments are required: filename BUG=none TEST=repo upload on a patch with only deleted files Change-Id: Id77c745651fd30d4a005f2b0decada9a72c50592 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4518770 Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* uartupdatetool: Add device ID for NPCX997Caveh Jalali2023-05-081-0/+6
| | | | | | | | | | | | | | | | | | | | Add entry for the NPCX 997 EC to the UART update tool. This is used by flash_ec to communicate with the EC, but the missing entry only broke being able to read the EC flash. flash_ec would fail with "Unknown NPCX device ID:0x22 chip ID:0x09". rebuilt uartupdatetool with "sudo emerge ec-devutils -j". BRANCH=none BUG=b:280058857 TEST="util/flash_ec --read /tmp/e.bin" now works Change-Id: I081f81ee28206b0e8cdeb83e9da65b885e2e0ed1 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4400342 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com> Reviewed-by: CH Lin <chlin56@nuvoton.com>
* flash_ec: Fix shellcheck warning SC2295Bobby Casey2023-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The failure was: [FAILED] chromiumos/platform/ec: cros lint Hook script "cros lint ${PRESUBMIT_FILES}" failed with code 1: In util/flash_ec line 798: save=( "${CTRL_RESULT#${DUT_CTRL_PREFIX}}" "${save[@]}" ) ^----------------^ SC2295 (info): Expansions inside ${..} need to be quoted separately, otherwise they match as patterns. Did you mean: save=( "${CTRL_RESULT#"${DUT_CTRL_PREFIX}"}" "${save[@]}" ) BRANCH=none BUG=b:242127759 TEST=util/flash_ec --board=dartmonkey --image build/dartmonkey/ec.bin Change-Id: I92bb0aa609be5e377e7ad04f64b81533b3ca9363 Signed-off-by: Bobby Casey <bobbycasey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4455231 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* flash_ec: flash_ec: Fix shellcheck warning SC2140Bobby Casey2023-05-081-2/+2
| | | | | | | | | | | | | | | | | | | The error was: In util/flash_ec line 151: "UART baud rate to use when bit bang programming, "\ ^ SC2140 (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"? BRANCH=none BUG=b:242127759 TEST=util/flash_ec --board=dartmonkey --image build/dartmonkey/ec.bin Change-Id: Id98ba2d2d44d53c21c9390c51f17195fe889cacb Signed-off-by: Bobby Casey <bobbycasey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4455230 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util: Support inject_keys util with Frostflow kb matrixChao Gui2023-05-061-1/+109
| | | | | | | | | | | | BUG=b:268158580 TEST=NONE Change-Id: I34183f23f0460440182ab61d0c0a518abd3ccf23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4295371 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jonathon Murphy <jpmurphy@google.com> Commit-Queue: Chao Gui <chaogui@google.com> Tested-by: Chao Gui <chaogui@google.com>
* ec: Replace presubmit_check.shJeremy Bettis2023-05-036-122/+166
| | | | | | | | | | | | | | | | | Replace presubmit_check.sh and zephyr_check_testcase_yaml.py with python scripts which handle PRESUBMIT_COMMIT, PRESUBMIT_FILES, and also work outside of the chroot. BUG=None TEST=on various paths Change-Id: If7ff5e5d238a5846c19894bb288e96052f99aae2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4497260 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
* utils: Only exclude certain zephyr filesstabilize-15446.B-mainJeremy Bettis2023-05-011-1/+10
| | | | | | | | | | | | | | | | | | | | When looking for bad lines that have coverage reported, only exclude a few files instead of all of zephyr. Commit a10cb8394d26d9c369eb5bd1c2ab64f0e955a898 caused bad lines in kernel/init.c, and this script could not see them. BRANCH=None BUG=b:272518464 TEST=./util/find_non_exec_lines.py build/zephyr/lcov.info Change-Id: Ic3dfd6783f4a556759be8e43ed97d36454743ab3 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4496382 Reviewed-by: Simon Glass <sjg@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* config: Don't allow legacy INA drivers with ZephyrKeith Short2023-04-281-1/+0
| | | | | | | | | | | | | | | | Zephyr provides duplicate symbol CONFIG_INA3221 upstream. Don't allow Zephyr boards to modify this symbol directly. BUG=b:279955995 BRANCH=none TEST=make check_undef TEST=make BOARD=eve Change-Id: I011ebd0896de78fb99d8a5264e753f36f841397e Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4490505 Reviewed-by: Tristan Honscheid <honscheid@google.com> Reviewed-by: Sam Hurst <shurst@google.com>
* ec: add support for npcx9m8sDavid Cross2023-04-262-1/+8
| | | | | | | | | | | BUG=none TEST=`make BOARD=helipilot` BRANCH=none Signed-off-by: David Cross <davidmcross@google.com> Change-Id: Ib6e0ccc2eac31f47326e27459c9ee8c32585a7ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4007183 Reviewed-by: Bobby Casey <bobbycasey@google.com> Reviewed-by: CH Lin <chlin56@nuvoton.com>
* twister_launcher: remove disable-warnings-as-errorsKeith Short2023-04-261-5/+4
| | | | | | | | | | | | | | | None of the test devicetree overlays contain any "label" properties, so the --disable-warnings-as-errors flag can be removed from the default twister invocation. BUG=none BRANCH=none TEST=./twister Change-Id: If06fb0a73f29a791a9ab6303cad3528513401ce5 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4451650 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* Reland "tree: Remove the stale boringssl AES code"Yi Chou2023-04-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of commit 1eb725490d0e7ff726b9edcf11579080a412a02f Original change's description: > tree: Remove the stale boringssl AES code > > BUG=b:248508087, b:273639386 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50 > Signed-off-by: Yi Chou <yich@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> BUG=b:248508087, b:273639386 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Force-Relevant-Builds: all Change-Id: Ifac2e67d3f347be07a4ab880398029a694fa357d Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4464660 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* boxy: Initial EC imagekevin3.yang2023-04-241-0/+1
| | | | | | | | | | | | | | | | | | | Create the initial EC image for the boxy variant by copying the waddledee 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:277529068 BRANCH=None TEST=make BOARD=boxy Change-Id: I8ab2faee3be0acf4cafaafd1c01d63593f04f5d6 Signed-off-by: kevin3.yang <kevin3.yang@lcfc.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4444450 Tested-by: Derek Huang <derekhuang@google.com> Reviewed-by: Derek Huang <derekhuang@google.com> Commit-Queue: Derek Huang <derekhuang@google.com>
* Revert "Reland "tree: Remove the stale boringssl AES code""Jonathon Murphy2023-04-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2e03009c0dccc4ae9683d3b7d761e900b3cf2c46. Reason for revert: Breaks postsubmit b/279174496 Original change's description: > Reland "tree: Remove the stale boringssl AES code" > > This is a reland of commit 1eb725490d0e7ff726b9edcf11579080a412a02f > > Original change's description: > > tree: Remove the stale boringssl AES code > > > > BUG=b:248508087, b:273639386 > > TEST=make runhosttests -j > > TEST=make buildall -j > > BRANCH=none > > > > Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50 > > Signed-off-by: Yi Chou <yich@google.com> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275 > > Reviewed-by: Tom Hughes <tomhughes@chromium.org> > > BUG=b:248508087, b:273639386 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Signed-off-by: Yi Chou <yich@google.com> > Change-Id: Ifca00792d0568ed767a1c9aea4953eb7a93c1c92 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439570 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:248508087, b:273639386 Change-Id: I4c44cdd75a9cc38e3e0e688d91f2a64b908ae61d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4459598 Tested-by: Jonathon Murphy <jpmurphy@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Auto-Submit: Jonathon Murphy <jpmurphy@google.com> Owners-Override: Jonathon Murphy <jpmurphy@google.com>
* Reland "tree: Remove the stale boringssl AES code"Yi Chou2023-04-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of commit 1eb725490d0e7ff726b9edcf11579080a412a02f Original change's description: > tree: Remove the stale boringssl AES code > > BUG=b:248508087, b:273639386 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50 > Signed-off-by: Yi Chou <yich@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> BUG=b:248508087, b:273639386 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Signed-off-by: Yi Chou <yich@google.com> Change-Id: Ifca00792d0568ed767a1c9aea4953eb7a93c1c92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439570 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Taranza: Create initial EC imageYu-An Chen2023-04-211-0/+1
| | | | | | | | | | | | | | | | | Create the initial EC image for the taranza variant by copying the dibbi board EC files. More changes will be added later. BUG=b:277664211 BRANCH=none TEST=make BOARD=taranza Change-Id: I5b085ed96117e268fe0e5b30d0e5eb4cb7ae522a Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4410551 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* hammer: Add jewel boardstabilize-15429.B-mainlschyi2023-04-201-0/+1
| | | | | | | | | | | | | | | Add the Hammer derivative base jewel board. BUG=b:278138283 TEST=make BOARD=jewel BRANCH=none Change-Id: I506d619b95149041a2ee8f8997032252d359c9d4 Signed-off-by: lschyi <lschyi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4444451 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Sung-Chi Li <lschyi@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org>
* chip/stm32: Add extensions for flash programmingJes B. Klinke2023-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Add support to usb_spi.c for processing a new "Flash Command Start" packet, as an alternative to the existing "Command Start" packet. The new serial flash version carries additional flags, among others, to request a one-byte "Write enable" transaction to take place before the main transaction, and to request repeated polling of the "busy bit" after the main transaction. These allow the number of USB round trips to be reduced when using Servo Micro or C2D2 for flash programming. Also, flags of the new request allow the caller to ask for dual or quad lane communication, which can be supported by board-specific SPI drivers. This is intended for use on the HyperDebug debugger board. BUG=b:273601311 TEST=c2d2 flashing gets slight performance boost Change-Id: Id4d1ec9f37387b4e083a397ca15300455f7a0ada Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4346952 Tested-by: Jes Klinke <jbk@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* Revert "tree: Remove the stale boringssl AES code"Yi Chou2023-04-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1eb725490d0e7ff726b9edcf11579080a412a02f. Reason for revert: break the build of chromeos-base/chromeos-fpmcu-unittests. Original change's description: > tree: Remove the stale boringssl AES code > > BUG=b:248508087, b:273639386 > TEST=make runhosttests -j > TEST=make buildall -j > BRANCH=none > > Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50 > Signed-off-by: Yi Chou <yich@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:248508087, b:273639386 Change-Id: I81f5035e25bed8e98516072a6f2a7a609fd6eede Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439431 Commit-Queue: Yi Chou <yich@google.com> Tested-by: Yi Chou <yich@google.com> Reviewed-by: Howard Yang <hcyang@google.com>
* tree: Remove the stale boringssl AES codeYi Chou2023-04-181-2/+0
| | | | | | | | | | | | BUG=b:248508087, b:273639386 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Add third_party boringssl supportYi Chou2023-04-182-0/+3
| | | | | | | | | | | | | | The boringssl support can be enabled via CONFIG_BORINGSSL_CRYPTO. BUG=b:248508087, b:273639386 TEST=make runhosttests -j TEST=make buildall -j BRANCH=none Change-Id: Ibb16bd16a06b08dd86ff7a465c2b4f52994600d8 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388274 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* presubmit: Validate testcase.yaml filesTristan Honscheid2023-04-183-4/+138
| | | | | | | | | | | | | | | | | | Add a helper script that examines testcase.yaml files and call it during the presubmit hook. Currently the script scans for extra_args fields in the testcase.yaml files that reference the deprecated CONF_FILE, OVERLAY_CONFIG, or DTC_OVERLAY_FILE vars and prints a message to use the corresponding extra_conf_files, extra_overlay_confs, or extra_dtc_overlay_files YAML field. BUG=None BRANCH=None TEST=Tried submitting some invalid testcase.yaml files Change-Id: I0a08c2bec156eb4e43acca255377c7563757c53b Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4428298 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* zephyr: twister: Allow override of zephyr_baseKeith Short2023-04-171-2/+6
| | | | | | | | | | | | | | | Allow the user to override the default zephyr_base by setting the ZEPHYR_BASE environment variable. BUG=none BRANCH=none TEST=./twister TEST=ZEPHYR_BASE=~/zephyrproject/zephyr ./twister Change-Id: I09e19c5d1f1937c443832bbd100d92b9beba9141 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426807 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* util: Add new utility to find non-exec linesJeremy Bettis2023-04-141-0/+62
| | | | | | | | | | | | | | | | | | | | | Add a new utility that reads one or more lcov files, and reads each executable line from that file, and then tries to verify if that line is actually executable code or not. This should help when playing whack-a-mole with strange pre-processor off-by-one errors. BRANCH=None BUG=b:272518464 TEST=Ran it on a known bad commit Change-Id: I89b43f73e59f14854b45855322ada626146658b6 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426796 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Tristan Honscheid <honscheid@google.com>
* ectool: Add command to get/set s0ix counterGrzegorz Bernacki2023-04-141-0/+41
| | | | | | | | | | | BUG=b:261869264 TEST=Tested on skyrim and nissa BRANCH=none Change-Id: Id6d7eb138f44559fb0c8c601935f6ab94c367b44 Signed-off-by: Grzegorz Bernacki <bernacki@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4239444 Reviewed-by: Robert Zieba <robertzieba@google.com>
* zephyr: Kconfig: add FLASH_PSTATE_BANK / FLASH_PSTATE_LOCKEDTing Shen2023-04-131-2/+0
| | | | | | | | | | | | | | | BUG=b:277557274 TEST=1. `zmake compare-builds --all` This change should not affect existing boards 2. write protect works on roach BRANCH=none Change-Id: I697215c1990c7d12cd81e9b50b940485934da1bb Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4415812 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* presubmit: Validate test_ prefix is present for ZTESTAl Semjonovs2023-04-121-0/+8
| | | | | | | | | | | | | | | | | | Fail presubmit when 'test_' prefix is missing for new ZTESTs BUG=None BRANCH=NONE TEST=Preupload check with ZTEST(foo, test_good) ZTEST(foo, missing_prefix1) ZTEST_F(foo, missing_prefix2) ZTEST_USER(foo , missing_prefix3) ZTEST_USER_F(foo , missing_prefix4) Change-Id: I0f223852159151d4fe7895e70b6c0548a44e1f45 Signed-off-by: Al Semjonovs <asemjonovs@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4411762 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* Reland "battery: Finish past cleanup of sb fw update"Aaron Massey2023-04-113-933/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of commit 33885596426b7f419709d81529f3e4d02f960ddf Cq-Depend: chromium:4415154 Original change's description: > battery: Finish past cleanup of sb fw update > > We removed the SB_FW_UPDATE host command code in CL:792013 without > cleaning up all now dead references. > > Remove all dead code that references the SB_FW_UPDATE command and > associated sources. > > BRANCH=none > BUG=b:276458241 > TEST=CQ > > Change-Id: I66a79eb42508aaa7ba3a64f6022df777608a497b > Signed-off-by: Aaron Massey <aaronmassey@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388382 > Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Bug: b:276458241 Change-Id: I2002f156e1919496d1b3d8859ee0b78bab83d06c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4415696 Commit-Queue: Aaron Massey <aaronmassey@google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Tested-by: Aaron Massey <aaronmassey@google.com>
* pinmap: migrate code to ArbitrageRachel Nancollas2023-04-1118-1642/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes pinmap code from the chromium codebase because it has been migrated to go/arbitrage. In order to use this code going forward, users should follow the steps in go/arbitrage to setup Arbitrage and the steps in https://team.git.corp.google.com/cros-arbitrage/arbitrage#zephyr-pinmap-generation to generate pinmaps. In order to develop this code going forward, developers should follow the steps in https://team.git.corp.google.com/cros-arbitrage/arbitrage/+/HEAD/documentation/dev_guide.md. For any questions, contact the Arbitrage team at arbitrage-eng@google.com. Bug: 274938064 Change-Id: I2948ee2245236d95a133758e695e51ecbb4969c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4412374 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Rachel Nancollas <rachelsn@google.com> Code-Coverage: Rachel Nancollas <rachelsn@google.com> Tested-by: Rachel Nancollas <rachelsn@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* zephyr: shim: Add GESTURE_DETECTION to enable/disable body detectionRuihai Zhou2023-04-111-1/+0
| | | | | | | | | | | | | | | | | Add GESTURE_DETECTION to enable/disable body detection on zephyr. Also define LID_ACCEL and format the string literal to avoid build failed after enable GESTURE_DETECTION. BRANCH=corsola BUG=b:272655176 TEST=zmake build steelix TEST=check cros-ec-activity loaded Change-Id: Id77f0baeee3b7e710746991a653a77497984402b Signed-off-by: Ruihai Zhou <zhouruihai@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4405803 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* zephyr: Support PLATFORM_EC_CMD_POWERINDEBUG flagKnox Chiou2023-04-111-1/+0
| | | | | | | | | | | | | | | | | | | Support PLATFORM_EC_CMD_POWERINDEBUG flag for `powerindebug` on zephyr. BUG=b:272185086 BRANCH=none TEST=zmake build geralt TEST=disable flag and check powerindebug Signed-off-by: Knox Chiou <knoxchiou@google.com> Change-Id: I89af4161b6bcc351e750d2716e0cc594cfe74814 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4383291 Tested-by: Knox Chiou <knoxchiou@chromium.org> Commit-Queue: Knox Chiou <knoxchiou@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Knox Chiou <knoxchiou@chromium.org>
* zephyr: Support PLATFORM_EC_CMD_GPIO_EXTENDED flagKnox Chiou2023-04-111-1/+0
| | | | | | | | | | | | | | | | | | | Support PLATFORM_EC_CMD_GPIO_EXTENDED flag to enable `gpioset` on zephyr. BUG=b:272185086 BRANCH=none TEST=zmake build geralt TEST=gpioset lid-open 0/1 Change-Id: I40097dcb9fca337177b9cef9458ddab0c4eab2bf Signed-off-by: Knox Chiou <knoxchiou@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4383289 Code-Coverage: Knox Chiou <knoxchiou@chromium.org> Commit-Queue: Knox Chiou <knoxchiou@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Knox Chiou <knoxchiou@chromium.org>
* Zephyr: Add NX20P3481 CONFIGDiana Z2023-04-071-1/+0
| | | | | | | | | | | | | Add a configuration for the now lesser-used NX20P3481 chip. BRANCH=None BUG=b:276468569 TEST=CQ+1 Change-Id: I28c2cc4821e4e456571bfb5584fa746845c9a750 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4404284 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* flash_fp_mcu: Dynamically determine gpiochip number for hatchPatryk Duda2023-04-071-18/+18
| | | | | | | | | | | | | | | | | | Hatch-kernelnext uses upstream kernel which changes every week. In this case it's cumbersome to hardcode gpiochip number in the script and we should determine it dynamically. BUG=b:277206670 BRANCH=none TEST=Run `flash_fp_mcu --hello` on hatch and hatch-kernelnext Change-Id: Ib2aaf37888bf880e7066c02fee68352808d9b344 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4404897 Reviewed-by: Bobby Casey <bobbycasey@google.com> Commit-Queue: Patryk Duda <patrykd@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Patryk Duda <patrykd@google.com>
* keyboard_scan: drop CONFIG_KEYBOARD_LANGUAGE_IDFabio Baltieri2023-04-062-33/+0
| | | | | | | | | | | | | | Drop the CONFIG_KEYBOARD_LANGUAGE_ID option and code, does not seem to be used, can't find any historical reference either. BRANCH=none BUG=b:277105687, b:80168723 TEST=zmake compare-builds -a Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: If4eb37818ec4819204bcb343c37188f70457e09d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4403956 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* keyboard_scan: drop CONFIG_KEYBOARD_SUPPRESS_NOISEFabio Baltieri2023-04-061-1/+0
| | | | | | | | | | | | | | | Drop the CONFIG_KEYBOARD_SUPPRESS_NOISE option and hooks, does not look like this is used anymore, last board using it has been dropped from the repository. BRANCH=none BUG=none TEST=zmake compare-builds -a Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I08a2a742f6c643a800fccc6c8ab05918432d691d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4403578 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* util/flash_jlink: Disable GUI when flashingTom Hughes2023-04-061-0/+2
| | | | | | | | | | | | | | | Disable the GUI popup when flashing and just show the status on the commandline. BRANCH=none BUG=none TEST=./util/flash_jlink.py -b bloonchipper -i ./build/bloonchipper/ec.bin Change-Id: I5ff44d3521aa41286e7cf2faaab51d14f1857e8a Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4395581 Reviewed-by: Firas Sammoura <fsammoura@google.com> Reviewed-by: Josie Nordrum <josienordrum@google.com>
* util/compare_build.sh: Do a shared checkoutAllen Webb2023-04-041-1/+1
| | | | | | | | | | | | | | | | As of git 2.39.2 clone operations are broken when the .git/objects folder is a symlink. Using --shared works around the issue without the performance impact of file:// which drops --local. BRANCH=None BUG=b:276300917 TEST=run compare_build locally. Change-Id: Ic0735970abe46f3c95badadd84480b81037116f9 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4400552 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Tom Hughes <tomhughes@chromium.org>
* ec: Prevent #undef or #define of zephyr KconfigsJeremy Bettis2023-04-041-0/+71
| | | | | | | | | | | | | | | | | | | | Block all #undef or #define of Kconfigs in include/config.h. This will allow removing the #include <autoconf.h> from zephyr/shim/include/config_chip.h, which will in turn allow removing all of the #line directives we've sprinkled throughout the headers. BRANCH=None BUG=b:272518464 TEST=make buildall_only -j$(nproc), fails before crrev/c/4396143 TEST=CQ, fails before crrev/c/4396143, passes after Change-Id: I09649cf778e339fb45dc05c6ebdffc9aaa5778d2 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4396142 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* ec_openocd: fix a bunch of presubmit errorsFabio Baltieri2023-04-031-58/+70
| | | | | | | | | | | | | | Fix a bunch of existing presubmit detected cosmetic issues. No presubmit warning after this patch. BRANCH=none BUG=b:276311425 TEST=repo upload --cbr . Change-Id: Iccd2f39ded16fb9e36283cb80652aa56c27df460 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4386299 Reviewed-by: Robert Zieba <robertzieba@google.com>
* ec_openocd: handle sigint properlyFabio Baltieri2023-04-031-1/+13
| | | | | | | | | | | | | | | | | | | Currently sigint is passed to everything here, openocd, gdb, the python interpreter. This makes it impossible to interrupt the current execution without a breakpoint. Fix that by ignoring the signal for the python interpreter using signal, and ignoring it for openocd using setsid. BRANCH=none BUG=b:276311425 TEST=./util/ec_openocd.py --board rex debug TEST=./util/ec_openocd.py --board rex debug -x Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I4d73561985a19bcfe92bf1a85f8fda272ec36cb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4386298 Reviewed-by: Robert Zieba <robertzieba@google.com>
* ec_openocd: add an option for using an external gdbserverFabio Baltieri2023-04-031-4/+45
| | | | | | | | | | | | | | | | | Add an option to skip the openocd start altogether and just run GDB and connect to an already running target. This is useful for using a different gdbserver (such as JLinkGDBServer), but still have most of the gdb initialization sequence done by the script. BRANCH=none BUG=b:276311425 TEST=./util/ec_openocd.py --board rex flash TEST=./util/ec_openocd.py --board rex flash -x Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I8e9ce853484160441ba79e378db3d513b3f6af3c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4386297 Reviewed-by: Robert Zieba <robertzieba@google.com>
* ec_openocd: refer to util base for the support file search pathFabio Baltieri2023-04-031-16/+5
| | | | | | | | | | | | | This allows running the script from any path. BRANCH=none BUG=b:276311425 TEST=./util/ec_openocd.py --board rex flash Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ifce00008e3049bbd1b5764ce222f46051a02fe4f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4386296 Reviewed-by: Robert Zieba <robertzieba@google.com>
* ec_opencode: drop the flash_board proceduresFabio Baltieri2023-04-032-8/+0
| | | | | | | | | | | | | They don't seem to be used anywhere anyway. BRANCH=none BUG=b:276311425 TEST=./util/ec_openocd.py --board rex flash Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ib15e687d4f9e62542ead3008c525ac8d598dcb49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4386295 Reviewed-by: Robert Zieba <robertzieba@google.com>
* ec_openocd: add automatic fallback to gdb-multiarchFabio Baltieri2023-04-031-1/+17
| | | | | | | | | | | | | | | Update the script to check for the board specific gdb executable, but fallback to the generic multiarch one, since that's what seems to be on debian machines these days. BRANCH=none BUG=b:276311425 TEST=./util/ec_openocd.py --board rex flash Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I32a87a95287a4d2be9f14c82eef869d1a85cac51 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4386294 Reviewed-by: Robert Zieba <robertzieba@google.com>
* ec_openocd: add support for rexFabio Baltieri2023-04-032-1/+15
| | | | | | | | | | | | | Add support for debugging rex, copy the configuration from skyrim. BRANCH=none BUG=b:276311425 TEST=./util/ec_openocd.py --board rex flash Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I9ae8aef1542c4f957f690b88ae2186c8a2e55118 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4386293 Reviewed-by: Robert Zieba <robertzieba@google.com>