summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: Add Kconfig support for PLATFORM_EC_LED_PWM_TASK_DISABLEDRajesh Kumar2022-05-261-1/+0
| | | | | | | | | | | | | | | This Supports common PWM (Pulse Width Modulation) controlled LEDs that do not conform to the Chromium OS LED behavior specification. BUG=none BRANCH=none TEST=make buildall; zmake testall Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Change-Id: I9b56fb7d17881a1cc1ff4a8cef789d542ee5865e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3657846 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* Zephyr: Add Cypress CCGXXF PD chip in device treeVijay Hiremath2022-05-191-1/+0
| | | | | | | | | | | | | | | Added Cypress CCGXXF Single/Dual USB-C Port Controller with Source PPC chip in Zephyr device tree. BUG=b:232920124 BRANCH=none TEST=zmake testall Able to test USB, DP on MTLRVP Change-Id: If790588a52fb87ab56439338fe0c8614ccc3dac6 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3513796 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* chargesplash: Add ectool commandJack Rosenthal2022-05-171-0/+50
| | | | | | | | | | | | | | | | | Add a new "chargesplash" subcommand to ectool corresponding to the new host command, which enables printing and modifying the chargesplash state for debugging or testing purposes. BUG=b:228370390 BRANCH=none TEST=run all 4 "ectool chargesplash" commands on brya Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I5135c81f34d1f53b12670287e27e34161c9cff6b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615485 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Raul Rangel <rrangel@chromium.org> Commit-Queue: Raul Rangel <rrangel@chromium.org>
* update_release_branch: add the "Generated by" to the commit messageZhuohao Lee2022-05-171-5/+10
| | | | | | | | | | | | | | | | In order to let everybody know how to generate the patch, it would be good to output the command to the commit message. This patch adds the "Generated by:" to the commit message. BUG=None BRANCH=None TEST=`util/update_release_branch.py` to generate the message locally Change-Id: I640c41cc6838a14dbecc42d993afcf1967e466c0 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3650297 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* update_release_branch: fix the cros lint errorZhuohao Lee2022-05-171-0/+2
| | | | | | | | | | | | | | | | | | | When using the repo upload, the cros lint output the error below. This patch fixes the error below. Hook script "cros lint ${PRESUBMIT_FILES}" failed with code 1: ERROR: /mnt/host/source/src/platform/ec/util/update_release_branch.py \ Imports are incorrectly sorted and/or formatted. BUG=None BRANCH=None TEST=repo upload Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Change-Id: I78b617c10956081f24f81de5c7ad9e65547557e5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3650296 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* ectool: add missing space in usbpdmuxinfo outputFabio Baltieri2022-05-161-1/+1
| | | | | | | | | | | | | | Add a missing space in the human readable output after the polarity field. BUG=none BRANCH=none TEST=make utils Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I826471b3382844799097e8f4ff381100632a26e9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3645251 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: Add CCGXXF ioexpander and add get port methodBrandon Breitenstein2022-05-121-1/+0
| | | | | | | | | | | | | | | | Some platforms require get port to be supported to function. Enabling get port to support zephyr implementations that require it. Also adds support for configuring CCGXXF ports in zephyr. BUG=none BRANCH=none TEST=zmake mtlrvpp_npcx and verify cypress ccgxxf ports Signed-off-by: Brandon Breitenstein <brandon.breitenstein@intel.com> Change-Id: Iab4331ebc9c8d8e247f0aeabf8d0635957942a5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3602805 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Sam Hurst <shurst@google.com>
* zork/guybrush: Add missing FP_PWR_EN configurationOfer Fried2022-05-061-6/+4
| | | | | | | | | | | | | | | | | | | FP_PWR_EN is not required for flashing the FPMCU. It is required for POR after the flash is complete. Add FP_PWR_EN configuration for Zork and Guybrush. BRANCH=None BUG=b:229784281 TEST=Toggle the FPMCU_PWR_EN GPIO and confirm an additional `power-on` log appears in /var/log/cros_fp.log Signed-off-by: Ofer Fried <oferfried@chromium.org> Change-Id: I3375936496b40d6361c198a12643414600b0d080 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615482 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Ofer Fried <oferfried@google.com> Tested-by: Ofer Fried <oferfried@google.com>
* zephyr: Add PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT optionAndrew McRae2022-05-061-1/+0
| | | | | | | | | | | | | | | Add a PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT Kconfig to set CONFIG_POWER_BUTTON_INIT_TIMEOUT so that the powerbtn task startup timeout can be configurable. BUG=b:231675142 TEST=zmake build nereid; flash & run BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I5eb3ebadbaa9a0d9f433acc7bbf07807f2e3a1c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3631720 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* throttle_ap: Add option to gate PROCHOT based on C10Keith Short2022-04-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some x86 boards, the PROCHOT signal is not valid once the AP enters the C10 state. Add an option to gate PROCHOT detection if the C10 state is asserted. When the AP exits C10, the EC rechecks the PROCHOT state. Note that only the Volteer baseboard enables the PROCHOT interrupt, so it is the only board that is updated to call throttle_ap_config_prochot(). All gpio.inc files that connect to throttle_ap_prochot_input_interrupt() all use the pin name EC_PROCHOT_IN_L. Confirmed with these searches: $ grep -r "GPIO_INT.*throttle_ap_prochot_input_interrupt" . \ | wc -l 31 $ grep -r "EC_PROCHOT_IN_L.*throttle_ap_prochot_input_interrupt" . \ | wc -l 31 $ grep -r "gpio_enable_interrupt.*EC_PROCHOT_IN_L" . ./baseboard/volteer/power.c: \ gpio_enable_interrupt(GPIO_EC_PROCHOT_IN_L); BUG=b:185810479 BRANCH=volteer TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I73fb328675d9faade13fe0192570dc838de028a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615479 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: Kconfig: modify the dependency for battery APIwen zhang2022-04-281-1/+0
| | | | | | | | | | | | | | | port the PLATFORM_EC_HOSTCMD_BATTERY_V2 and auto-enable if the PLATFORM_EC_BATTERY_V2 is set BUG=b:222629048 BRANCH=none TEST=ectool battery works well when battery is discharging Change-Id: I4345e34bc2777c4a9830a3e1b9d0184c8704f09d Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3503075 Reviewed-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: zanxi chen <chenzanxi@huaqin.corp-partner.google.com>
* ec: Fix "-Wstrict-prototypes" warningManoj Gupta2022-04-271-2/+2
| | | | | | | | | | | | | | | | | Add 'void' to a few functions that are triggering "-Wstrict-prototypes" warning with ToT llvm. BUG=b:230345382 TEST=CQ, tot llvm BRANCH=none Signed-off-by: Manoj Gupta <manojgupta@google.com> Change-Id: I6ce862cf9909cec65db463e2f7d6c4b9d03e1304 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3611723 Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Auto-Submit: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org>
* util/flash_ec: Allow running in --ns-pid chrootRaul E Rangel2022-04-261-2/+3
| | | | | | | | | | | | | | | servod no longer requires running with --no-ns-pid (chromium:2999546). This change allows flash_ec to run in such a chroot. BUG=b:178129469 TEST=flash_ec in --ns-pid chroot and see the following printed: WARNING: You might want to run this tool in a chroot that was entered with 'cros_sdk --no-ns-pid' (see crbug.com/444931 for details) Signed-off-by: Raul E Rangel <rrangel@chromium.org> Change-Id: Ibf95e2b3d70f57ea1658531c7db589bcfb9b90f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3607063 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: Add support for discrete KeyboardVijay Hiremath2022-04-251-1/+0
| | | | | | | | | | | | | | | | Added support to enable discrete Keyboard if the platform needs one or the raw Keyboard support is not built-in in the EC. BUG=b:230008245 BRANCH=none TEST=Able to test it8801 discrete Keyboard on MTLRVP Change-Id: I6fc40af8bdd006e7af86d2c17fca8faab5412f7e Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3601509 Reviewed-by: RAJESH KUMAR <rajesh3.kumar@intel.com> Reviewed-by: Brandon Breitenstein <brandon.breitenstein@intel.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* cleanup: it8801: Rename discrete Keyboard configsVijay Hiremath2022-04-251-1/+1
| | | | | | | | | | | | | | | | Renamed IT8801 discrete keyboard related names like NOT_RAW, I2C_PORT, I2C_ADDRESS and Interrupt GPIO to support discrete keyboard in Zephyr Shim. BUG=b:230008245 BRANCH=none TEST=make buildall Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Change-Id: I9be3ff570681f88e1fc3ac0650f9919ad272b847 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3600627 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: add yaml file for charger chipsDawid Niedzwiecki2022-04-251-1/+0
| | | | | | | | | | | | | | | | | | Add the binding yaml files for all charger chips used in Zephyr. It will be needed for generating the chg_chips array based on DTS, not defining in board-specific code. The yaml files for ISL923x and ISL9241 chips were already present, so just adjust them to the desired usage. BUG=b:228237412 TEST=zmake testall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0e0120d28f03c5d1ba5fb1bd9bbb5a1e878af44f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3586424 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
* CPS8100: Add CPS8100 driverDaisuke Nojiri2022-04-221-1/+0
| | | | | | | | | | | | | | CPS8100 is a Qi wireless power transmitter. This patch adds a driver for it and integrates it with the PCHG subsystem. BUG=b:191418683 BRANCH=Brask TEST=On Brask Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: If6ec1c4811621ce8d553800db9608aa6cf60cd45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3595282 Reviewed-by: caveh jalali <caveh@chromium.org>
* power/intel_x86: block RSMRST until the system is in S5Zhuohao Lee2022-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | When we set the EN_S5_RAILS to enable the 3.3v/5v power for the ap spi flash programming via the C2D2, the power sequence ic will deassert the SEQ_EC_RSMRST_ODL in the G3 state. In order to avoid the ap being powered on during the C2D2 programming, we need to bypass the RSMRST before the system enters the S5. As a result, we add CONFIG_CHIPSET_X86_RSMRST_AFTER_S5 to block the RSMRST until the system goes to S5. Since the APL/GLK already applied the same approach, we enable the CONFIG_CHIPSET_X86_RSMRST_AFTER_S5 for the APL/GLK by default in the config.h. BUG=b:223084533 BRANCH=None TEST=cros ap flash -b brya -i ${IMAGE} Change-Id: I14039b405adc62e91436759eddacf6f9dc141eff Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3583905 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* util/iteflash.md: Clarify i2c-pseudo installationYu-Ping Wu2022-04-211-0/+2
| | | | | | | | | | | | | | | After installing i2c-pseudo, servod will need to be restarted. Clarify that in the documentation. BUG=none TEST=none BRANCH=none Change-Id: I378758d0c39d9aed81e1550f7fe06cfbbcdf3492 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3597641 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* zephyr: Add MAX6958/MAX6959 seven segment display driverRajesh Kumar2022-04-201-1/+0
| | | | | | | | | | | | | | | | | The MAX6958/MAX6959 is a compact multiplexed common - cathode display designed to interface microprocessors with seven - segment numerical LED digits or to discrete LEDs via a 2-wire serial interface compatible with SMBusTM and I2C. BUG=b:218684235 BRANCH=none TEST=zmake testall Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Change-Id: I977c53fb4153da50041d20e68c1b8a084750a18d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3587977 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* usba: Allow modification of USB port enableAndrew McRae2022-04-201-1/+0
| | | | | | | | | | | | | | | Allow dynamic modification of the USB port enable GPIO list so that sub-boards without USB-A ports can disable the port enable setting. BUG=b:214858346 TEST=zmake build nivviks BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I12b93a3c20852f68303b158aa20bc9a1c63f6ae5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3592312 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* util/build_with_clang: Add parallelismTom Hughes2022-04-191-3/+42
| | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=./util/build_with_clang.py Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I6cc9f78483d550e4981d9d685bf6ca739ceb526c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3231027 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* ec: add mtlrvpp_npcx to flash_ec scriptBrandon Breitenstein2022-04-151-0/+1
| | | | | | | | | | | | | | Enable flashing of mtlrvpp_npcx from flash_ec script BUG=b:229073490 BRANCH=none TEST=verify flashing of ec image works on mtlrvpp_npcx Signed-off-by: Brandon Breitenstein <brandon.breitenstein@intel.com> Change-Id: I8a85c53eacbc7b89a5347b06a54aa197e1269600 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3585290 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* ectool: Read bInterfaceNumber correctlyDaisuke Nojiri2022-04-141-1/+2
| | | | | | | | | | | | | | | | This patch makes find_interface_with_endpoint use bInterfaceNumber explicitly instead of the i iterator, which could be different from the discovered interface number if there is no interface at index 0. BUG=b:229012657 BRANCH=None TEST=Run 'ectool -d 18d1:5022 rgbkbd clear 0' on Vell. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I43ccb1ad926b0f699eed22fb2567e6ae6f8e1eaa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3584920 Reviewed-by: Parth Malkan <parthmalkan@google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* zephyr: shim: drop the shim PWM codeFabio Baltieri2022-04-141-0/+1
| | | | | | | | | | | | | | | | | | Drop the shim PWM code, all drivers of Zephyr enable projects are now using the Zephyr PWM APIs. The pwm.c file only contains the PWM host command now, so rename the corresponding Kconfig option and file to reflect that. BRANCH=none BUG=b:217741090 TEST=cq dry run TEST=build and run on brya Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I3837a81be98c4c2a9c2f7ceea24e05fe7940c7d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3578701 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* pinmap: drop named-pwm generation codeFabio Baltieri2022-04-1412-133/+9
| | | | | | | | | | | | | | | All current Zephyr projects code have been converted to use the Zephyr PWM APIs, named-pwm structures are not needed anymore. BRANCH=none BUG=b:217741090 TEST=go test ./... Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I509c5e205d0157abfc301b414492d3fd3ed606c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3575155 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Andrew McRae <amcrae@google.com>
* firmware_builder: Call build_with_clang.py scriptTom Hughes2022-04-121-0/+46
| | | | | | | | | | | | | | | | | | The util/build_with_clang.py script helps us validate that boards that build successfully with clang continue to do so. As compilation errors are fixed for boards, they can be added to the list. The script is called from firmware_builder.py as part of the CQ process. BRANCH=none BUG=b:172020503 TEST=CQ passes Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I8d9384e04dbfc25191d5ebf93425e6d178631168 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3221785 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ectool/battery: Print discharging after the currentDaisuke Nojiri2022-04-091-3/+6
| | | | | | | | | | | | | | | | | | | Currently, battery command prints the charge & discharge current without a sign. This patch makes the command print 'discharging' after the current value for clarification. localhost ~ # ectool battery ... Present current 782 mA (discharging) BUG=b:227275730, b:213130539 BRANCH=None TEST=On Atlas. See above Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ic1c87c721d128eaf25021c077aa6daa18f197fd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3577987 Reviewed-by: Andrew McRae <amcrae@google.com>
* Revert "ectool: Allow a negative value for battery charge rate"Andrew McRae2022-04-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cd70889abfe59865efa29ce47bd1bff11dbb9acd. Reason for revert: ACPI disallows negative rate values Original change's description: > ectool: Allow a negative value for battery charge rate > > A negative value indicates the battery is discharging, so > allow ectool to display it. > > BUG=b:227275730 > TEST=cros deploy dut1 ec-utils > BRANCH=none > > Signed-off-by: Andrew McRae <amcrae@google.com> > Change-Id: I17191691d5e0eb29180cfed39b9991fa48797930 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3555952 > Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Bug: b:227275730 Change-Id: I48913d7947fe1ded0ac45b79a0525427f5cf80d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3577320 Auto-Submit: Andrew McRae <amcrae@google.com> Commit-Queue: Andrew McRae <amcrae@google.com> Tested-by: Andrew McRae <amcrae@google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Peter Marheine <pmarheine@chromium.org>
* test/run_device_tests.py: Add private testsAndrea Grandi2022-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the list of tests is hard-coded in the Python script. Add ability to fetch additional tests from the private folder, if available. This is a reland of commit b97ba790690d1ee86c001ef0a82be5897645ae2f BRANCH=none BUG=b:226385185 TEST=cros lint test/run_device_tests.py TEST=make V=1 run-<private_test> TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost --board=dartmonkey TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost --board=dartmonkey --tests=<private_test> Cq-Depend: chrome-internal:4650299, chrome-internal:4650281, chrome-internal:4650279 Signed-off-by: Andrea Grandi <agrandi@google.com> Change-Id: I67866ced27414d495bfad5eff9825cf68c8c22cf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3562041 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Feels: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Bobby Casey <bobbycasey@google.com> Feels: Bobby Casey <bobbycasey@google.com>
* ec: Delete /dev/shm/EC_persist_* before testsJeremy Bettis2022-04-061-0/+5
| | | | | | | | | | | | | | | | | | Some tests (specifically flash) leave /dev/shm/EC_persist_* files on the disk and the behavior of the test changes when they exist. To get a consistent test, remove the corresponding files before running a host test. BRANCH=None BUG=b:213374060 TEST=Ran flash test 50 times Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I27a92adee1b181fdedf0b75bdd19a39e27bfa6af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3572892 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* ec: Format util/run_host_test for cros lintJeremy Bettis2022-04-061-93/+93
| | | | | | | | | | | | | | | | Make cros lint happy with util/run_host_test BRANCH=None BUG=b:213374060 TEST=cros lint util/run_host_test Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Ie222ffcbe099d2839e9356f74fdc8b852569f275 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3573699 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* tree: Add OWNERS files for fingerprint-related filesTom Hughes2022-04-051-0/+15
| | | | | | | | | | | | | | | There are already OWNERS files for the core fingerprint-related code, but we were missing some utilities and tests. BRANCH=none BUG=b:227673625 TEST=none Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0adf9bebf651ff34eab29d127bf749e4f101405d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3565043 Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Bobby Casey <bobbycasey@google.com>
* zephyr: remove PLATFORM_EC_USB_PD_PORT_MAX_COUNT configDawid Niedzwiecki2022-04-011-0/+1
| | | | | | | | | | | | | | | | The PLATFORM_EC_USB_PD_PORT_MAX_COUNT config can be get based on dts. PLATFORM_EC_USB_PD_PORT_MAX_COUNT equals a number of instances with "named-usbc-port" compatible. BUG=b:176237074 TEST=zmake testall && make buildall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: If66ef429f4b9070e95b9631247423392c811f916 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3539940 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* RGBKBD: Add EC_CMD_RGBKBD commandDaisuke Nojiri2022-03-301-2/+14
| | | | | | | | | | | | | | | | | | Host programs call EC_CMD_RGBKBD to set or get data, config, etc. of an RGB keyboard. This patch adds EC_RGBKBD_SUBCMD_CLEAR sub-command. localhost ~ # ectool --device 18d1:5022 rgbkbd clear 0xff0000 BUG=b:223465912 BRANCH=None TEST=Prism/Vell. See above. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I20013a2b3c7b831ce0f8dcee5833c9c4017795da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3558056 Reviewed-by: caveh jalali <caveh@chromium.org>
* Revert "test/run_device_tests.py: Add private tests"Hsu Wei-Cheng2022-03-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b97ba790690d1ee86c001ef0a82be5897645ae2f. Reason for revert: failed chromeos-fpmcu-unittests Original change's description: > test/run_device_tests.py: Add private tests > > Currently, the list of tests is hard-coded in the Python script. > Add ability to fetch additional tests from the private folder, if > available. > > BRANCH=none > BUG=b:226385185 > TEST=cros lint test/run_device_tests.py > TEST=make V=1 run-<private_test> > TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost > --board=dartmonkey > TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost > --board=dartmonkey --tests=<private_test> > > Cq-Depend: chrome-internal:4633118, chrome-internal:4639001 > Signed-off-by: Andrea Grandi <agrandi@google.com> > Change-Id: I6d84b652d8f0e3d479bb227cbcc25d0b6f8f274b > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3544427 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:227414670, b:226385185 Cq-Depend: chrome-internal:4647165, chrome-internal:4647014 Change-Id: I751a8e0953f6d61a14ff9065ec930bdb774b5364 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3559970 Reviewed-by: David Stevens <stevensd@chromium.org> Reviewed-by: Morg <morg@chromium.org> Owners-Override: Morg <morg@chromium.org> Tested-by: Hsu Wei-Cheng <mojahsu@chromium.org> Commit-Queue: Hsu Wei-Cheng <mojahsu@chromium.org>
* test/run_device_tests.py: Add private testsAndrea Grandi2022-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | Currently, the list of tests is hard-coded in the Python script. Add ability to fetch additional tests from the private folder, if available. BRANCH=none BUG=b:226385185 TEST=cros lint test/run_device_tests.py TEST=make V=1 run-<private_test> TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost --board=dartmonkey TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost --board=dartmonkey --tests=<private_test> Cq-Depend: chrome-internal:4633118, chrome-internal:4639001 Signed-off-by: Andrea Grandi <agrandi@google.com> Change-Id: I6d84b652d8f0e3d479bb227cbcc25d0b6f8f274b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3544427 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* ectool: Allow a negative value for battery charge rateAndrew McRae2022-03-291-3/+2
| | | | | | | | | | | | | | A negative value indicates the battery is discharging, so allow ectool to display it. BUG=b:227275730 TEST=cros deploy dut1 ec-utils BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I17191691d5e0eb29180cfed39b9991fa48797930 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3555952 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* RGBKBD: Add EC_CMD_RGBKBD_SET_COLOR commandDaisuke Nojiri2022-03-291-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | Host programs call EC_CMD_RGBKBD_SET_COLOR to change the LED colors of an RGB keyboard. Example command execution on Vell against Prism: localhost ~ # ectool --device 18d1:5022 rgbkbd 10 0x010203 EC prints: HC resp:080000000002000101000000 HC 0x13a.0:0a01010203 RGBKBD: Set [10,0] to color=[1,2,3] (gid=0 offset=60) BUG=b:223465912 BRANCH=None TEST=Prism/Vell. See above. make run-rgb_keyboard. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ic6235ca575ed488fe166b0873f8a5596c63dc2b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546569 Reviewed-by: caveh jalali <caveh@chromium.org>
* ectool: Add USB interfaceDaisuke Nojiri2022-03-295-3/+409
| | | | | | | | | | | | | | | | | | | | | | | | Currently, ectool doesn't support USB as a host command protocol interface. This patch adds USB to ectool. localhost ~ # ectool --device 18d1:5022 version RO version: prism_v2.0.13019+1b97300a33 RO cros fwid: prism_14581.0.22_03_23 RW version: prism_v2.0.13019+1b97300a33 RW cros fwid: prism_14581.0.22_03_23 Firmware copy: RW Build info: prism_v2.0.13019+1b97300a33 prism_14581.0.22_03... Tool version: 1.1.9999-f8ebe02 @localhost BUG=b:211496726 BRANCH=None TEST=See above. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Iee4bbeb745e26ec3236233487ac4e8adcd1fb038 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546567 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* util: Increase buffer size to account for terminating NULTom Hughes2022-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | When building with clang it warns: util/ecst.c:464:7: error: 'sscanf' may overflow; destination buffer in argument 3 has size 20, but the corresponding specifier may require size 21 [-Werror,-Wfortify-source] main_str_temp) != 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: I0556973263ce2b220e64640e585997c44324db55 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3551680 Reviewed-by: Edward Hill <ecgh@chromium.org>
* util/flash_ec: Add better error message when WP is onRobert Zieba2022-03-231-1/+19
| | | | | | | | | | | | | | | | | Currently when flashing npcx ECs this tool will fail with "Failed to load monitor binary" when WP is enabled. This commit adds logic to check if WP is enabled and give a more informative error message when flashing fails because of that. BRANCH=none BUG=b:210645611 TEST=Ran flash_ec with WP on and verified that the correct error message is displayed Signed-off-by: Robert Zieba <robertzieba@google.com> Change-Id: I08aa69ef3d7bc94fe3958d8d3bc58a967e4902b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3536607 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: add support for CONFIG_BC12_DETECT_DATA_ROLE_TRIGGERKeith Short2022-03-211-1/+0
| | | | | | | | | | | | | | | The config option CONFIG_BC12_DETECT_DATA_ROLE_TRIGGER is unconditionally enabled in the legacy EC code when using the PI3USB9201 BC1.2 chip. Add an equivalent Kconfig option. BUG=b:215776286 BRANCH=none TEST=Connect DCP device, verify charging at 1.5 A Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Idd762d8801ad7e62c02e36c892d5e49a01068d92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3536624 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* flash_fp_mcu: Add power en gpio on strongbadStephen Boyd2022-03-181-3/+8
| | | | | | | | | | | | | | | There's a gpio for the power enable signal in the latest revision of the hardware (i.e. not rev0/rev1). Search for the gpio by name and use -1 if it fails. BRANCH=none BUG=b:179839337 TEST=flash_fp_mcu on coachz (rev1/rev3) Change-Id: I047236bd9a7bd3b34f2771576ff2b31952e0b094 Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3534745 Reviewed-by: Alexandru Stan <amstan@chromium.org>
* pinmap: Optionally use column to select pinsAndrew McRae2022-03-166-20/+36
| | | | | | | | | | | | | | Instead of using the chip name, optionally use a column designator to select the pins to process. BUG=b:221764513 TEST=go test ./...; regenerate DTS BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I4d056826f3768b34abb6ac3efcf916e48a76b2ab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3522250 Reviewed-by: Eizan Miyamoto <eizan@chromium.org>
* ec/util: Add support for EC flashing/debugging through OpenOCDrobertzieba@google.com2022-03-154-0/+352
| | | | | | | | | | | | | | | | | | The existing flash_ec script does have support for OpenOCD, however it also requires running servo as well. And it does not support the NPCX99nf line of microcontrollers, nor does it support directly flashing NPCX devices. This change adds a ec_openocd.py script that serves as a wrapper around OpenOCD and gdb to make it easy to perform flashing and debugging through OpenOCD. BUG=b:208517780 BRANCH=none TEST=Verified that flashing and debugging worked as expected Change-Id: I8f4e127ada871f31840b07d20855cb2aa4d9cc54 Signed-off-by: robertzieba@google.com <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3498594 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ectool: support dps enable/disable commandEric Yilun Lin2022-03-151-0/+34
| | | | | | | | | | | | | | | | Support dps host command for factory test. BUG=b:223937130 TEST=ectool usbpddps disable|enable BRANCH=cherry Change-Id: I050c724b5caab41644248a6f72704edbc76554a0 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3522247 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Rong Chang <rongchang@chromium.org> Commit-Queue: Rong Chang <rongchang@chromium.org>
* zephyr: support smart USB-A port controlPeter Marheine2022-03-151-4/+0
| | | | | | | | | | | | | | | | | | | | | This enables support for "smart" USB-A ports in addition to the existing "dumb" support, allowing one of them to be selected as well as implementing kconfig support for most of the other options for "smart" ports. For existing boards that enabled USB-A support with the default "dumb" support, their configuration is changed to specifically select that mode because the new choice option cannot have a default. BUG=b:223937974 TEST="smart" port control can be turned on for Nereid BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: If5b0fb393451d31a937c73be2aa3b9623c69307f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3517929 Reviewed-by: Andrew McRae <amcrae@google.com>
* zephyr: tcpm: Add support for FUSB302 Type-C controllerRajesh Kumar2022-03-111-1/+0
| | | | | | | | | | | | | | This add zephyr support for Fairchild's FUSB302 Type-C controller BUG=b:218684235 BRANCH=none TEST=zmake testall Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Change-Id: I1a55e26021552de8b607e91dd20c901ef2f06844 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3485226 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* Banshee:implement LED behaviorLeo-Tsai2022-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement side charger LED and Power breath LED behavior. Power LED: S0 - On S3 - Breath 0.5Hz - Max duty (percentage) = 55 - Fade time (second) = 550ms(In) / 550ms(Out) - Duration time (second) = 500ms - Interval time (second) = 2000ms S5 - Off Charge LED: Charge - Amber Full Charge - Green Low battery - Blink Red Battery error - Blink Red BUG=b:208182468,b:220954645 BRANCH=brya TEST=build make -j BOARD=Banshee pass, verified the side charger LED is working and s0ix can show breath LED Signed-off-by: Leo-Tsai <leocx_tsai@compal.corp-partner.google.com> Change-Id: If58fd9e123c4096c840a8e8b5009f8f1bc5ef39f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3506045 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>