summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* flash_ec: Add adlrvpp_npcx to NPCX internal SPI arrayVijay Hiremath2021-08-181-0/+1
| | | | | | | | | | | | | | | ADLRVP does not have standard overlays to program EC hence added adlrvpp_npcx board to NPCX internal SPI array. BUG=b:196998258 BRANCH=none TEST=Below command flashes NPCX MECC on ADLRVP ./util/flash_ec --board=adlrvpp_npcx Change-Id: I132aa21a0bed533c61cc8f2edf159c95774cad0b Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3102298 Reviewed-by: caveh jalali <caveh@chromium.org>
* flash_ec: add array for boards which use NPCX internal SPIVijay Hiremath2021-08-181-0/+7
| | | | | | | | | | | | | | | Created array for the NPCX internal SPI for the boards which do not use standard overlays. BUG=none BRANCH=none TEST=Able to flash npcx9m3f using MECC AIC on ADLRVP Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Change-Id: I57e4909f0b487b0efa4a3fa26f8b3d5465267dd7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3101842 Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com> Reviewed-by: caveh jalali <caveh@chromium.org>
* console: Fix logs printed for some commandsLukasz Hajec2021-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | E.g. in servod console there is always 'Disabling uart timestamps.' printed, no matter what we enter to dut-control - on/off. This patch fixes that issue. BRANCH=none BUG=b:173654272 TEST=Perform manual testing: "sudo servod --board=nocturne" "dut-control cr50_uart_timestamp:on" "dut-control cr50_uart_timestamp:off" observe proper logs in servod console. Signed-off-by: Lukasz Hajec <lha@semihalf.com> Change-Id: I52cde5e4a9cd70fdc3e9d9513f8aa4126c5f09f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077540 Reviewed-by: Michał Barnaś <mb@semihalf.com> Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* zephyr: shim: add CONFIG_HOSTCMD_DEBUG shimDenis Brockus2021-08-121-1/+0
| | | | | | | | | | | | | | | BUG=b:195948807 BRANCH=none TEST=zmake configure -b $PROJ_HAYATO Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I6de387725db11ad00356c7cf47cb9c0e2e109652 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3087619 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* mchp: Optimize spi_flash_read() APImartin yan2021-08-061-0/+1
| | | | | | | | | | | | | | | | | | Optimize SPI flash read timing, MEC172x QMSPI controller controls CS# by hardware, it will add several system clock cycles delay between CS deassertion to CS assertion at the start of the next transaction, this guarantees SPI back to back transactions, so 1ms delay can be removed to optimze timing. BUG=none BRANCH=none TEST=Tested on ADL RVP and MCHP1727 MECC system via FAFT ECBootTime job save 720ms as EC performs 180KB RW code's SHA256 hash computation Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I5cf9c668efb1cd008b91cdd8aa09f7351c017af0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3074767 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Drop some obsolete boardsJack Rosenthal2021-08-051-5/+1
| | | | | | | | | | | | | | | | | | | | | samus: AUE in M91, M92 pushed to stable already samus_pd: samus pd chip dragonegg: canceled cheza: canceled flapjack_scp: flapjack was canceled atlas_ish: atlas shipped, but ish project canceled sklrvp,glkrvp: these are pretty old intel reference boards and the portage overlays were already deleted ... assume nobody needs the EC firmware anymore either BUG=none BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I794867ac82f37ffa2267e2e59ac02bc381688c57 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3069716 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* flash_fp_mcu: Add FPMCU power cycleCraig Hesling2021-08-051-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a workaround for the dartmonkey RO flash init bug, where a boot loop occurs when HW-WP is disabled, but SW-WP is still enabled. We force a true power-on-reset so that flash init function in RO sees that SW-WP cannot be removed (and is "stuck"). BRANCH=none BUG=b:146428434,b:187387061,b:143374692 TEST=# Test on helios, bard, and nocturne scp util/flash_fp_mcu ${DUT_HOSTNAME}:/usr/local/bin/flash_fp_mcu ssh ${DUT_HOSTNAME} ectool --name=cros_fp reboot_ec ssh ${DUT_HOSTNAME} ectool --name=cros_fp uptimeinfo # No power-on reset flag should be set. ssh ${DUT_HOSTNAME} flash_fp_mcu # Check that power-on reset flag is set. # If you were to check the uptimeinfo after flash_fp_mu # finished, you would see a few seconds later that the # power-on flag is gone. This is because biod's startup # would reinitialize entropy and cause reset. TEST=# Test on morphius scp util/flash_fp_mcu ${DUT_HOSTNAME}:/usr/local/bin/flash_fp_mcu ssh ${DUT_HOSTNAME} flash_fp_mcu # Just make sure we didn't break the script. Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ib8e239c6c0d5e5de66da2e664374a80479eb4098 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3032665 Commit-Queue: Josie Nordrum <josienordrum@google.com> Reviewed-by: Josie Nordrum <josienordrum@google.com>
* COIL: Change host interface option to CONFIG_HOSTCMD_SHIKeith Short2021-08-031-1/+1
| | | | | | | | | | | | | | Update SPI host interface config option for inclusive language. BUG=b:163885307 BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I808d5960fa3e746626465bedc626a95e0f0aaa3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3066271 Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* pylintrc: Copy Chromium OS platform2's configCraig Hesling2021-08-024-0/+17
| | | | | | | | | | | | | | | | | | | | This requests that cros lint (and repo upload hook) use the new Chromium OS 4 space indent policy. Since legacy python scripts still use 2 space, I added pylint ignore statements to the individual files to disable indentation checking. Note: There are still valid pylint errors in some of these legacy scripts. BRANCH=none BUG=none TEST=cros lint util/*.py Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I439f5a87bc50f1f43a4996e574bbc0626922a88e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3064761 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* util: Add keeby-relevant-paths.txtAseda Aboagye2021-07-301-0/+1
| | | | | | | | | | | | | | | | | Keeby is largely based off of dedede so add a relevant paths file which is just a symlink to dedede's file. BUG=None BRANCH=keeby TEST=Check symlink points to dedede's file. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Ib347e4a2311cbbb94f4689ed967b9806bea3ed5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3063979 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* config: Delete obsolete configsKeith Short2021-07-301-6/+0
| | | | | | | | | | | | | | | | | | | | | Delete the following configs which are no longer referenced by any source files: CONFIG_CMD_FLASH_LOG CONFIG_CMD_GSV CONFIG_CMD_GSV CONFIG_CMD_LID_ANGLE CONFIG_CMD_PMU CONFIG_CMD_USBMUX BUG=none BRANCH=none TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ia304f0579d991a0fccc7bbc7ca7427fe0ed661a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3061902 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* biod: Add fptool.py that will replace flash_fp_mcuCraig Hesling2021-07-301-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to gsctool, but this tool would only be in the test image. This comes from the effort to move away from shell script. See http://go/deshell. The idea is that you start with a simple wrapper for the given shell script. Over time, features are transplanted or added-new to the python wrapper, until the shell script is no longer needed. BRANCH=none BUG=b:172020576 TEST=./util/fptool.py ./util/fptool.py --help ./util/fptool.py flash --help ./util/fptool.py flash # Error about flash_fp_mcu not existing TEST=scp util/fptool.py $DUT:/usr/local/bin ssh $DUT fptool.py flash /root/doesnotexist ssh $DUT fptool.py flash ssh $DUT fptool.py flash /opt/google/biod/fw/$(cros_config /fingerprint board)*.bin Change-Id: I8774bda4a057ee09f70bf474ce3ba2fa0bbcf92d Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3060744 Reviewed-by: Josie Nordrum <josienordrum@google.com>
* zephyr: ite: add CONFIG_PLATFORM_EC_FW_RESET_VECTORDenis Brockus2021-07-281-1/+0
| | | | | | | | | | | | | | | | | | | CONFIG_PLATFORM_EC_FW_RESET_VECTOR is used to control CONFIG_FW_RESET_VECTOR in the existing cros-ec code. This allows a chip specific function to be called to obtain the firmware reset vector. BUG=b:194794622 BRANCH=none TEST=zmake configure -b $PROJ_HAYATO Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I49000bc557f86f74af0d8429af6939ad340f21d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3056514 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* util/flash_jlink: Change to USB as defaultCraig Hesling2021-07-281-19/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change does the following: * allows for J-Link over USB to be the default connection * allows for passing in hostnames as the remote target, despite the segger tool only accepting IP addresses * changes the --ip arg to --remote, since this better describes the host + port description being provided BRANCH=none BUG=none TEST=# Check over USB ./util/flash_jlink.py TEST=JLinkRemoteServerCLExe ./util/flash_jlink.py --remote 127.0.0.1 ./util/flash_jlink.py --remote 127.0.0.1:19020 ./util/flash_jlink.py --remote localhost ./util/flash_jlink.py --remote localhost:19020 ./util/flash_jlink.py --remote localtoast # Should fail ./util/flash_jlink.py --remote localhost:port # Should fail Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I63c5a250f25bcae9828dc88b6282ac301b9a519f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3054818 Reviewed-by: Josie Nordrum <josienordrum@google.com>
* util/flash_jlink: Add check if J-Link server is runningCraig Hesling2021-07-281-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | This server could be either the local JLinkRemoteServerCLExe program or a physical J-Link connected over the network. Since we are not sure if the remote server is on the localhost, we make a TCP connection to the server to check if it is running. BRANCH=none BUG=none TEST=# No JLinkRemoteServerCLExe running make proj-bloonchipper -j ./util/flash_jlink.py --board bloonchipper # Ensure the cute error is given TEST=JLinkRemoteServerCLExe # in background make proj-bloonchipper -j ./util/flash_jlink.py --board bloonchipper # Ensure all goes well Change-Id: I4f24e5f53545aa3b1482066fe8ba12d5f1715d42 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3055114 Reviewed-by: Josie Nordrum <josienordrum@google.com>
* util/stm32mon: Prefix unrecognized bootloader cmds with 0xCraig Hesling2021-07-281-1/+1
| | | | | | | | | | | | | | BRANCH=none BUG=none TEST=# Force cmd_lookup_name to return NULL make proj-bloonchipper -j ./util/flash_ec --board=bloonchipper Change-Id: I5fe3588a9e15b19585c6f8ed005d58f5aed36a75 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3056331 Tested-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* util/stm32mon: Move read unprotect before reading valuesCraig Hesling2021-07-281-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 3 read_* functions attempt to read from areas that are protected by RDP on the STM32F412. This results in many read failures before we get to the unprotect function. These are not needed before attempting the unprotect, so move them to after the unprotect sequence. The unwanted sequence looks like the following, every time: Waiting for the monitor startup ...Done. ChipID 0x441 : STM32F412 | 0%NACK Failed to get command READMEM ACK NACK Failed to get command READMEM ACK NACK Failed to get command READMEM ACK NACK Failed to get command READMEM ACK Cannot read 21 bytes from address 0x1FFF7A0FUnable to read flash size register (0x1FFF7A22). / 0%NACK Failed to get command READMEM ACK NACK Failed to get command READMEM ACK NACK Failed to get command READMEM ACK NACK Failed to get command READMEM ACK Cannot read 13 bytes from address 0x1FFF7A0FUnable to read unique device ID register (0x1FFF7A10). Ignoring non-critical failure. Bootloader v3.1, commands : GETCMD GETVER GETID READMEM GO WRITEMEM EXTERASE WP WU RP RU Unprotecting flash read... Now, the output looks like: Waiting for the monitor startup ...Done. ChipID 0x441 : STM32F412 Bootloader v3.1, commands : GETCMD GETVER GETID READMEM GO WRITEMEM EXTERASE WP WU RP RU Unprotecting flash read... Timeout Timeout Timeout Flash read unprotected. Waiting for the monitor startup ...Done. | 0%Flash size: 1024 KB / 0%Unique Device ID: 0x383939313138511900038016 Flash write unprotected. Waiting for the monitor startup ...Done. Erasing... Timeout Timeout Timeout Flash erased. Writing 1047992 bytes at 0x08000000 1047992 bytes written. Done. BRANCH=none BUG=b:143374692 TEST=make proj-bloonchipper -j ./test/run_device_tests.py --flasher=servo_micro --tests\ flash_write_protect # This sets RDP ./util/flash_ec --board=bloonchipper TEST=# Tried flash_fp_mcu on dratini(F412/SPI) and bard(H732/SPI). Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I9b9ba2ecd3797cb1a98d7bcd7b226cdbc7872217 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3054465 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* util/stm32mon: Fix Readout Unprotect for STM32F412Craig Hesling2021-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After sending CMD_RU, the MCU will send one ACK immediately and then another one when it is finished erasing all of flash. We currently only wait MAX_RETRY_COUNT (3) timeouts for that seconds ACK, which is not enough for the STM32F412 most fo the time. This means that it requires two invocations of stm32mon to flash a protected chip. * First unprotects and erases, then stm32mon aborts * Second sees an erased and unprotected chip which flashes correctly. We only need a few more attempts. It happens to be that MAX_ACK_RETRY_COUNT is designed for this type of situation where we are waiting for a long ACK. It provides 5 vs the old 3. BRANCH=none BUG=b:143374692 TEST=./test/run_device_tests.py --flasher=servo_micro --tests \ flash_write_protect # FPMCU is now readout protected ./test/run_device_tests.py --flasher=servo_micro --tests \ flash_write_protect # This should succeed the first time stm32mon is run, not the second. TEST=# Tried flash_fp_mcu on dratini(F412/SPI) and bard(H732/SPI). Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I225fa7560fd485e5df601378998f2853b351324c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3054464 Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* util/stm32mon: Fix cmd_lookup_nameCraig Hesling2021-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the bootloader commands would be printed like the following, where the RP (0x82) and RU (0x92) commands would not be identified: Bootloader v3.1, commands : GETCMD GETVER GETID READMEM GO WRITEMEM \ EXTERASE WP WU 82 92 I believe this is because |cmd| and |cmd_lookup_table[i].cmd| were being "integer promoted" to accommodate all values. This would result in both values being converted to 32bit ints. This means that the char |cmd| could be sign extended and maintain a negative value and |cmd_lookup_table[i].cmd| would maintain a large unsigned value. Now, all the commands are recognized: Bootloader v3.1, commands : GETCMD GETVER GETID READMEM GO WRITEMEM \ EXTERASE WP WU RP RU BRANCH=none BUG=none TEST=make proj-bloonchipper -j ./util/flash_ec --board=bloonchipper Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I07ad35fe7e6b69c57f7f69bce3c694c2f887beef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3054820 Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* util/flash_jlink: Change JLinkRemoteServer default portCraig Hesling2021-07-271-1/+1
| | | | | | | | | | | | | | | | This changes the used port to JLinkRemoteServerCLExe's actual default port of 19020, so that you don't need to always specify it. BRANCH=none BUG=none TEST=JLinkRemoteServerCLExe # in background make proj-bloonchipper -j ./util/flash_jlink.py --board bloonchipper Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I2a3c1a10e0b5c7b9cc62001a3a26508ea3db8199 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3055111 Reviewed-by: Josie Nordrum <josienordrum@google.com>
* util/ec_parse_panicinfo: Add help messageCraig Hesling2021-07-261-0/+13
| | | | | | | | | | | | | | | | BRANCH=none BUG=b:176500425 TEST=make BOARD=dartmonkey -j ./build/dartmonkey/util/ec_parse_panicinfo --help ./build/dartmonkey/util/ec_parse_panicinfo # Ctrl-D # Ensure it complains that "Panic data too short". Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I32bfb0b027cf51f9f17df774cba45abe6c03b5bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3048643 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: Remove CONFIG options from allow listDino Li2021-07-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | Congratulations! The following options are now in Kconfig: CONFIG_HOSTCMD_REGULATOR CONFIG_SMBUS_PEC Config removed with './util/build_allowed.sh -u' Removing these CONFIG options from the allowed list: CONFIG_HOSTCMD_REGULATOR CONFIG_SMBUS_PEC BRANCH=none BUG=none TEST=buildall Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: Ib12637f9e9d25db3af951a7a12989d334e6a1c5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045035 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* util: Add volteer relevant pathsAbe Levkoy2021-07-221-0/+15
| | | | | | | | | | | | | | | | List relevant commits when constructing volteer branch merge commit messages. BUG=none TEST=none BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ibac403353a40055798323b20a9333c757ec305c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3044138 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org> Tested-by: Zhuohao Lee <zhuohao@chromium.org>
* flash_fp_mcu: Fix nocturne/nami kernelnextCraig Hesling2021-07-221-11/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nocturne and Nami are legacy kernel v4.4 devices. The spidev char device naming changed between their v4.4 and newer v5.4. Since these devices have a kernelnext build+tests, we need an alternative configuration that uses the new spidev name. This is achieved by allowing for specific alt configs that match the full platform name, like "nami-kernelnext". If a config is not provided for the full platform name, it will fallback to using the normal base config name, like "nami". BRANCH=none BUG=b:194004525 TEST=# Run the following commands on a nocturne, nocturne-kernelnext, # nami, nami-kernelnext, and hatch setups. # # Note, you get a kernelnext setup by flashing the base platform # device with an xbuddy line similar to # xbuddy://remote/nami-kernelnext/latest-dev/test scp util/flash_fp_mcu ${DUT_HOSTNAME}:/usr/local/bin/flash_fp_mcu ssh ${DUT_HOSTNAME} flash_fp_mcu --hello # Check that full platform name and base name was identified # correctly. # Check that it succeeded. Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ib2ad991291639ef33799abb4bc3379c1659f754d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3035686 Reviewed-by: Jora Jacobi <jora@google.com>
* zephyr: Remove CONFIG_ARM to run make buildallGwendal Grignou2021-07-201-1/+0
| | | | | | | | | | | | | | | | | | | | Congratulations! The following options are now in Kconfig: CONFIG_ARM Config removed with './util/build_allowed.sh -u' BUG=none BRANCH=master TEST=make buildall passes. Signed-off-by: Gwendal Grignou <gwendal@google.com> Change-Id: Ia96c24db5489d9681ae0acf4da2a9133a8f2a3e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3041918 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org>
* flash_fp_mcu: Fix interrupt to unbind race caused by pwr_enCraig Hesling2021-07-161-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Taking control of the pwr_en line causes the FPMCU to power cycle. This causes an interrupt to the cros-ec driver. The interrupt handler then races with the subsequent cros-ec unbind attempt. This can manifest in multiple ways, but one common way is for the later binding of spidev to fail, since the interrupt handler reinitialized the cros-ec driver (due to crrev.com/c/1903814). The spidev attempt then errors out because there are still resources associated with the device (the reallocated cros-ec objects). The need to take control of the power enable line to simply keep FPMCU power enabled is no longer needed on any device. * The need for this arose during nocturne development, when the pwr_en line was associated with the SPI interface in ACPI. This can be seen in https://crrev.com/c/1084686. This pwr_en control was then added to flash_fp_mcu in https://crrev.com/c/1114743. * The pwr_line was then quickly disassociated with the SPI interface a few days later in https://crrev.com/c/1155565, but wasn't removed from flash_fp_mcu. To this day, the FP pwr_en line is controlled in coreboot manually. It remains powered on when the Chromebook is powered on, irrespective of drivers. BRANCH=none BUG=b:190744837 TEST=Run the following on nocturne, nami, kohaku, dratini, and volteer. scp util/flash_fp_mcu ${DUT_HOSTNAME}:/usr/local/bin/flash_fp_mcu ssh ${DUT_HOSTNAME} flash_fp_mcu --hello ssh ${DUT_HOSTNAME} flash_fp_mcu ssh ${DUT_HOSTNAME} flash_fp_mcu --hello Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Icc64f7056e21180efd19b2f650b9fe5804cd2906 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3027129 Tested-by: Patryk Duda <patrykd@google.com> Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Josie Nordrum <josienordrum@google.com>
* flash_fp_mcu: Log actions to kernel logCraig Hesling2021-07-161-0/+13
| | | | | | | | | | | | | | | | | | | | | | We note our flash_fp_mcu actions to the kernel log in order to be able to debug what action of the script may have triggered a kernel warning or error. This is for debugging current and future issues with the kernel and flash_fp_mcu. BRANCH=none BUG=b:190744837 TEST=# On Nami and Zork scp util/flash_fp_mcu ${DUT_HOSTNAME}:/usr/local/bin/flash_fp_mcu ssh ${DUT_HOSTNAME} flash_fp_mcu --hello dmesg Change-Id: Ie57b1042d20284065a652b0a805c081a9591280c Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3010624 Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Jora Jacobi <jora@google.com>
* Revert "flash_fp_mcu: Add debug spi bytes activity"Craig Hesling2021-07-161-33/+0
| | | | | | | | | | | | | | | | | This reverts commit 9a40c7dbadf8c577660a09807287d9133373803b. This change turned out to not be very useful and non-functional on kernel v4.4. BRANCH=none BUG=b:190744837 TEST=none Change-Id: If5d51e0240f93b43410040e99eb48cb5e080f0e3 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3027128 Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Jora Jacobi <jora@google.com>
* util/ectool: Add print info for BMI323 and BMA422Bhanu Prakash Maiya2021-07-131-0/+6
| | | | | | | | | | | | | | BRANCH=none BUG=b:178213305 TEST=Run ectool on Guybrush. Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Change-Id: Ic7ac62f328618d939a71f3735e3c367af3ee5a76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3021755 Tested-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@google.com> Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: Remove CONFIG options from allow listKeith Short2021-07-121-5/+0
| | | | | | | | | | | | | | | | | | | | | | Remove the following CONFIG options from the allow list which are obsolete or have been added to Kconfig: CONFIG_BATT_FULL_FACTOR CONFIG_FLASH_PSTATE CONFIG_INTERNAL_STORAGE CONFIG_MKBP_EVENT_WAKEUP_MASK CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK BUG=b:193195946 BRANCH=none TEST=zmake testall TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If078d2302726458962d71f0da69cc1de8b9c553b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3015870 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: add support for CONFIG_CMD_S5_TIMEOUTKeith Short2021-07-121-0/+1
| | | | | | | | | | | | | | | Add a Kconfig option to control the CONFIG_CMD_S5_TIMEOUT option. BUG=b:193195946 BRANCH=none TEST=zmake testall TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I2f4b8c74a9b710f68d8e07e04d9cb95ca2e39dea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3015869 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* 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>