summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* getversion.sh: Add cryptoc git hash for fingerprintCraig Hesling2020-03-041-0/+3
| | | | | | | | | | | BRANCH=none BUG=none TEST=make BOARD=dartmonkey && strings build/dartmonkey/ec.bin | grep dart Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I845a6b72ca2489f8a89d9a856820300af0375e32 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086556 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* getversion.sh: Add private/.../fpc git hash for fingerprintCraig Hesling2020-03-041-0/+3
| | | | | | | | | | | | | | | | | | | | | Since we have moved the private FPC code/blobs into a sub-repository under private/, we should also represent the sub-repo in the version string. It now shows up as an additional "fpc:vBLAH-HASH". BRANCH=none BUG=b:150731735 TEST=make BOARD=dartmonkey && strings build/dartmonkey/ec.bin | grep dart TEST=make BOARD=nocturne_fp && strings build/nocturne_fp/ec.bin | grep noct TEST=make BOARD=bloonchipper && strings build/bloonchipper/ec.bin | grep bloon TEST=make BOARD=hatch_fp && strings build/hatch_fp/ec.bin | grep hatch TEST=make BOARD=nami_fp && strings build/nami_fp/ec.bin | grep nami Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ibf045a4f853e3a3589d84d8a62a726264223387e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086732 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* compare_build.sh: Fix restore detached HEADCraig Hesling2020-03-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the scenario where you want to run compare_build.sh, but you are currently are in a detached HEAD state. Without it, ./compare_build.sh moves your HEAD and cannot restore it. The command "git rev-parse --abbrev-ref HEAD" only returns a unique identifier (branch name) when HEAD is on a branch. If you are in detached HEAD mode, it simply returns HEAD, which isn't useful. BRANCH=none BUG=none TEST=git checkout cros/master git rev-parse HEAD ./util/compare_build.sh git rev-parse HEAD # We should still be on the same hash Change-Id: Ib8dbedc61a77567262fceab59c17e1fb9c78cdd6 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2080917
* usb_mux: retimer: mux as chained mux and retimerDenis Brockus2020-02-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes retimers appear as generic muxes. By allowing a chain of muxes they can be stacked up to the new configurations that zork requires and will continue to work as they did before on configurations that only have a single mux. The code used to have two different arrays, 1) muxes and 2) retimers. On one of the zork configurations the processor MUX stopped being the primary mux and the retimer took its place. In a different configuration of that same platform it left the primary and secondary alone but the mux_set FLIP operation had to be ignored. Since the same interfaces needed to be available for both it stopped making sense to have two different structures and two different methods of handling them. This consolodates the two into one. The platforms that do not have retimers, this change will not make any difference. For platforms like zork, it will remove the retimers and make them chained muxes. So testing on trembyle makes sense to verify, BUG=b:147593660 BRANCH=none TEST=verify USB still works on trembyle Change-Id: I286cf1e302f9bd3dd7e81098ec08514a2a009fe3 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2066794 Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* common/system: Add sysinfo host commandTom Hughes2020-02-281-0/+80
| | | | | | | | | | | | | | | | | | This command is useful to use during testing to verify the state of the system (e.g., locked/unlocked, currently running image, etc.). BRANCH=none BUG=b:146447208 TEST=make buildall -j TEST=ectool --name=cros_fp sysinfo TEST=ectool --name=cros_fp sysinfo flags TEST=ectool --name=cros_fp sysinfo reset_flags TEST=ectool --name=cros_fp sysinfo firmware_copy Change-Id: I714b6bd8c0d7192386404c25a831e38438fa5238 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2047032 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* common/system: Unify ec_current_image and system_image_copy_tTom Hughes2020-02-282-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "enum ec_current_image" is exposed in ec_commands.h (and used by non-EC code, such as biod). We also have an "enum system_image_copy_t" that is the exact same thing (though has a few more definitions). A followup CL (I714b6bd8c0d7192386404c25a831e38438fa5238) adds the "sysinfo" host command, so we want to be able to expose all the potential image variants. Rather than maintain two enums that can potentially get out of sync, unify the code to use a single enum. We choose to keep the "enum ec_current_image", since external code depends on it. To verify that this change results in no changes to the generated binaries: ./util/compare_build.sh --board all BRANCH=none BUG=b:146447208 TEST=./util/compare_build.sh --board=all Change-Id: I13776bc3fd6e6ad635980476a35571c52b1767ac Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2036599 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* c2d2: add support for I2C-based flashingJett Rink2020-02-271-10/+27
| | | | | | | | | | | | | | | | Add necessary console command to allow C2D2 to pass through i2c bus for ec and ap. Also hook into common ite programming mode code. BRANCH=servo BUG=b:148610186,b:147381671 TEST=flash ampton with C2D2 adapter Change-Id: I1d9b20684b45ff0d101b9cfff8b0b0a85e6c0c70 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2064594 Reviewed-by: David Schneider <dnschneid@chromium.org> Reviewed-by: Matthew Blecker <matthewb@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* util: add flash_cr50 script for updating cr50.Mary Ruthven2020-02-261-0/+771
| | | | | | | | | | | | | | | | | | | | | | | Add a flash_cr50 script for updating cr50. The script supports updating through gsctool and cr50-rescue. BUG=b:144048851 BRANCH=none TEST=manual python util/flash_cr50.py -i $IMAGE -p 9999 -c cr50-rescue on octopus. python util/flash_cr50.py -i $IMAGE -p 9999 --method=cr50_reset_odl -c cr50-rescue python util/flash_cr50.py -i $IMAGE -c 'sudo gsctool' python util/flash_cr50.py -i $IMAGE -s $SERIAL Change-Id: Ibdd213446fea4cb66f77c6b7249c02914bd0712a Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1907469 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* flash_ec: add pointer to iteflash.mdJett Rink2020-02-251-2/+3
| | | | | | | | | | | | | | | If we cannot find the linux i2c pseudo module then it may have never been installed. The iteflash.md document walks the users how to set up everything correctly. BRANCH=none BUG=none TEST=none Change-Id: I97de487b2d495772d77d7d6085905be64cdf9ec5 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2064590 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* iteflash: honor Ctrl+C signalJett Rink2020-02-251-12/+4
| | | | | | | | | | | | | | | Ensure all configuration (e.g. CCD, FTDI, linux) abort when Ctrl+c is pressed. BRANCH=none BUG=none TEST=Verify the Ctrl+c quits when using linux driver with C2D2 Change-Id: Idc0555ae9689a118d9375f2b31f24cc7d1e61a4b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2064591 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* util: Fix shellcheck warnings in getversion.shTom Hughes2020-02-241-13/+14
| | | | | | | | | | | | | | | | BRANCH=none BUG=none TEST=make buildall -j TEST=for i in $(ls build); do \ bcompare build/$i/ec_version.h \ build.new/$i/ec_version.h; done Change-Id: If7c30746816075ab9958da96466b3a834746b0e1 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2063377 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Raul E Rangel <rrangel@chromium.org> Commit-Queue: Raul E Rangel <rrangel@chromium.org>
* util: convert config_option_check.py to Python 3Jack Rosenthal2020-02-221-18/+28
| | | | | | | | | | | | | | | | | | | | The main fixes that were needed were: * Use utf-8 encoding from git subprocess. * Don't use 'is' to compare string equality (Python does not guarantee interning of strings). For the parser state, the string comparison was removed by changing this to an Enum, since we have Python 3 anyway. BUG=chromium:1031705 BRANCH=None TEST=create commit with invalid config options and run script, notice the script points them out and exits 1, then test without that commit, no output and exit 0. Change-Id: I1113e063f747f0207c4b59a74f4e4a06bbcd5fcd Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2068520 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>