summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* flash_ec: flashrom: Use google-servo-v2 instead of servo-v2Nicolas Boichat2020-06-081-1/+1
| | | | | | | | | | | | | | | Get rid of deprecation warning. BRANCH=master BUG=b:145175076 TEST=none Change-Id: I4fe9adc3811f8dcd6a75fe9481d7e44a29d5126e Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2234042 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Commit-Queue: Edward O'Callaghan <quasisec@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org>
* flash_fp_mcu: fix the volteer gpio settingZhuohao Lee2020-06-081-15/+15
| | | | | | | | | | | | | | | | | Due to the latest coreboot change, the gpiochip252 and gpiochip445 were removed and the gpiochip152 was added. Besides, the GPIO pin also changed. This patch fixes the gpio pin setting. BUG=b:156993750 BRANCH=none TEST=ran flash_fp_mcu on the Volteer Change-Id: I54082eea90e85746976d427523cfc0b53e87ddda Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2214876 Tested-by: Jesper Lin <jesper_lin@wistron.corp-partner.google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Alex Levin <levinale@chromium.org>
* util/flash_jlink.py: Reset after flashingCraig Hesling2020-06-041-0/+1
| | | | | | | | | | | | | | | | | | | You must reset the chip after flashing to start the new code. It is possible that the chip was resetting without this fix due to a double fault after flashing. In cases where the CPU is hung before flashing, the CPU would not reset. BRANCH=none BUG=none TEST=# Ensure that the chip is hung in on b/147520242 ./local/flash_jlink.py --ip '' # The UART console should reflect a reset and become interactive again Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I5006eff5d3a955ba9b8e6ecee4f72d7ad851f239 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2226520 Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util/flash_jlink.py: Allow USB modeCraig Hesling2020-06-041-3/+8
| | | | | | | | | | | | | | | | | | | | This adds the option to specify "" for --ip, which will disable the TCP/IP mode. Thus, the JLink tool will default to USB direct. BRANCH=none BUG=none TEST=# Ensure JLinkRemoteServerCLExe is not running ./util/flash_jlink.py --ip '' # Ensure JLinkExe uses direct USB and succeeds TEST=# Ensure "JLinkRemoteServerCLExe -Port 2551 -select USB" is running ./util/flash_jlink.py # Ensure JLinkExe uses TCP/IP and succeeds Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I9da2efa8adf155673f14f12dbb354492b0827332 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2226880 Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util/flash_jlink.py: Allow using PATH to find JLinkExeCraig Hesling2020-06-041-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Installing Jlink Debian package places JLinkExe in a PATH area. This allow flash_jlink to find the normal path'ed executable in addition to the hand placed binary. BRANCH=none BUG=none TEST=# Assume JLink_Linux_V670e_x86_64 dir does not exist mkdir ./JLink_Linux_V670e_x86_64 touch ./JLink_Linux_V670e_x86_64/JLinkExe chmod +x ./JLink_Linux_V670e_x86_64/JLinkExe ./util/flash_jlink.py # Should fail TEST=# Ensure the proper JLinkExe is in PATH rm -rf ./JLink_Linux_V670e_x86_64 ./util/flash_jlink.py # Should succeed Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ife0c2b7a47f989877f7b81a81a7dadd2b7cb5c1b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2226879 Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util/flash_jlink.py: Fix formatting + parsing conventionCraig Hesling2020-06-041-14/+15
| | | | | | | | | | | | | BRANCH=none BUG=none TEST=./util/flash_jlink.py --jlink JLinkExe --ip blah # Ensure that the blah parameter was passed Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Iee38468eb38e91eb3f2b6c19de9c5070f1c0bc5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2226878 Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util/flash_jlink: Enforce python3Craig Hesling2020-06-041-1/+1
| | | | | | | | | | | | | | | | | Python 3 is required for the subprocess.run line. Enforcing python 3 helps our non-chroot devs. BRANCH=none BUG=none TEST=# Outside chroot ./util/flash_jlink.py # Ensure the error does not reference subprocess.run Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I057c1b00696a4b356f162795fd1794eba9c54bd7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2226877 Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* servo_updater: Updates the Servo V4.1 nameBrian J. Nemec2020-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | Updates the Servo V4.1 name from 'servo_v41' to 'servo_v4p1' and the corresponding files and fields. As the VID:PID is used to identify the device, no other changes are required. BUG=b:157059356 BRANCH=servod TEST=Updated the ServoV4.1 from 'servo_v41_v2.0.3735+440cf71e0' to 'servo_v4p1_v2.0.4232-514cb4e92' to verify the servo_updater supports renames. TEST=Verified servo_v4p1 manually: Validated console, firmware update, and servod can connect to the device. Signed-off-by: Brian Nemec <bnemec@chromium.org> Depends-On: Ia05134179fab4ff118355ba9b3b1b92cdf0748f2 Change-Id: Ie470469bf9115bbfef14a08c02b156dcd5aed849 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2219124 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
* console: add micro seconds in timestampsEric Yilun Lin2020-05-301-3/+15
| | | | | | | | | | | | | | | | | | | | | A more precise timestamp will be helpful while debugging with AP and EC uart logs. This CL adds extra 3 micro second digits in timestamps, and also uses 'yy' rather than 'YYYY' year format. BRANCH=none BUG=none TEST=sudo emerge ec-devutils; dut-control timestamp:on see cpu_uart_pty in such format: 20-05-27 15:50:36.034 Developer Console 20-05-27 15:50:36.038 20-05-27 15:50:36.038 To return to the browser, press: Change-Id: I782e6e080f38cbaaa31b0b96fac839e118619266 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2217493 Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
* flash_ec: keep h1 awake while flashing with c2d2Jett Rink2020-05-261-4/+12
| | | | | | | | | | | | | | | | | | | | | | | The H1 controls the DUT-side i2c muxes that the C2D2 programming path need to stay active. If the H1 goes to sleep during the flash process the flash will fail. Use new dut-control for cr50 that will keep the cr50 from going into a deep low power mode during flashing Also initialize the c2d2 i2c before turning on the DUT-side i2c muxes; this is not strictly necessary, but seems prudent to change. BRANCH=none BUG=b:153475851 TEST=flash waddledee multiple times without issue Cq-Depend: chromium:2188853 Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I39fac618dc6436f547d723364a2273cc03563593 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2189070 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* util: Fix platform name in flash_fp_mcuTom Hughes2020-05-211-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | cros_config /identity platform-name is specific to mosys and not guaranteed to be the same as the board name. Always use CHROMEOS_RELEASE_BOARD from /etc/lsb-release instead. BRANCH=none BUG=b:156650654 TEST=On ekko: flash_fp_mcu /opt/google/biod/fw/nami*.bin TEST=On kohaku: flash_fp_mcu /opt/google/biod/fw/dartmonkey*.bin TEST=On nocturne: flash_fp_mcu /opt/google/biod/fw/nocturne*.bin TEST=On dratini: flash_fp_mcu /opt/google/biod/fw/bloonchipper*.bin Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ic395e1c6bfdd5c9d4e397a50e594c03d2cf91af1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2212689 Commit-Queue: Yicheng Li <yichengli@chromium.org> Reviewed-by: Yicheng Li <yichengli@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* util: Script for flashing via J-LinkTom Hughes2020-05-151-0/+118
| | | | | | | | | | | | | BRANCH=none BUG=none TEST=make BOARD=bloonchipper -j && \ ./util/flash_jlink.py --board bloonchipper Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ida382ade28451eaab62ca852337256740b81d30f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191292 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* util: Remove unnecessary halt in gdbinitTom Hughes2020-05-111-2/+0
| | | | | | | | | | | | | | The reset on the line before is sufficient. BRANCH=none BUG=none TEST=none Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I7eef41a4263764375ff1c8a16bb462edf7b3209c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2190820 Commit-Queue: Craig Hesling <hesling@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
* ec: fix `make coverage` code coverage reportingPaul Fagerburg2020-05-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | Fixed problems that were preventing us from building the unit tests with code coverage testing via `make coverage`. * Changed test_util so that programs will cleanly exit on SIGTERM. * Changed run_host_test to wait for the child process to exit, and only proc.kill() if it times out, so the child process will generate code coverage output files on exit. * Changed Makefile.toolchain to use the --coverage flag for both compile and link. * Changed build.mk and Makefile.rules to exclude certain tests from code coverage because they were causing failures either during the individual stage of code coverage, or generating the overall report. BUG=b:143065231 BRANCH=none TEST=`make coverage` produces results Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Change-Id: I8575013551ce1dba3fd249cd933a3cf6d110db8d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2186853 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* uart_stress_tester: import logging instead of cros_loggingNamyoon Woo2020-05-081-1/+1
| | | | | | | | | | | | | | | | | This patch makes uart_stress_tester.py import logging instead of cros_logging from chromite.lib. BUG=none BRANCH=none TEST=ran uart_stress_tester.py on local chroot and on labstation. Signed-off-by: Namyoon Woo <namyoon@google.com> Change-Id: I479e2b7a046d6c7b02fb4aca2c7e1fc83334e294 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2190826 Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Namyoon Woo <namyoon@chromium.org>
* compare_build.sh: Fix chip boards-with parsingCraig Hesling2020-05-071-3/+2
| | | | | | | | | | | | | | | | | This fixes board expansions that use the boards-with search feature. The boards-with function outputs a newline separated list, while the static board expansions emit a space separated list. This allows read to tokenize either format. BRANCH=none BUG=none TEST=./util/compare_build.sh -bstm32f4 TEST=./util/compare_build.sh -bfp Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Iebf4309fc7ea2ba66a637a5446aa283552ef67c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2187951 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* compare_build.sh: Add stm32f4 and stm32h7 board groupsCraig Hesling2020-05-071-0/+4
| | | | | | | | | | | BRANCH=none BUG=none TEST=./util/compare_build.sh -b "stm32f4 stm32h7" Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ie7645300d3731bbd93449722b674b4806dff8063 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110536 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* compare_build.sh: Modularize parsing board groupsCraig Hesling2020-05-071-49/+61
| | | | | | | | | | | | | Allow reuse of the board/board-group parsing function. BRANCH=none BUG=none TEST=./util/compare_build.sh -b "mchp fp -nucleo-h743zi" TEST=./util/compare_build.sh Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I7acaeaf93830c10dca2fa49c23593d0940191848 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110535
* compare_build.sh: Improve board selectionCraig Hesling2020-05-071-29/+135
| | | | | | | | | | | | | | | | | | | | New features: * Add board validation * Add many new board groups BRANCH=none BUG=none TEST=time ./util/compare_build.sh -b "all -all"; echo $? TEST=time ./util/compare_build.sh -b ""; echo $? TEST=time ./util/compare_build.sh -b stm32 -j 7; echo $? TEST=time ./util/compare_build.sh -b hatch_fp -j 7; echo $? TEST=time ./util/compare_build.sh -o -b fp -j 7; echo $? TEST=time ./util/compare_build.sh -o -b bloonchipper; echo $? TEST=time ./util/compare_build.sh -o -b "fp -bloonchipper" -j 7; echo $? Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ia802f3b0c595f2c7aafeee8e247077333625888a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2093897
* util: Add support for flashing and debugging unit tests with gdbTom Hughes2020-05-051-4/+10
| | | | | | | | | | | | | | | | | | | | BRANCH=none BUG=none TEST=On machine with dragonclaw attached to J-Trace: JLink_Linux_V670e_x86_64/JLinkGDBServerCLExe -select USB -device STM32F412CG -endian little -if SWD -speed auto -noir -noLocalhostOnly make BOARD=bloonchipper tests -j BOARD=bloonchipper GDBSERVER=segger BIN_NAME=sha256 gdb --ex "target remote 127.0.0.1:2331" Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I6a130c9d4d676d017969aac579d43f995b4dad09 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2172060 Reviewed-by: Harry Cutts <hcutts@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
* util: Add support to auto-flash with Segger J-Link gdbserverTom Hughes2020-05-051-5/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Automatically flash the EC binary when running gdb combined with Segger J-Link gdbserver and JTrace. For most code changes, the flashing only takes a 10-20 seconds. Also updated FPMCU debugging docs to mention the gdbinit. BRANCH=none BUG=none TEST=On machine with dragonclaw attached to J-Trace: JLink_Linux_V670e_x86_64/JLinkGDBServerCLExe -select USB -device STM32F412CG -endian little -if SWD -speed auto -noir -noLocalhostOnly BOARD=bloonchipper GDBSERVER=segger gdb --ex "target remote 127.0.0.1:2331" TEST=Same as above, but using CLion for gdb as described in https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/master/docs/fingerprint/fingerprint-debugging.md and setting USING_CLION=FALSE Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I88440c0bc8c9b170b239335a33b3c0a0387447f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2166143 Reviewed-by: Craig Hesling <hesling@chromium.org>
* it8xxx(iteflash): Support KGD FlashDonald Huang2020-04-301-14/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KGD flash command is different on the erase and program. =================================================================== Command Eflash KGD Page Program No Support 0x02 (256 bytes) AAI WORD Program 0xAD No Support Sector Erase 0xD7(size:1K bytes) 0x20(size:4K bytes) =================================================================== BUG=none BRANCH=none TEST=Check it ok on IT81202 (cr) (333) donald@donald-Aspire-4752 ~/trunk/src/platform/ec $ sudo ./util/flash_ec --board=it8xxx2_evb INFO: Using servo_v2. INFO: Using ec image : /mnt/host/source/src/platform/ec/build/it8xxx2_evb/ec.bin INFO: Flashing chip it83xx. INFO: Closing servod connection to ftdi_i2c interface INFO: Programming EC firmware image using iteflash... Flash enter follow mode enter follow mode FAILED (-5) !please reset EC if flashing sequence is not starting! Flash enter follow mode enter follow mode FAILED (-5) CHIPID 81202, CHIPVER c0, Flash size 1024 kB Done with sending special waveform. EFLASH TYPE = KGD Disabling watchdog... Disabling protect path... Erasing flash...erase size=1048576 \100% Erasing Done. Writing 524288 bytes at 0x00000000....... \100% Writing Done. Verify 524288 bytes at 0x00000000 \ 99% Verify Done. INFO: Flashing done. INFO: Reinitializing ftdi_i2c interface Change-Id: I639a8d049b8a53085e103c4259a92ae5549c6fe6 Signed-off-by: Donald Huang <donald.huang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1736409 Tested-by: Donald Huang <cguwinds@gmail.com> Reviewed-by: Namyoon Woo <namyoon@chromium.org> Commit-Queue: Donald Huang <cguwinds@gmail.com>
* driver: Add BMI260 basic driver supportChing-Kang Yen2020-04-231-0/+3
| | | | | | | | | | | | | | | | | | | | Add BMI260 accel/gyro driver code. Be able to do initial configuration, start up sensor, config interrupt and fifo, perform calibration, and access the sensor data from AP. BRANCH=None BUG=b:146144827 TEST=make -j4 BOARD=volteer \ && flash_ec --image build/volteer/ec.bin --board volteer Then, check sensor data is available on DUT by "ectool motionsense". TEST=make buildall -j TEST=tast run ${IP} hardware.SensorRing Cq-Depend: chromium:2148802 Change-Id: I5124ee8359a74f98cfe8d26da640325f5e00cb15 Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086534 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* flash_ec: reduce C2D2 i2c bus speed from 1Mhz to 400kHzJett Rink2020-04-231-2/+2
| | | | | | | | | | | | | | | Based on the resistors on Dedede (and most likely other future platforms), reduce the i2c bus speed to ensure that our i2c waveform stays within time spec. BRANCH=none BUG=b:153475851 TEST=none Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Icc8de0ea0d2af7d75efce696e96b2c0db67c0fee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2161447 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* util/run_host_test: increase default test timeout to 60sJack Rosenthal2020-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | Most all of our unit tests are very fast (<1s), but in the CQ, we are hitting test timeouts, likely because the CPU is being starved as many packages are being emerged with a high "-j". From a conversation on cros-oncall, apparently this is "WAI" and we should expect that we will run in a highly CPU starved environment, so bump the timeout to account for that. BUG=chromium:1070651 BRANCH=none TEST=sheriffs stop bugging me about test timeouts Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I04033d2f51e4264d5f0741322c608258decb6a2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2149534 Reviewed-by: Paul Moy <pmoy@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* servo_updater: Add Servo V4.1 to flash and servo updaterBrian J. Nemec2020-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Adds the Servo V4.1 to the servo updater as the target 'servo_v41'. Some minor cleanup was done on the servo_updater logic to make it clearer which issue is occurring and to address common substrings in 'servo_v4' and 'servo_v41' by extracting the binary name from the config files directly rather than inferring from the name. BUG=b:153391164 TEST=sudo emerge chromeos-base/ec-devutils TEST=flash_ec --board=servo_v41 --image ec.bin Verify the flash_ec using the STM32 DFU to flash the image on reworked board with compatible BC1.2 change TEST=sudo servo_updater -b servo_v41 Verify the servo_updater finds the latest servo_v4.1 version and flashes it TEST=Attempted to flash V4 and V41 devices with each other's images verified that the checks prevent flashing the other version. Change-Id: I77d94ce9a641f39b7ee446af05e52441b7762c96 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2138638 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* flash_ec: remove warm_reset for it83xx caseJett Rink2020-04-071-6/+5
| | | | | | | | | | | | | | | | We removed the warm reset code for it I2C flashing recent, so we should remove the warm reset clean up section. The cold reset is a superset of warm reset. BRANCH=none BUG=b:153165576 TEST=waddledee flashing works Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Iac691bfa127dac0f279ac92519c58b0e4211873b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2137922 Tested-by: David Schneider <dnschneid@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* flash_fp_mcu: Add a config for the Volteer fingerprint MCUZhuohao Lee2020-04-071-0/+21
| | | | | | | | | | | | | | | To enable the flash_fp_mcu to update the fingerprint MCU firmware, we need to add a config for the Volteer fingerprint MCU. BUG=b:147687800 BRANCH=None TEST=use 'flash_fp_mcu ${BINARY_PATH}', the firmware is programmed correctly. Change-Id: Ib62ae29ca805985e0256c2ebee5fee633ccef082 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2089214 Reviewed-by: Alex Levin <levinale@chromium.org>
* flash_ec: fix issue with h1 resetJett Rink2020-04-061-31/+35
| | | | | | | | | | | | | | | | When we call cold_reset on waddledee, it actually pulls the H1 down, which will make h1 stop driving the I2C mux, which makes i2c communication fail. We already have a way to hold only the EC in reset from recent Doo changes, so make use of those now for Dee flashing BRANCH=none BUG=b:152936415,b:153165576 TEST=flash Dee and Doo Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I0cafcf1696216ef9ea2ee2169a0b0094140bccc3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135139 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* EFS2: Add EC_FEATURE_EFS2dnojiri2020-03-311-0/+1
| | | | | | | | | | | | | | | | | | This patch adds EC_EEATURE_EFS2. It allows AP, servo, and a developer to query whether EFS2 is supported or not. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=b/152449880 BRANCH=none TEST=Verify ectool inventory prints 38 on Helios. Change-Id: Id308cad4115314380ca47c45c3212e2e6fb4095d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2125410 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* driver: lis2ds12: Add driver supportMario Tesi2020-03-271-0/+3
| | | | | | | | | | | | | | | | | | | | | Added ACC LIS2DS/LIS2DS12 driver support. Features included: - FIFO support with watermark interrupt events - Uses shared function with other ST MEMs devices BUG=none BRANCH=master TEST=Tested on discovery_stmems target BOARD with LIS2DS connected to EC i2c master bus and motion sense task running. All basic features tested including changing in ODR and Full Scale Range. Also tested FIFO features and interrupt management. Change-Id: I8a9e96f59ebdca7e622cff29676c5e1a9e0d58f5 Signed-off-by: Mario Tesi <mario.tesi@st.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/481480 Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: Inno.Park <ih.yoo.park@samsung.corp-partner.google.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* util/flash_ec: correct board nameRuibin Chang2020-03-251-1/+1
| | | | | | | | | | | | | | | | The board name was changed in mistake, CL : 2107147. Revert the name back. BUG=none BRANCH=none TEST=can flash board it8xxx2_pdevb Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: I11aa31f3987fd10c3c41ce19c7de44e383d4b67a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2115899 Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw> Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* compare_builds.sh: Changed to parallel operationCraig Hesling2020-03-241-69/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This completely changes the way compare_build.sh operates. * The test checkouts are done in /tmp directories. This detaches the test environment from your local EC workspace and allows builds for all references to occur at the same time. * Builds for all board and all references happen in parallel, unless disabled from command-line args. * New arguments: -k Allows the tmp dir to be preserved after compare -j 8 Number of jobs that will run concurrently (make -j) -o Forces only one EC ref to be built at a time. Although -j is always enforced, this option limits memory usage. BRANCH=none BUG=none TEST=time ./util/compare_build.sh TEST=time ./util/compare_build.sh -k -o -j 1 TEST=time ./util/compare_build.sh -k -o -j 4 TEST=time ./util/compare_build.sh -k -o TEST=# Introduce syntax error to board/nocturne_fp/board.c # Commit it time ./util/compare_build.sh # Ensure that the script detected the build error Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I3453f58a0ce08988e86572e6979f1a75a553f9b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094695
* cbi: Support PCB supplier fieldAbe Levkoy2020-03-242-0/+13
| | | | | | | | | | | | | | | | | | | Add support for PCB_SUPPLIER, to distinguish boards of the same type with different PCB suppliers. BUG=b:140244489 TEST=ectool cbi set 7 0 1 0; ectool cbi get 7 TEST=cbi on EC console after writing with ectool TEST=/usr/share/userfeedback/scripts/cbi_info after writing with ectool TEST=cbi-util create --pcb_supplier 1 ...; cbi-util show ... BRANCH=none Change-Id: Ieadba91694f4775cc86c2c4b09cdf0874b9ad444 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108710 Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: George Engelbrecht <engeg@google.com> Commit-Queue: George Engelbrecht <engeg@google.com>
* util: rewrite the host test runner in Python 3, and drop pexpectJack Rosenthal2020-03-201-72/+105
| | | | | | | | | | | | | | | | | This is a total-rewrite of the host test runner, in Python 3, and no longer uses the pexpect library (simply because we don't need to open a can of Pringles with a crowbar: our usage can be handled with some simple IPC and the subprocess library). BUG=chromium:1031705,chromium:1061923 BRANCH=none TEST=host tests pass, manually-created failing tests with "Fail!", premature ending, or timeout fail appropriately. Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I4017da877d6a34c1031b261fc41f8334dae26c00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2106862 Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
* Button: add ectool command to simulate button presspandeyan2020-03-171-0/+55
| | | | | | | | | | | | | | | | | | Added a new ectool command 'ectool button' for simulating volume up and volume down button operations along with the duration in milli-seconds for which button needs to be pressed. BUG=b:149659987 BRANCH=None TEST=Tested on hatch board. From Kernel console, entered the below commands: $ectool button vup 500 Observed volume UP key press on EC console. Change-Id: I6fcdf80ea45b80403f72af89ce99214226731d0f Signed-off-by: pandeyan <anshuman.pandey@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2059929 Reviewed-by: Jett Rink <jettrink@chromium.org>
* flash_ec: fix incorrect indentTing Shen2020-03-171-1/+1
| | | | | | | | | | | | | | | | replace whitespace by tab in a line BUG=none TEST=make sure `flash_ec` still works BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I811bc3b88f94186c07e90e78d46c82eeb56bebea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107147 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org>
* util/ide-config.sh: CleanupCraig Hesling2020-03-171-55/+55
| | | | | | | | | | | | | | | * Change error messages to print to stderr * Uglify variables to adhere to shell scripting style BRANCH=none BUG=none TEST=none Change-Id: I2baef1b9711447b3506c74674db5701e9ba8c753 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101901 Tested-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* hammer: Add moonball boardChen-Tsung Hsieh2020-03-161-0/+1
| | | | | | | | | | | | | | | | | A close hammer derivative. BRANCH=kukui BUG=b:150268720, b:151098124 TEST=make BOARD=moonball Flash into masterball, see the board boot: util/flash_ec --image /build/kukui/firmware/moonball/ec.bin Signed-off-by: Chen-Tsung Hsieh <chentsung@google.com> Change-Id: I015ea6ecaa76505df611935e7b81f819f9b9bbce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094861 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Tested-by: Chen-Tsung Hsieh <chentsung@chromium.org> Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org>
* flash_ec: add error text when c2d2 needs upgradeJett Rink2020-03-121-0/+5
| | | | | | | | | | | | | | | | If the flash script detects an older version of hdctools or c2d2 fw, then it tells the user which command to run to get to latest binaries. BUG=none BRANCH=none TEST=tested with old c2d2 image and old hdctools and got new error message Change-Id: I415abcad6c88e5b7a0d4eb96448ca1e9b661c47e Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101207 Commit-Queue: Justin TerAvest <teravest@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* baseboard/ite_evb: create ite_evb baseboardRuibin Chang2020-03-121-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The development board of it83xx and it8xxx2 have common code and config options which are moved to baseboard ite_evb. And we create another board for PD EVB based on baseboard ite_evb. BUG=none BRANCH=none TEST=on baseboard ite_evb: 1.test board it83xx_evb and it8xxx2_evb: successfully Flash EC image and boot on chip it8320 and it83202. 2.flashrom by ite_spi test: $ sudo ./util/flash_ec --board=it8xxx2_evb --verbose INFO: Using servo_v2. INFO: Using ec image : /mnt/host/source/src/platform/ec/build/ it8xxx2_evb/ec.bin dut-control --port=9999 i2c_mux_en:on dut-control --port=9999 i2c_mux:remote_adc INFO: Flashing chip ite_spi. dut-control --port=9999 cold_reset:on dut-control --port=9999 fw_up:on dut-control --port=9999 cold_reset:off dut-control --port=9999 fw_up:off dut-control --port=9999 spi1_vref:pp1800 spi1_buf_en:on dut-control --port=9999 spi1_buf_on_flex_en:on INFO: Running flashrom: sudo /usr/sbin/flashrom -p ft2232_spi:type=servo-v2,port=B, serial=911416-00012 --flash-size flashrom v0.9.9 : : on Linux 4.15.0-76-generic (x86_64) flashrom v0.9.9 : : on Linux 4.15.0-76-generic (x86_64) INFO: Programming EC firmware image. INFO: Running flashrom: /usr/sbin/flashrom -p ft2232_spi:type=servo-v2,port=B, serial=911416-00012 -w /tmp/flash_spi_6163 flashrom v0.9.9 : : on Linux 4.15.0-76-generic (x86_64) flashrom v0.9.9 : : on Linux 4.15.0-76-generic (x86_64) Calibrating delay loop... OK. Erasing and writing flash chip... Verifying flash... VERIFIED. SUCCESS INFO: Flashing done. INFO: Restoring servo settings... dut-control --port=9999 cold_reset:off dut-control --port=9999 i2c_mux_en:on dut-control --port=9999 i2c_mux:remote_adc dut-control --port=9999 spi1_vref:off dut-control --port=9999 spi1_buf_en:off dut-control --port=9999 spi1_buf_on_flex_en:off dut-control --port=9999 cold_reset:on dut-control --port=9999 cold_reset:off 3.test board it8xxx2_pdevb: successfully Flash EC image and boot on chip it83202. Connection with adapter and dongle are able to ready state. Change-Id: Ib6371b61c27980eb9977548177efb8c896e72d47 Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2071551 Reviewed-by: Jett Rink <jettrink@chromium.org>
* flash_ec: make c2d2 uart flashing more reliableJett Rink2020-03-111-10/+41
| | | | | | | | | | | | | | | | | Remove sleeps from C2D2 flash path and ensure the EC doesn't come out of reset long enough to do damage before we start flashing it. BRANCH=none BUG=b:150796623 TEST=Verify that no console prints from EC occur before flashing happens (this is a positive change in behavior with this CL) Cq-Depend: chromium:2090124, chromium:2090576 Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I76560dcb6e7483ae36dc8c0f37ef99da126b0be3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2090077 Reviewed-by: David Schneider <dnschneid@chromium.org> Reviewed-by: Raul E Rangel <rrangel@chromium.org>
* util: Add ide-config.shCraig Hesling2020-03-111-0/+354
| | | | | | | | | | | | | | | This adds a script that can generates configs for specific IDEs and board-image pairs. This initial implementation only supports vscode. BRANCH=none BUG=none TEST=time ./util/ide-config.sh vscode all:RO all:RW > .vscode/c_cpp_properties.json Change-Id: I533958da962cea68f636999b52a90990beb02303 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2082641 Reviewed-by: Jett Rink <jettrink@chromium.org>
* common: motion_sense: implement AP command to read dirty calibrationYuval Peress2020-03-111-0/+1
| | | | | | | | | | | | BRANCH=None BUG=b:138303429,chromium:1023858 TEST=buildall Change-Id: I857dbc0975a239a6d8419015d8b9e34415b477cf Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2044702 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
* util/make_linux_ec_commands_h: Transform UINTxx_MAX into Uxx_MAXGwendal Grignou2020-03-091-0/+5
| | | | | | | | | | | | | | | To match kernel defines, transform UINT32_MAX and friends into U32_MAX and friends. BUG=chromium:945948 BRANCH=none TEST=compile. Check changes with linux-next/master cros_ec_commands.h. Change-Id: Id965a192f2e32b0f57983c69d51d7c07c4f5b4ef Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2087845 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* remove cr50 related filesNamyoon Woo2020-03-0910-2869/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=b:149350081 BRANCH=none TEST=build all, and emerged ec related packages for host and octopus. $ make buildall -j $ cros_workon --host list chromeos-base/chromeos-cr50-dev chromeos-base/chromeos-ec chromeos-base/chromeos-ec-headers chromeos-base/ec-devutils chromeos-base/ec-utils chromeos-base/ec-utils-test dev-util/hdctools $ sudo emerge chromeos-cr50-dev -j $ sudo emerge chromeos-ec -j $ sudo emerge chromeos-ec-headers -j $ sudo emerge ec-devutils -j $ sudo emerge ec-utils -j $ sudo emerge ec-utils-test -j $ sudo emerge hdctools -j $ cros_workon-octopus list chromeos-base/chromeos-ec chromeos-base/chromeos-ec-headers chromeos-base/ec-devutils chromeos-base/ec-utils chromeos-base/ec-utils-test dev-util/hdctools $ sudo emerge-octopus chromeos-ec -j $ sudo emerge-octopus chromeos-ec-headers -j $ sudo emerge-octopus ec-devutils -j $ sudo emerge-octopus ec-utils -j $ sudo emerge-octopus ec-utils-test -j $ sudo emerge-octopus hdctools -j Signed-off-by: Namyoon Woo <namyoon@chromium.org> Change-Id: If751b26b0635b0021c077338e96eaa8e8dcf17a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2080631 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* util: Add script to update release branch from masterTom Hughes2020-03-071-0/+95
| | | | | | | | | | | | | | | Currently this script is specific to the fingerprint release branch process, but can be easily generalized to other ECs. See http://go/cros-fingerprint-firmware-branching-and-signing. BRANCH=none BUG=none TEST=./util/update_release_branch.sh Change-Id: I66087190754c789387a6537b69a026c81f93ead0 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2088602 Reviewed-by: Craig Hesling <hesling@chromium.org>
* ec_commands.h: add info_4 in sensor request structureGwendal Grignou2020-03-071-1/+1
| | | | | | | | | | | | | Fixes: 267da3cfc ("common: Add feature flag for online calibration") BUG=chromium:1023858 TEST=compile BRANCH=none Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I7e7784e509062f28c8dc12d52fe8daed2ab73b23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2084398 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ec_commands.h: Minor changes to integrate with cros_ec_commands.hGwendal Grignou2020-03-051-1/+1
| | | | | | | | | | | | | | | - Update license - Extend #ifdef to remove code not needed by the kernel. BUG=chromium:945948 BRANCH=none TEST=compile. Check changes with linux-next/master cros_ec_commands.h. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: If0d5a49498a17a24ad7fae6e6bab9b7378374067 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2084024 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* getversion.sh: Generalize FP targets for nucleo-*Craig Hesling2020-03-041-1/+1
| | | | | | | | | | | | | | | | | | The nucleo-dartmonkey and future nucleo-bloonchipper will use the fingerprint private blobs and are designed to align as closely to dartmonkey and bloonchiper as possible. This patch makes these version strings equal too. BRANCH=none BUG=none TEST=make BOARD=nucleo-dartmonkey && strings build/nucleo-dartmonkey/ec.bin | grep dart TEST=make BOARD=dartmonkey && strings build/dartmonkey/ec.bin | grep dart TEST=make BOARD=bloonchipper && strings build/bloonchipper/ec.bin | grep bloon Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I8a4bce559a8c94222558e37b51b6a302595f29c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086733 Reviewed-by: Tom Hughes <tomhughes@chromium.org>