summaryrefslogtreecommitdiff
path: root/util/flash_ec
Commit message (Collapse)AuthorAgeFilesLines
* flash_ec: remove verify-whole option for npcx_(int_)spiNamyoon Woo2020-06-231-11/+0
| | | | | | | | | | | | | | | | | | | This patch removes the verification of the whole firmware area for npcx_spi and npcx_int_spi chip. The reason is flash_ec programs WP_RO and EC_RW area only so it should verify partially on those area only, not the whole area. The option "--fast-verify" already was used for that purpose in flash_ec script. BUG=b:158864362 BRANCH=none TEST=ran flash_ec on nami. Signed-off-by: Namyoon Woo <namyoon@google.com> Change-Id: If08194697e1b15b13c592be94d5268359edd6b5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2254739 Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Namyoon Woo <namyoon@chromium.org>
* 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>
* 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>
* 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>
* 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>
* 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_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>
* 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>
* 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>
* 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>
* 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>
* 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>
* flash_ec: no stderr redirection in flashrom runNamyoon Woo2020-01-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes stderr redirection in running flashrom to flash-size, so that flash_ec log would contain more information on error cases. It could be verbose even for success case, but flash_ec script would take the last output in number as SPI_SIZE. BUG=none BRANCH=none TEST=manually ran flash_ec with Suzy-Q and Servo_Micro on reef. - success case $ ./util/flash_ec --chip=npcx_spi --image ${IMG} --verbose INFO: EC build system didn't recognize . Assuming no baseboard. INFO: Using ccd_cr50. ... INFO: Running flashrom: sudo /usr/sbin/flashrom -p raiden_debug_spi:target=EC, serial=0580300D-91984377 --flash-size flashrom v0.9.9 : : on Linux 5.2.17-1rodete3-amd64 (x86_64) flashrom v0.9.9 : : on Linux 5.2.17-1rodete3-amd64 (x86_64) bus=0x01,address=0x43 | Cr50 INFO: Programming EC firmware image. INFO: Running flashrom: ... - failure case: servo_micro was not connected to the dut. $ ./util/flash_ec --chip=npcx_spi --image ${IMG} --verbose INFO: EC build system didn't recognize . Assuming no baseboard. INFO: Using servo_v4_with_servo_micro. ... INFO: Running flashrom: sudo /usr/sbin/flashrom -p raiden_debug_spi:serial=SNCQ03109 --flash-size flashrom v0.9.9 : : on Linux 5.2.17-1rodete3-amd64 (x86_64) flashrom v0.9.9 : : on Linux 5.2.17-1rodete3-amd64 (x86_64) bus=0x01,address=0x17 | Servo Micro No EEPROM/flash device found. ERROR: Failed to determine chip size! INFO: Restoring servo settings... dut-control --port=9999 cold_reset:off dut-control --port=9999 spi1_vref:off dut-control --port=9999 spi1_buf_en:off dut-control --port=9999 cold_reset:on dut-control --port=9999 cold_reset:off Change-Id: I642f62081e92bec68d01dcf4e2a4bb71a0131163 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2031644 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* c2d2: initial c2d2 addJett Rink2020-01-301-2/+14
| | | | | | | | | | | | | | | | | C2D2 is a debug board bring that uses an 8-pin debug header that is pin compatible with the em100 flash emulator. BRANCH=none BUG=b:145314772 TEST=UART communication for EC and H1 TEST=UART flashing of EC TEST=SPI reading and writing TEST=Automatic Vref detection for UART upon connect and disconnect Change-Id: I023994ed78942f2307e4adb802b5cc96afdf7e24 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1991849 Reviewed-by: Diana Z <dzigterman@chromium.org>
* util/flash_ec: filter fds out of pid listDavid Schneider2020-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | crosbug.com/444931 naturally has me wanting to run flash_ec outside of the chroot, which means potentially newer system utilities. I don't know when exactly it changed, but somewhere between lsof version 4.85 (in the chroot) and version 4.89 (my system), lsof auto-selects the fd field (labeled f) to always be output, which gets mixed in with the PIDs and PPIDs the script wants. Filtering out the f field allows the flash_ec tool to proceed as normal. BRANCH=none BUG=none TEST=flashed an EC outside of the chroot Change-Id: Iee6ee7dfb338ffae900ff8b4cc70d7a6c1afab22 Signed-off-by: David Schneider <dnschneid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/673724 Reviewed-by: Shawn N <shawnn@chromium.org>
* jslrvp: add Jasperlake RVP supportDivagar Mohandass2019-12-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Following features are enabled and verified. 1. Power sequencing 2. Host communication 3. Battery 4. Charger 5. USB TYPE-C MUX, DP/HDMI, USB2/3 6. TPM-SOC communication 7. LED 8. Keyboard BRANCH=none BUG=b:146693933 TEST=Build, flash and boot the Jasperlake RVP platform to OS make BOARD=jslrvp_ite; sudo util/flash_ec --board=jslrvp_ite Change-Id: I80227833fcfca5636ac8f30abc099db5717bfa05 Signed-off-by: Divagar Mohandass <divagar.mohandass@intel.com> Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1980091 Reviewed-by: Justin TerAvest <teravest@chromium.org>
* util/flash_ec: Rename '--get-size' -> '--flash-size'Edward O'Callaghan2019-12-021-1/+1
| | | | | | | | | | | | | | | | | Upstream decided the argument '--flash-size' is more consistent and so we added support to that in both our flashrom and upstream. Rename here so that when we switch to upstream mosys doesn't break. BUG=b:142436013 BRANCH=none TEST=none Change-Id: I4ae50109b7cb3fd001188ef86072d1f221f73062 Signed-off-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1936072 Reviewed-by: Sam McNally <sammc@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* flash_ec: Fix accidental dut-control invocationFei Shao2019-11-261-1/+1
| | | | | | | | | | | | | | | | There's a typo when calling dut_control in CL:1884252, which causes "--port" argument is missing when executing flash_ec. BUG=b:145103343 BRANCH=kukui TEST="util/flash_ec --image ${IMG} --board ${BOARD} --port 9998" works Change-Id: I8c79797be4a665bd9ab8c3770c5199f2f798c6c4 Signed-off-by: Fei Shao <fshao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1932869 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* flash_ec: Fix servo micro boot0 for fpmcu/usbpdCraig Hesling2019-11-221-0/+4
| | | | | | | | | | | | | | | | | This CL fixes servo micro flashing for fpmcu and usbpd. This broke after crrev.com/c/1884252. The error seen was the following: ./util/flash_ec: line 496: servo_micro_usbpd_boot0: command not found BRANCH=nocturne,hatch BUG=none TEST=./util/flash_ec --board=dartmonkey --image=./build/nocturne_fp/ec.bin Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ic98fb31e29ee25d5397d38d5e742727a909994e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1924990 Reviewed-by: Jett Rink <jettrink@chromium.org>
* flash_ec: enable UUT (UART) programming from microJett Rink2019-11-111-0/+27
| | | | | | | | | | | | | | | | | | | CL:1884410 adds the necessary dut control for servo micro that depends on the new servo micro console command (CL:1884190). If you make the appropriate rework on servo micro to control the DIR2 pin on the level shifter for the EC UART with TP1, then flash EC will successfully flash an EC using UUT (UART) with servo micro device. BRANCH=none BUG=b:143163043 TEST=flashed phaser using reworked servo_micro Cq-Depend:chromium:1884410 Change-Id: Ic45abb32d20f5c357d1fef154feea31cabb17672 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1884252 Reviewed-by: Keith Short <keithshort@chromium.org>
* flash_ec: Look for flashrom in PATH before /usr/sbinRaul E Rangel2019-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | /usr/sbin should have lower priority than $PATH. This allows pointing to a different version of flashrom by setting the path variable. It shouldn't have any impact because by default flashrom is installed in /usr/sbin. BUG=none BRANCH=none TEST=PATH=/tmp/zork:$PATH flash_ec --board=zork --image=foo.bin Change-Id: Ie656bec10145734bdec1f067b08f164afcf89e90 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1842034 Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* flash_ec: Support image name with spacesRaul E Rangel2019-10-041-2/+2
| | | | | | | | | | | | BUG=none BRANCH=none TEST=Flashed a zork ec image with a space in the name Change-Id: I9915f04f222de7a34e757fddcb30563d66093c71 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1842033 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* flash_ec: Add support for dartmonkey and bloonchipperCraig Hesling2019-08-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | This adds the aforementioned aliases to the flash_ec script. These aliases already exist as boards, thanks to crrev.com/c/1715638. Aliases: dartmonkey --> nocturne_fp bloonchipper --> hatch_fp BRANCH=none BUG=b:140059271,b:136678758,b:137108509 TEST=sudo servod -b dragonclaw ./util/flash_ec --board=bloonchipper --image=build/bloonchipper/ec.bin TEST=sudo servod -b dragontalon ./util/flash_ec --board=dartmonkey --image=build/dartmonkey/ec.bin Change-Id: Id4476da4cab9e72092b529c1bfc52acb4edd44cd Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1769491 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* flash_ec: npcx_uut uses "--read-flash" flag to read EC binaryNamyoon Woo2019-08-261-14/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | flash_ec used to get a flash memory size from EC UART command "flashinfo", and pass it to uartudatetool with read command. If EC is in a bad status, then it failed to read EC binary, because flashinfo wasn't responded. Thanks to the patch crrev.com/c/1763888, flash_ec doesn't need to pass the flash memory size to uartupdatetool to read binary. Instead, it just passes "--read-flash". This CL also handles the comparison between the different sized binaries. BUG=b:139752920 BRANCH=null TEST=manually ran flash_ec on platforms. $ util/flash_ec --board ${BRD} --image ${IMG} --verify - Checked on hatch with ccd and servo_v2. - Checked on liara with ccd, servo_v2 and servo_micro. - Checked on fleex with ccd and servo_micro. - Checked on scarlet with ccd. Cq-Depend:chromium:1763888 Change-Id: I196420dc29ce95c6737dbc241ba92660557d2bc5 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1766095 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org>
* flash_ec: use active_v4_deviceMary Ruthven2019-08-221-4/+31
| | | | | | | | | | | | | | | | | | | | Servo may be using ccd and servo micro. Update the flash_ec servo type to reflect which device actually has control of the DUT, so flash_ec can make the correct decisions about how to flash the device. Add the device prefix to all dut-control commands. If servo is using ccd and servo_micro, ccd controls will be prefixed with 'ccd_cr50.'. Add this prefix to all dut-control commands. BUG=b:35579416 BRANCH=none TEST=flash phaser ec ec using servo_v4_with_servo_micro_and_ccd_cr50, servo_v4_with_servo_micro, and servo_v4_with_ccd_cr50 Change-Id: I3d561ceb3c0ef0d95678c8346fb9922fd44378bf Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1757272 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* hammer: Add magnemite boardNicolas Boichat2019-08-161-0/+1
| | | | | | | | | | | | | | | A close hammer derivative. BRANCH=none BUG=b:138968914 TEST=make BOARD=magnemite -j Flash into staff, see the board boot: util/flash_ec --board=magnemite --port=9000 Change-Id: Ibe5c3f4b0fb4a31d4667d5dc4d76a691b0e64e39 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741599 Reviewed-by: Yilun Lin <yllin@chromium.org>
* util: make flash_ec tolerant with dummy npcx_uut chipNamyoon Woo2019-08-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | flash_ec fails when npcx_uut chip in a bad status doesn't respond at all, especially upon ec_flash_size query. This patch subpress the exit on ec_flash_size query failure, because that information is not mandatory in flashing EC. BUG=none BRANCH=none TEST=manualy tested on kohaku. 1. programmed kohaku EC with a wrong binary. 2. checked kohaku EC in a bad status, and was not able to respond. 3. ran flash_ec and checked flash_ec finished EC FW program. e.g. flash_ec --board kohaku --image ${IMG} 4. read EC firmware back. e.g. flash_ec --board kohaku --read ${TMP_IMG} Change-Id: Ic853dd9f827217621cd598c799c68fbbf970078a Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753009 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* tglrvp_ite: Add TGL-U/Y RVP base codeDaniel Gonzalez2019-08-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | Added TGL-U/Y RVP base code using ITE EC. Following features are enabled. 1. TCPC + retimer 2. Charger 3. Battery 4. Power sequencing 5. Host communication 6. LED 7. Keyboard BUG=b:138597987 BRANCH=none TEST=Both TGLRVP U&Y can boot to ChromeOS Change-Id: Idf6be38796c26b31be6e13485a63ec13487bf954 Signed-off-by: Daniel Gonzalez <daniel.d.gonzalez@intel.com> Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1726943 Reviewed-by: Keith Short <keithshort@chromium.org>
* flash_ec: support "--read" and "--verify" flags for npcx_uutNamyoon Woo2019-08-141-23/+74
| | | | | | | | | | | | | | | | | | | | | | This patch enables flash_ec to read EC image from npcx_uut type chip, and to verify the flash programmed image. BUG=b:133265593 BRANCH=none TEST=manually ran flash_ec on fleex and careena. flash_ec --board flex --image ${IMG} --verify flash_ec --board flex --read ${TMP_IMG} flash_ec --board careena --image ${IMG} --verify flash_ec --board careena --read ${TMP_IMG} Cq-Depend: chromium:1748803 Change-Id: Ifaefa64b0efed6c875c99ede59a3a1e0dfe0bf7f Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1749554 Reviewed-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Raul E Rangel <rrangel@chromium.org>
* hammer: Add masterball boardNicolas Boichat2019-08-121-0/+1
| | | | | | | | | | | | | | | | A close hammer derivative. BRANCH=none BUG=b:138968914 TEST=make BOARD=masterball -j Flash into staff, see the board boot: util/flash_ec --board=masterball --port=9000 Change-Id: I9f8d897c23d0f53557c6d6789c33e5b776dca982 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741589 Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* flash_ec: removing the bandaid fix on setting i2c_mux for npcx_uutNamyoon Woo2019-08-101-17/+1
| | | | | | | | | | | | | | | The issue in http://b/126189871 has been fixed thanks to pseudo_i2c driver. There is no need to retry 'dut-control dut_i2c_mux:ec_prog'. BUG=b:126189871 BRANCH=none TEST=ran flash_ec on Ampton twice in a raw using CCD, and servo_v4 as well. Change-Id: I72e2bf8eb48dff7a3c81545221ac71a44469c033 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1746974 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* flash_ec: die explicitly on error casesNamyoon Woo2019-08-091-18/+34
| | | | | | | | | | | | | | | | | | | | | | | This patch lets flash_ec die on any of program, read and verification errors. Intends to help testers recognize those failures easier. BUG=b:137386185 BRANCH=None TEST=Ran flash_ec on several platforms with program and verify args. Also checked the exit code for each case, and temp file deletion as well: - Fleex (Octopus) with servo_micro, and ccd, covering npcx_int_spi and npcx_uut - Ampton(Octopus) with servo_micro, and ccd, covering it83xx - Atlas with servo_v2, servo_micro, and ccd, covering npcx_int_spi - Scarlet with ccd, covering stm32 - DragonTalon with servo_v2 and servo_micro, covering stm32 - Coral with servo_v2, servo_micro, and ccd, covering npcx_spi Change-Id: I5a545f6ac6f4b09f405a51bb69c3adf2d3d6cb6e Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1745348 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* fluffy: Initial board commit.Aseda Aboagye2019-07-171-0/+1
| | | | | | | | | | | | | | | | | | | | This contains the initial firmware for Fluffy rev 1.1 boards. Fluffy is a 20:1 USB-C power mux. For more information, see go/usbc-fluffy. BUG=b:136671092,b:134075217,b:134074302,b:134074465,b:134075521, b:134075834 BRANCH=None TEST=flash fluffy, verify it boots and functions. Change-Id: Ica6817e7cfa4481aa98fed1c24ea243bf622eb2a Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1535117 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
* flash_ec: fix in returning the error code 1 for missing temp fileNamyoon Woo2019-06-221-2/+2
| | | | | | | | | | | | | | | | | When flashing ec with servo_micro, though it was successful, flash returned 1 at the end. It was from an attemp to delete temp files, which do exist at all. This patch makes it tolerant. BUG=chromium:977240 BRANCH=None TEST=manually ran on Atlas Change-Id: I48f4d256cb7e98e9762d4821db48fbbbdfb94815 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1670844 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Adds filtering of the STM32 DFU devices to eliminate devices withBrian J. Nemec2019-05-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | DFU's 'Runtime' identifier. Some USB devices include the DFU Runtime descriptor during normal use. These devices are detected as potential targets by DFU-UTIL causing it to incorrectly identify multiple potential DFU targets leading to errors while flashing. This change adds an additional requirement using the device's expected vendor:product id to select the correct device. BUG=b:133329195 BRANCH=none TEST=Verified DFU with STM32 based devices: Servo_v4, Servo_Micro, and Sweetberry flash as expected. Verified that the awk correctly extracts and eliminates devices with the DFU's Runtime identifier when a suitable device connects. Verified pattern matching on variations of the serial. Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: I2331b5e06d2eebf8dc28f20b9dd6b10bf2abe02a Reviewed-on: https://chromium-review.googlesource.com/1626650 Commit-Ready: Todd Broch <tbroch@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
* flash_ec: prevent null entry in dut-control recovery listNamyoon Woo2019-05-171-2/+8
| | | | | | | | | | | | | | | | | | With some faulty platforms, dut-control might fail and dut-control recovery list might have a null entry. On flash_ec exit, the command run "dut-control ''" displays a long error message, which confuses users. This CL prevents that happening. BUG=None BRANCH=None TEST=manually ran on hatch, scarlet and coral Change-Id: I26b8c46b5ce6ff529cd368adeb6b24a01ed14566 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1614360 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* flash_ec: expand the list of directories where npcx_monitor.bin can be foundPaul Fagerburg2019-05-171-9/+16
| | | | | | | | | | | | | | | | | | | | | Add the dirs for LOCAL_BUILD or EMERGE_BUILD to the list of directories to search for npcx_monitor.bin. Prioritize the directory where the EC binary is located (which could be specified with the --image parameter). BUG=b:132350402 BRANCH=none TEST=Build with 'sudo emerge ec-devutils' Test with and without an --image parameter: flash_ec --board=kohaku flash_ec --board=kohaku --image=build/kohaku/ec.bin Verify that flash_ec is able to locate npcx_monitor.bin in both cases. Change-Id: I5a679d1bc215cc0383f60e02aa702db79cd968b3 Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1613437 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* flash_ec: fix in restoring "fw_up" controlNamyoon Woo2019-05-081-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | crrev.com/c/1593817 falsely restored "fw_up" at exit. It was supposed to restore "fw_up" as "off" unconditionally , but it restored with the initial value at the beginning of flash_ec. Fixed it by specifying the recovery value in the function servo_save_add(). BUG=b:132097230 BRANCH=None TEST=manually ran flash_ec on atlas via servo_v2. ./util/flash_ec --board atlas --image /Downloads/atlas/ec.bin --verbose INFO: Using servo_v2. INFO: Using ec image : /Downloads/atlas/ec.bin dut-control --port=9999 i2c_mux_en:on dut-control --port=9999 i2c_mux:remote_adc INFO: Flashing chip npcx_int_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 spi1_vref:pp3300 spi1_buf_en:on dut-control --port=9999 spi1_buf_on_flex_en:on ... Erasing and writing flash chip... Verifying flash... VERIFIED. SUCCESS 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 fw_up:off <--- It is recovered as 'off'. 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 Change-Id: I423b921fd54f59a5e3538d1fbdd0fb6b09632625 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1597798 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* flash_ec: collect dut-control values to restore before they changeNamyoon Woo2019-05-041-73/+57
| | | | | | | | | | | | | | | | | | | | | | | | This CL enables add dut-control values to restore during execution. This helps flash_ec store necessary values only. Also this CL fixes the problem that flash_ec failure leaves spi1_buf_en:on, not restoring to off. Cq-Depend:chromium:1591590 BUG=None BRANCH=None TEST=manually ran flash_ec on duts. soraka with servo_v2, ccd_cr50 scarlet with servo_v2, ccd_cr50 dragontalon with servo_v2, servo_micro coral with servo_v2, servo_micro, ccd_cr50 grunt(liara) with servo_v2, servo_micro, ccd_cr50 fleex with servo_v2, servo_micro, ccd_cr50 ampton with servo_v2, servo_v4, ccd_cr50 Change-Id: Iefb8c85125841040ab408551ab254f8151080a54 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1593817 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* flash_ec: Update error msg and TODO bug num for servo I2C adapter lookup.Matthew Blecker2019-04-091-16/+6
| | | | | | | | | | | | | | | | | | This also removes the placeholder code for a dut-control command that does not actually exist yet. BRANCH=none BUG=b:79684405,b:130165933 TEST=Ran flash_ec using Servo v4 -> Servo Micro -> Ampton. With i2c-pseudo loaded and servod running, reflashing worked. With i2c-pseudo unloaded and servod running, the new error message was written stderr and flash_ec exited non-zero as desired. Change-Id: Icfa4f4a894eda6c683a2d1cef4a87b3ac3a0a359 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1558371 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* flash_ec: sort STM32 boards alphabeticallyNicolas Norvez2019-04-021-1/+1
| | | | | | | | | | | | | | hatch_fp had been added in the wrong place, fix the ordering. No functional changes. BRANCH=None BUG=b:124996507 TEST=None Change-Id: I7e1602d80db9366bf0e97f03abe1f0f7af2aa670 Signed-off-by: Nicolas Norvez <norvez@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1547141 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* flash_ec: Have iteflash use I2C through servod with CR50 CCD.Matthew Blecker2019-04-011-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously flash_ec would instruct iteflash to communicate directly with CR50 when using CCD. Now the same communication path through servod is used with Servo Micro is also used with CR50. Benefits: 1) Allows for resolving b:126189871 without adding significant new complexity in servod. Without this, fixing that bug would involve implementing CR50 I2C USB endpoint disconnect and reconnect commands, exposing them through dut-control, and ensuring they play nicely with I2cPseudoAdapter. With this, that bug can be trivially fixed, and then the retry loop in flash_ec around dut_i2c_mux:ec_prog can be deleted. 2) Simplifies flash_ec with slightly less differences needed in iteflash invocation. BRANCH=none BUG=b:75976718,b:79684405,b:124388894,b:126189871 CQ-DEPEND=CL:1250029,CL:1546592 TEST=The following servo + board combinations were tested: flash_ec -> iteflash -> servo_micro -> bip flash_ec -> iteflash -> servo_v4 -> servo_micro -> bip flash_ec -> iteflash -> servo_v2 -> bip flash_ec -> iteflash -> servo_v4 -> cr50 -> bip Change-Id: I36009b01e45576c786ea78853baf46b52d2232d6 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1522846 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* flash_ec: change the default bitbang rate to 57600Namyoon Woo2019-03-301-1/+1
| | | | | | | | | | | | | | | | | | Bitbanging in 9600 bps is not stable. Since the current cr50 implementation is optimized for 57600 and complaints with 9600 bps are growing, the default rate should be set to 57600. BUG=b:129570292 BRANCH=None TEST=manually ran flash_ec on scarlet and kului. Change-Id: Ibd7d0240662b44853b53d2e067bdbe70a0d760e3 Signed-off-by: Namyoon Woo <namyoon@google.com> Reviewed-on: https://chromium-review.googlesource.com/1545087 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* flash_ec: add support for hatch_fpTom Hughes2019-03-301-1/+2
| | | | | | | | | | | | | | Same as nocturne_fp. BRANCH=None BUG=b:124996507 TEST=manually flash over UART/servo Change-Id: I2218a7bfd9dea5b31ec10b1738c9b26ccbd291b9 Signed-off-by: Nicolas Norvez <norvez@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1541828 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Tom Hughes <tomhughes@chromium.org>
* flash_ec: fixes dut-control invocation error.Namyoon Woo2019-03-281-25/+22
| | | | | | | | | | | | | | | | | | | | | It fixes in executing dut-control with parameters, which are in array type. The purpose of crrev.com/c/15246070 was to replace the external tool dependencies (e.g. cut or sed) with bash built-in function. BUG=b:129425648 BRANCH=None TEST=ran flash_ec on several duts with servo_v2, and servo_v4_with_(servo_micro|ccd_cr50). - coral and scarlet/kukui: http://gpaste/6534367952240640 - octopus_npcx and octopus_ite: http://gpaste/5062482861228032 Change-Id: I37b7b8a075f636a094b1ec25a63c10e7eddd6d99 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1541951 Reviewed-by: Matthew Blecker <matthewb@chromium.org>