summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
...
* zephyr: add InvenSense sensorsKeith Short2021-07-121-0/+1
| | | | | | | | | | | | | | | | Add Kconfig options for the InvenSense sensor drivers ICM426xx and ICM42607. This also creates config option for CONFIG_ACCELGYRO_ICM42607 which was missed when the driver was first created (CL:2822268). BUG=b:193195946 BRANCH=none TEST=zmake testall TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I422071e749ee2e8ed3ac1997aa886ee78395d37e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3015867 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: add CONFIG_CMD_MFALLOW to allow listKeith Short2021-07-091-0/+1
| | | | | | | | | | | | | | | | The config checking script doesn't correctly recognize Kconfigs for console commands (b/190514502). Add CONFIG_CMD_MFALLOW to the allow list to get rid of non-fatal errors reported in the CQ. BUG=b:193195946 BRANCH=none TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I53aafe433fd176bc968eaf0328d13a0dba959155 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3018171 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* ectool: fixup the error for chargecontrol normal|idle|dischargeZhuohao Lee2021-07-021-0/+1
| | | | | | | | | | | | | | | | We added the EC_CHARGE_CONTROL_CMD_SET and EC_CHARGE_CONTROL_CMD_GET in the http://crrev/c/2929340. However, the ectool missed to set the p.cmd to EC_CHARGE_CONTROL_CMD_SET before calling the host command. This patch adds the p.cmd to fix it. BUG=b:183679223 BRANCH=main TEST=`ectool chargecontrol normal|idle|discharge` is working Change-Id: I6e07801bb9e39f67165cb18a237c459b98c6d356 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3003003 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util: Add verbose option to run_host_testDaisuke Nojiri2021-06-281-1/+3
| | | | | | | | | | | | | | | | Currently, run_host_test prints console output only if the test fails. This patch adds '--verbose' (-v) option, which forces the script to print console output. BUG=None BRANCH=None TEST=run_host_test -v sbs_charging_v2 TEST=run_host_test -h Change-Id: Ic5f981c53433ee448cd0b785f8f1f4ff648ac02d Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2987735 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* stm32: rename CONFIG_STM32_SPI1_MASTER to …CONTROLLERHarry Cutts2021-06-251-1/+1
| | | | | | | | | | | | | In line with OSHWA terminology. BUG=b:181607131 TEST=make -j BOARD=hammer BRANCH=none Change-Id: I6d212e60d5aceb8497f00520b693006cc1af2d45 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981123 Reviewed-by: caveh jalali <caveh@chromium.org>
* Update EC_CMD_CHARGE_CONTROL to version 2Daisuke Nojiri2021-06-251-7/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Version 2 of EC_CMD_CHARGE_CONTROL can control battery sustainer. It allows the host to set the upper and lower thresholds between which the EC tries to keep the battery state of charge. Version 2 of EC_CMD_CHARGE_CONTROL also supports 'GET' request. It allows the host to query the current charge control settings. localhost ~ # ectool chargecontrol Charge mode = NORMAL (0) Battery sustainer = off (-1% ~ -1%) localhost ~ # ectool chargecontrol normal 66 66 Charge state machine is in normal mode with sustainer enabled. localhost ~ # ectool chargecontrol Charge mode = NORMAL (0) Battery sustainer = on (66% ~ 66%) localhost ~ # ectool chargecontrol normal Charge state machine is in normal mode. BUG=b:188457962 BRANCH=none TEST=Atlas. See above. Change-Id: I81ec62172b4f159c46334fc0f940a2adae3f2b8a Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2929340 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Remove options now in Kconfig from config_allowed.txtHarry Cutts2021-06-231-18/+0
| | | | | | | | | | | BUG=none TEST=none BRANCH=none Change-Id: I6a8365564a7633b7dde5621e744d314f3eca542f Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981122 Reviewed-by: Diana Z <dzigterman@chromium.org>
* ectool: Fix array size check for pchg_state_textDaisuke Nojiri2021-06-211-1/+3
| | | | | | | | | | | | | | This patch fixes the runtime check for pchg_state_text size and adds BUILD_ASSERT. BUG=b:182600604, b:173235954 BRANCH=none TEST=Verify 'ectool pchg 0' prints states properly on CoachZ. Change-Id: Id6c6bfb979dbb4f11b1ee3dcaa0b7dc0710dfc54 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2973571 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* PCHG: Fix potential error=maybe-uninitialized in cmd_pchg_update_writeDaisuke Nojiri2021-06-161-2/+2
| | | | | | | | | | | | | | | | block_size is necessarily initialized if cmd_pchg_update_open returns 0. Thus, it shouldn't cause error=maybe-uninitialized. This patch explicitly initializes it to 0 in case a (incapable) compiler complains about it. BUG=b:182600604, b:173235954 BRANCH=none TEST=make utils-host Change-Id: Ifff972c32007a573ac7cf759387edeb382dccaa4 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2966802 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* config: Rename CONFIG_CROS_BOARD_INFOPhilip Chen2021-06-161-1/+0
| | | | | | | | | | | | | | | | | | Rename CONFIG_CROS_BOARD_INFO to CONFIG_CBI_EEPROM to make it clear that the information comes from on-board EEPROM. It sets up the groundwork for adding more options of CBI sources later. BRANCH=None BUG=b:186264627 TEST=make buildall -j Signed-off-by: Philip Chen <philipchen@google.com> Change-Id: I9a6feee0a8b35bbf29e445544243485507767ad8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2945792 Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* PCHG: Flash multiple binaries in one update sessionDaisuke Nojiri2021-06-141-39/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CTN730 firmware consists of separate binaries and currently each binary is flashed in a separate session. This does not work if two binaries need to be updated at the same time because each session writes a new version (after closing the session) and CTN730 refuses to open a session if the version number is the same. This patch makes ectool write multiple binaries in one update session. Example session: localhost ~ # ectool pchg 0 update 0x1041 0x201200 /tmp/user_ee.bin \ 0x207000 /tmp/WLC_Host_UserApp_CRC.bin Opened update session (port=0 ver=0x1041 bsize=128): Writing /tmp/user_ee.bin (3072 bytes). ******************************************************************** Writing /tmp/WLC_Host_UserApp_CRC.bin (90624 bytes). ******************************************************************** Firmware is updated successfully (CRC32=0x5ef03e4d). localhost ~ # ectool pchg 0 reset Reset port 0 complete. localhost ~ # ectool pchg 0 State: ENABLED (2) Battery: 0% Errors: 0x0 FW Version: 0x1041 Dropped events: 0 BUG=b:182600604, b:173235954 BRANCH=trogdor TEST=See the description above. Change-Id: I554ae560947e896ae73979c85d637f32d3e114af Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2952836 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* flash_ec: support servo_v4p1_with_servo_microEric Yilun Lin2021-06-121-5/+7
| | | | | | | | | | | | | | | | | | There were some glob issues in the code so it can't flash with the servo_v4p1_with_servo_micro config. BUG=none TEST=flash_ec to hayato with servo_v4p1_with_servo_micro and servo_v4_with_servo_micro BRANCH=none Change-Id: If8fcb3046e4eeb492eac3a981484b7fbc276bcf5 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954985 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com>
* flash_fp_mcu: Add debug spi bytes activityCraig Hesling2021-06-121-0/+33
| | | | | | | | | | | | | | | | | | | | In an effort to understand why we see "Device or resource busy" when binding the raw spidev driver, we add a few byte count prints to indicate if spi activity occurred between certain operations. This should be removed when a fix for the linked bug is determined. BRANCH=none BUG=b:190744837 TEST=# On Hatch and Zork scp util/flash_fp_mcu ${DUT_HOSTNAME}:/usr/local/bin/flash_fp_mcu ssh ${DUT_HOSTNAME} flash_fp_mcu --hello Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I400ca76ee3451f1e155d7912a7c25613d9f68846 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954304 Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
* flash_fp_mcu: Abort if raw driver bind failsCraig Hesling2021-06-121-0/+5
| | | | | | | | | | | | | | | | This helps simplify the errors being reported. BRANCH=none BUG=b:190744837 TEST=# On Hatch and Zork scp util/flash_fp_mcu ${DUT_HOSTNAME}:/usr/local/bin/flash_fp_mcu ssh ${DUT_HOSTNAME} flash_fp_mcu --hello Change-Id: I74d57ec0d7fc4bda3fae144fe649124af5c61ba9 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954919 Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
* zephyr: remove entries from config_allowedKeith Short2021-06-091-2/+0
| | | | | | | | | | | | | | | Remove config entries CONFIG_I2C_VIRTUAL_BATTERY (fixed) and CONFIG_SPI_MASTER (obsolete) from the config_allowed.txt list. BUG=none BRANCH=none TEST=zmake testall TEST=make BOARD=volteer Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I660fd460ff0c95b6de911d1d2324bff004660984 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2946965 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: Add CONFIG_PLATFORM_EC_CONSOLE_CHANNELKeith Short2021-06-091-1/+0
| | | | | | | | | | | | | | | | | Add a KConfig option to enable/disable the CONFIG_CONSOLE_CHANNEL option. Enabled by default, but can be turned off to save code space. BUG=b:180421120 BRANCH=none TEST=zmake testall TEST=Boot lazor, verify 'chan' command is present or not based on this config. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9f5f10582ef6161a38bb2f5f7f48bae631ba9cf6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2946964 Commit-Queue: Wai-Hong Tam <waihong@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Revert "Homestar:LED:LED function realization"Aseda Aboagye2021-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8aacd88a332b9903334e0bb3bf586560fdc5883a. Reason for revert: Orange is the same as amber, so the ectool and ec_commands.h portions were not needed. Original change's description: > Homestar:LED:LED function realization > > BUG=b:187539586 > TEST=make -j BOARD=homestar > Verify build on EVT board > BRANCH=Trogdo > > Signed-off-by: tongjian <tongjian@huaqin.corp-partner.google.com> > Change-Id: I9c77b60e11135df5e289ef32adfe34fef3134760 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2915162 > Reviewed-by: Wai-Hong Tam <waihong@google.com> Bug: b:187539586 Change-Id: Ic096dec630bcdcde17a3611f8414d88808d09469 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2947488 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
* flash_fp_mcu: Add a config for the Brya fingerprint MCUZhuohao Lee2021-06-071-0/+21
| | | | | | | | | | | | | | | | To enable the fingerprint MCU firmware update, we add the config for the Brya. BUG=b:181635081 BRANCH=None TEST=use 'flash_fp_mcu ${BINARY_PATH}', the firmware is programmed correctly. Change-Id: Ic54b9bb25a7b21a871445a7052d605041e1c79d2 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2944308 Reviewed-by: Alex Levin <levinale@google.com> Commit-Queue: Alex Levin <levinale@google.com>
* COIL: Rename CONFIG_SPI_MASTER to CONFIG_SPI_CONTROLLERCaveh Jalali2021-06-031-0/+1
| | | | | | | | | | | | | | | | This replaces the CONFIG_SPI_MASTERR config option with CONFIG_SPI_CONTROLLER. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: I3c921085179294765baadf7074652978fe04a4ed Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932465 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* zephyr: Remove a few configs from allowlistPhilip Chen2021-06-031-2/+0
| | | | | | | | | | | | | | | | | | CONFIG_TABLET_MODE_SWITCH is already in zephyr Kconfig. CONFIG_TABLET_SWITCH is not a valid EC config. Remove them from config_allowed.txt. BRANCH=None BUG=None TEST=make buildall Change-Id: I36cd880e7b9f8df0a30503829dd46abcc2f54e07 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2935058 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* COIL: Remove CONFIG_SPI_MASTER_NO_CS_GPIOSCaveh Jalali2021-06-031-1/+0
| | | | | | | | | | | | | | This removes the CONFIG_SPI_MASTER_NO_CS_GPIOS config option as no code actually uses it. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: Iab1c7a79ee0ad973605c768f87ad8e19ed6ef4e7 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932470
* COIL: Remove CONFIG_SPI_MASTER_CONFIGURE_GPIOSCaveh Jalali2021-06-031-1/+0
| | | | | | | | | | | | | | This removes the CONFIG_SPI_MASTER_CONFIGURE_GPIOS config option as no code actually uses it. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: I4083a0ed1b106f9dcf0534625da5286dc0c34552 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932469
* COIL: Remove CONFIG_SPI_MASTER_PORTCaveh Jalali2021-06-031-1/+0
| | | | | | | | | | | | | | | This removes the CONFIG_SPI_MASTER_PORT config option as no code actually uses it. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: Iddcfa2b36e4100063bb6ad36941f09ac56b0be94 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932468 Reviewed-by: Harry Cutts <hcutts@chromium.org>
* Remove CONFIG_BATTERY_DEAD_UNTIL_VALUEDaisuke Nojiri2021-06-011-1/+0
| | | | | | | | | | BUG=none BRANCH=none TEST=buildall Change-Id: Iebf0817c1b605d74348c9b20c01df74bd69468d2 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2929338
* flash_fp_mcu: Add automatic service stop/restartCraig Hesling2021-06-011-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The normal invocation of flash_fp_mcu is without biod and timberslide being stopped. This is a problem, since this script unbinds/bind drivers that biod and timberslide have open and can interact with. BRANCH=none BUG=b:188985272 b:181635081 TEST=# On Nocturne scp util/flash_fp_mcu dut1:/usr/local/bin/flash_fp_mcu ssh dut1 flash_fp_mcu --hello # Ensure that the biod and timebrslide were stopped and restarted. # No warnings about other services having files open should occur. ssh dut1 flash_fp_mcu --noservices --hello # Ensure that no services were stopped/started and a warning should # be emitted about processes with the device file open. ssh dut1 flash_fp_mcu --noservices --hello # Should see that the warnings shown now show that the open file # was deleted. Cq-Depend: chromium:2918383, chromium:2918638 Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I021b922fb58defcbe608492239e311a5f5296fca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2914502 Reviewed-by: Josie Nordrum <josienordrum@google.com>
* util: Make a start on writing a Python-based CONFIG checkerSimon Glass2021-05-272-0/+363
| | | | | | | | | | | | | | | | | | Add a new class which can handle the operations required to check that new ad-hoc CONFIGs are not added to the source tree. More work is needed in future CLs: - building the list of allowed CONFIGs - plumbing it into the build and removing the existing shell scripts BUG=b:181323955 BRANCH=none TEST=python3 util/test_kconfig_check.py Change-Id: Icec295effc4bf3c7b644f671b0cb83dcb0c97b68 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2864428 Reviewed-by: Yuval Peress <peress@chromium.org>
* base_state: implement basestate host commandTing Shen2021-05-271-0/+32
| | | | | | | | | | | | | | | | | | | | | This CL introduces an unified method to force base attach/detach, to deprecate the hard-coded gpio pin name table in hammerd/hammertests/common.py. Also modifies base_force_state to use the same parameter type as host command. BUG=b:188625010 TEST=manually, run `ectool basestate attach|detach|reset` on coachz BRANCH=trogdor,kukui Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I5235661727cbbd15015c49d588ec70605e4a33e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2910472 Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* flash_fp_mcu: Add warnings for conflicting processesCraig Hesling2021-05-271-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BRANCH=none BUG=b:188985272 b:181635081 TEST=# Run with biod start on helios scp util/flash_fp_mcu root@${DUT}:/usr/local/bin/flash_fp_mcu flash_fp_mcu --hello # Ensure warning triggered. stop biod stop timberslide LOG_PATH=/sys/kernel/debug/cros_fp/console_log flash_fp_mcu --hello # Ensure no warnings are shown echo spi-PRP0001:02 >/sys/bus/spi/drivers/cros-ec-spi/unbind flash_fp_mcu --hello # Ensure the warning about cros-ec driver not being bound was # emitted # Bind raw driver and hold it open echo spi-PRP0001:02 >/sys/bus/spi/drivers/cros-ec-spi/unbind echo spidev >/sys/bus/spi/devices/spi-PRP0001\:02/driver_override echo spi-PRP0001:02 >/sys/bus/spi/drivers/spidev/bind exec 10<>/dev/spidev1.1 flash_fp_mcu --hello # Ensure warnings about cros-ec bound + raw bound + raw file open # are emitted. Change-Id: I1dded083ad158307ec54866952cf3ed59f30caf5 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2912371
* zephyr: Add IT8XXX drivers to KconfigMichał Barnaś2021-05-261-3/+0
| | | | | | | | | | | | | | | | | | | | There was no possibility to use ITE_ON_CHIP in zephyr. This commit adds possibility to use it as TCPM. It adds also Kconfigs for IT8XXX2 and IT83XX drivers BUG=b:182500469 BRANCH=none TEST=Manipulate prj.conf to check if drivers are compiled: PLATFORM_EC_USB_PD_TCPM_ITE_ON_CHIP=y PLATFORM_EC_USB_PD_TCPM_DRIVER_IT83XX=y PLATFORM_EC_USB_PD_TCPM_DRIVER_IT8XXX2=y Try building with different options. Eg. enabling drivers without using ITE_ON_CHIP should change nothing in build. Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: I31a9a6899123b855ed82d92b46f023db77714b5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2919909 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Homestar:LED:LED function realizationtongjian2021-05-261-1/+1
| | | | | | | | | | | | BUG=b:187539586 TEST=make -j BOARD=homestar Verify build on EVT board BRANCH=Trogdo Signed-off-by: tongjian <tongjian@huaqin.corp-partner.google.com> Change-Id: I9c77b60e11135df5e289ef32adfe34fef3134760 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2915162 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* flash_fp_mcu: Add defaults for image file argCraig Hesling2021-05-251-7/+38
| | | | | | | | | | | | | | | | | | | | | | | This simplifies instructions where we mention using flash_fp_mcu to remove sw write protect and reduces complexity of integration tests that need to put the fpmcu into a working state. It also just makes it easier to use when debugging. BRANCH=none BUG=none TEST=flash_fp_mcu TEST=flash_fp_mcu -r TEST=flash_fp_mcu --hello TEST=# Dratini touch /opt/google/biod/fw/bloonchipper-2.bin flash_fp_mcu # should fail Change-Id: I8a00500fde15d7599596039f1a96fed599874164 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2870945 Reviewed-by: Patryk Duda <patrykd@google.com>
* qcom: Create new configs for SC7280Wai-Hong Tam2021-05-181-0/+1
| | | | | | | | | | | | | | | Create new configs (Chromium EC namespace and Zephyr namespace) for SC7280. In this state, SC7280 power sequence has no difference from SC7180. BRANCH=None BUG=b:187980397 TEST=Built all the Chromium EC images and Zephyr EC images. TEST=Modify a board to use the new CONFIG. Change-Id: I178b8ffa5d79d3828baf222ac77906ab2262cf76 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2893069
* driver: add ICM-42607 driver supportJuHyun Kim2021-05-181-0/+3
| | | | | | | | | | | | | | | | | Add ICM-42607 accel/gyro driver code. BUG=chromium:1198171 BRANCH=None TEST=ectool motionsense && CROS-EC IIO drivers Signed-off-by: JuHyun Kim <jkim@invensense.com> Change-Id: If2cff2bd20ac69ca40bc56af50dcabbd4f5910d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2822268 Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org>
* zephyr: Remove CONFIG_VBOOT_HASH_RELOAD_WATCHDOG from allowed configsMichał Barnaś2021-05-181-1/+0
| | | | | | | | | | | | | | | | After removing CONFIG_VBOOT_HASH_RELOAD_WATCHDOG it is no longer needed to be listed in util/config_allowed.txt BRANCH=none BUG=b:182499153 TEST=Build cros EC and zephyr without errors Change-Id: I65db5e960688075f24cfa52b970762edafa93223 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2897241 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* ectool: Make i2cread/write address print consistentRob Barnes2021-05-131-12/+11
| | | | | | | | | | | | | | | | | | ectool i2cread and i2cwrite expect an 8-bit address as input. However the output prints a 7-bit address. This is confusing for ectool users. This CL changes the output to be the 8-bit address. i2cxfer expects a 7-bit address and is unaffected by this CL. BUG=b:187811828 TEST=ectool i2cread 8 1 0x52 0 Read from I2C port 1 at 0x52 offset 0x0 = 0x10 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I71596080200d9ee08b23536d233cf34d958bf9b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2887555 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* util: Add explicit castsTom Hughes2021-05-0611-59/+75
| | | | | | | | | | | | | | When compiling with C++, the implicit casting that is performed in C is disallowed. Add casts in preparation for C++ compatibility. BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I5c25440819428db65225c772c1c5115a735db58a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2864519 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* I/O Expander: Add CCG6XX driverVijay Hiremath2021-05-051-0/+1
| | | | | | | | | | | | | | | Cypress CCGXXF PD has built-in I/O Expander, added driver to enable GPIO functionality. BUG=none BRANCH=none TEST=Tested on ADLRVP, ioexget & ioexset works as expected Change-Id: I8503178703ad166ac77e96d1990133c88169d23a Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2853143 Tested-by: Svyatoslav Paliy <svpaliy@gmail.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* util/ectool: Add constTom Hughes2021-05-041-1/+1
| | | | | | | | | | | BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Id2726e28678066f46fe7437d4e66916d05ffdf47 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2870386 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* util/ectool: Use UINT32_MAX instead of -1Tom Hughes2021-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | When compiling with C++, the conversion from "int" to "unsigned int" generates a compiler error: util/ectool.cc:5545:19: error: constant expression evaluates to -1 which cannot be narrowed to type 'uint32_t' (aka 'unsigned int') [-Wc++11-narrowing] .number_data = -1, ^~ BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: If810a0f68cfdf09c3ca44a7e9233006cad188e39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2870385 Reviewed-by: Diana Z <dzigterman@chromium.org>
* util/ectool: Fix compiler warningTom Hughes2021-05-041-1/+3
| | | | | | | | | | | | | | | | | When compiling with C++, the original code generates the following error: error: initializer-string for char array is too long .buf = "0123456789abcdef0123456789ABCDEF" BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ibf599d72d6c9308f10131edfb5a796a416574e6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2864517 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* util/ec_sb_firmware_update: Make types matchTom Hughes2021-05-031-1/+1
| | | | | | | | | | | | | | dump_data is called with "char *" arguments, but the the argument the function took was a "uint8_t *". Fix it to be consistent. BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I772d58935280da6c9375feea407191bc5ab8b46e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2864514 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* util/ec_sb_firmware_update: Add NULL checkTom Hughes2021-05-031-0/+3
| | | | | | | | | | | BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I9793e7448b8a36e32209a3cd76f0f24af20eb64b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2869129 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* util/ectool: Initialize enum with correct typeTom Hughes2021-05-031-1/+2
| | | | | | | | | | | | | | | | | When compiling with C++, the original code fails with: error: cannot initialize a variable of type 'enum sysinfo_fields' with an rvalue of type 'int' enum sysinfo_fields fields = 0; BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I3920db2d2dac426e5514657f8499dda6b66e65a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2864518 Reviewed-by: Keith Short <keithshort@chromium.org>
* util/comm-i2c.c: Remove incorrect castTom Hughes2021-05-031-2/+2
| | | | | | | | | | | | | | buf is type "uint8_t *", not "char *". BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0e813069f164b08324844009cd64d470b7d35405 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2864516 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util: Add constTom Hughes2021-05-034-6/+7
| | | | | | | | | | | | BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I60f5f9211fb48391c1595a6a796596fa4471025f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2864515 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* flash_fp_mcu: Remove coachz driver gpio override hackCraig Hesling2021-05-031-8/+0
| | | | | | | | | | | | BRANCH=none BUG=b:179530529 TEST=# Tested many times using flash_fp_mcu --hello Change-Id: I33e1000e9e2d24e5580ab4a88ad7b5f1f0fd899c Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2865034 Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* flash_fp_mcu: Make exit status more distinctiveCraig Hesling2021-05-031-15/+23
| | | | | | | | | | | | | | | | | | | | | This helps with parsing errors in tast. BRANCH=none BUG=none TEST=# dut1 is a dratini device scp util/flash_fp_mcu dut1:/usr/local/bin/flash_fp_mcu ssh dut1 flash_fp_mcu --hello; echo "Status $?" # Should exit with 0 ssh dut1 touch /tmp/exists ssh dut1 flash_fp_mcu -r /tmp/exists; echo "Status $?" # Should exit with 5 TEST=# Really stared at the code to make sure it looks right. Change-Id: I1f525b99334ea3ff866fca35112119604866f939 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2862548 Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* flash_fp_mcu: Factor out gpio chip checkCraig Hesling2021-05-011-22/+13
| | | | | | | | | | | | | | | | | | This somewhat simplified the exit on failure. It is possible that future gpio systems won't use this interface, but can still be conveyed through variable configs. BRANCH=none BUG=none TEST=# dut1 is a dratini device scp util/flash_fp_mcu dut1:/usr/local/bin/flash_fp_mcu ssh dut1 flash_fp_mcu --hello; echo "Status $?" Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Icd163b59f08d8366be08ea9f3ee2726be0f3185b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2862547 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* zephyr: Cleanup config allowlist entriesKeith Short2021-04-301-194/+0
| | | | | | | | | | | | | | | Run "./util/build_allowed.sh -u" to remove CONFIG_ entries that have a Kconfig option created. BUG=b:184037201 BRANCH=none TEST=make buildall TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ifb2f29774b80772c174dbc92c29bdcb2aba3df6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2860986 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: fix namespace for Kconfig check scriptsKeith Short2021-04-302-7/+17
| | | | | | | | | | | | | | | | | | | Update both the scripts used to verify that ad-hoc CONFIG options have a Kconfig option to use the same search criteria. The list of Kconfigs is now all option that start with the config or menuconfig keyword. The full Kconfig list is transformed to replace CONFIG_PLATFORM_EC_ with CONFIG_, to match the Chromium EC namespace. BUG=b:184037201 BRANCH=none TEST=make buildall TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I5edeeddd4e935b4bbf2ce7321a19249a543d916e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2860985 Reviewed-by: Simon Glass <sjg@chromium.org>