summaryrefslogtreecommitdiff
path: root/extra/usb_updater
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-0514-2784/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* servo_updater: Add clean reboot at the end of updating procedureLukasz Hajec2021-08-261-0/+3
| | | | | | | | | | | | | | | | | | | | In current state after firmware is updated we perform reboot and check if servo is in RO. Due to this check we need to reinitialize uart connection. This procedure takes resources from kernel driver and makes it impossible to use servo console from OS just after servo_updater. This patch adds additional reboot, it allows kernel driver to reconnect to servo console and use it. BRANCH=None BUG=b:196021317 TEST=run servo_updater.py, after the tool finishes job check if we can access servo EC via serial terminal using e.g. picocom /dev/ttyUSB0. Signed-off-by: Lukasz Hajec <lha@semihalf.com> Change-Id: Icebb1a2faa8803d13736ea241b894adaf146b433 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3111367 Reviewed-by: Matthew Blecker <matthewb@chromium.org> Commit-Queue: Matthew Blecker <matthewb@chromium.org>
* pylintrc: Copy Chromium OS platform2's configCraig Hesling2021-08-022-0/+8
| | | | | | | | | | | | | | | | | | | | This requests that cros lint (and repo upload hook) use the new Chromium OS 4 space indent policy. Since legacy python scripts still use 2 space, I added pylint ignore statements to the individual files to disable indentation checking. Note: There are still valid pylint errors in some of these legacy scripts. BRANCH=none BUG=none TEST=cros lint util/*.py Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I439f5a87bc50f1f43a4996e574bbc0626922a88e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3064761 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo_updater: print available versionRuben Rodriguez Buchillon2021-02-121-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces -p/--print to servo_updater. Rather than performing an update, it will print for the chosen board/channel what firmware is available. See TEST below for output. BRANCH=None BUG=b:179310743 TEST=servo_updater -b servo_micro -c alpha -p board: servo_micro channel: alpha firmware: servo_micro_v2.4.35-f1113c92b // showing py2 compatibility TEST=python2 /usr/lib64/python2.7/site-packages/servo_updater.py -b \ servo_micro --print -c alpha board: servo_micro channel: alpha firmware: servo_micro_v2.4.0-dc38d9bbb Change-Id: I9899e1cacc0496a46a41e94cc9355438a5abe491 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674381 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_updater: firmware channel retrieval as a library serviceRuben Rodriguez Buchillon2021-02-121-1/+19
| | | | | | | | | | | | | | | | | | | | | This change introduces the ability of using servo_updater as a library to check whether a firmware string (e.g. the one currently read out from the servo device) belongs to a known channel. If so, the channel will be returned. If not, None is returned to indicate this is an unknown firmware string. This can then be used to warn the user to update, or inform them what channel they are currently running. BRANCH=None BUG=b:179310743 // This is performed with the CL that uses this: chromium:2661015 TEST=sudo servod -b soraka dut-control servo_micro_firmware_channel servo_micro_firmware_channel:stable Change-Id: I49e920c7c7977b7c05828f8464af973f538f7aeb Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2661021 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_updater: consolidate common code-pathRuben Rodriguez Buchillon2021-02-121-31/+41
| | | | | | | | | | | | | | | | | | | | | Commonly the users of servo_updater (as a script, or a file) care about the firmware version string in addition to knowing what the filename is, and the configuration is. These are used to print informational messages, or check whether an update is needed among other things. This change consolidates that logic by making sure that the version string is always extracted when possible. BRANCH=None BUG=b:179310743 TEST=sudo servod -b soraka // observe logs print the servo firmware version information TEST=sudo servo_updater --board servo_micro // observe no errors Change-Id: Id7cb8f53e5fc3e1f557d74445d49fcafbda851ad Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2661020 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_updater: introduce channelsRuben Rodriguez Buchillon2021-02-121-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces the ability to pull an update from a specific channel (i.e. a specific file). See the bug for details on this project, but basically the `servo-firmware` package now bundles multiple firmware in the system, all of which are tagged to belong to a 'channel'. The name of those files is then [board_name].[channel].bin. The updater then now supports the notion of requesting a specific channel to update, if the default (stable) is not desired. Like the previous CL it also leverages choices for argparse to ensure no unknown channels are requested. BRANCH=None BUG=b:179310743 TEST=servo_updater --help | grep channel -c {alpha,dev,prev,stable}, --channel {alpha,dev,prev,stable} TEST=sudo servo_updater --board servo_micro -c alpha Current servo_micro version is servo_micro_v2.4.35-f1113c92b Available servo_micro version is servo_micro_v2.4.35-f1113c92b No version update needed Cq-Depend: chromium:2674405 Change-Id: I88c301cc4ff0ac246cbfda6498c27a1fd23f722f Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2661019 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_updater: cleanup and choicesRuben Rodriguez Buchillon2021-02-041-7/+14
| | | | | | | | | | | | | | | This change has some minor cleanup and introduces the usage of 'choices' to the board argument, to stop errors on argument parsing already. BRANCH=None BUG=b:179310743 TEST=servo_updater --help | grep board -b {c2d2,servo_micro,servo_v4,servo_v4p1,sweetberry}, --board [...] Change-Id: I676a5250d4721a309eec4a50a585a5ed719095b6 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2661018 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_updater.py: Make script more reliable and improve error reportingMichał Barnaś2021-01-211-10/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | Add verifying if jump to region was successful by executing sysinfo after every jump. Add retries if no response to command from servo was received. BUG=b:177673664 BRANCH=main TEST=Prepare a few firmware builds from different commits, to be able to verify if they were successfully flashed. Flash firmware using modified script from extra/usb_updater: sudo ./servo_updater.py -b servo_v4p1 -f <fw> Run servod to connect to servo console and execute command: version Check if both RO and RW sections have the same FW version. TEST=To check error handling, run servod in one terminal, and in another one try flashing firmware. There should be retries due to no response received. After 2-3 retries, close servod and flashing should automatically continue without errors. Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: Ic73e50592fdc5f0f8e2cd9cd2ab4f034ef17e4ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2633993 Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Commit-Queue: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
* usb_updater2: fix incorrect console outputTing Shen2021-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | argv[optind] is the index of next arg to be processed, what we want to print here is actually argv[optind - 1]. BUG=None TEST=Run `usb_updater2 -d 18d1:503c -p 208.0_2.0.bin` on Krane and check console output. Before this CL: read 65536(0x10000) bytes from (null) After: read 65536(0x10000) bytes from 208.0_2.0.bin BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I45f584672f9c264d350374b43a3dd074b4a4ff7f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2623990 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org>
* servo_updater: make more robust on resetsRuben Rodriguez Buchillon2020-12-101-48/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | long-term, we need to pull this into hdctools, rather than reimplement everything twice. Short term, this is a fine solution. It essentially makes sure that 1. we only keep one pty/stm32uart/stm32usb object around for communication 2. we always reset it properly when it could need a reset e.g. when the stm32 is rebooting, or a new firmware was flashed 3. it expands the timeout for the chip to come back to 2s the tiny_servod will eventually also land in hdctools, though for now it just ensures that we can reset the pyusb communication without larger issues and a larger refactor. BUG=chromium:1152838 BRANCH=None // Timeout before change, runs after change TEST=sudo servo_updater --board servo_micro // Timeout before change, runs after change TEST=sudo servo_updater --board sweetberry // Timeout before change, runs after change TEST=sudo servo_updater --board servo_micro --force // to show the serialname support. This is a fake serial, and it gets stuck waiting TEST=sudo servo_updater -s MICRO-S-2009020022 --board servo_micro // to show the serialname support. This is a real serial and it proceeds TEST=sudo servo_updater -s MICRO-S-2009020022 --board servo_micro Change-Id: I747ca69881c13c1aadd8e90a35badecbf4e6a09e Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2580854 Reviewed-by: Otabek Kasimov <otabek@google.com> Reviewed-by: Garry Wang <xianuowang@chromium.org>
* fw_update: fix python3 incompatibilityRuben Rodriguez Buchillon2020-11-191-1/+1
| | | | | | | | | | | | | | In py3 bytearrays are real, so we need to use 'encode' to make sure the right command is being sent BRANCH=None BUG=None TEST=None Change-Id: I28e6390d99563731f07e42a161065469aa009b11 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2548685 Reviewed-by: Dossym Nurmukhanov <dossym@chromium.org>
* fw_update: Pass bytes into `wr_command` functionYilin Yang2020-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | In `wr_command` function, we use `bytearray` to wrap the bytes argument. However, if we pass a `str` type to `bytearray` constructor, we need to specify the encoding. In this case, we need to use `bytes` here. BUG=b:172978731 BRANCH=master TEST=1. cros_workon --host start hdctools ec-devutils 2. sudo emerge hdctools ec-devutils 3. The fix applies into chroot TEST=ODM verifies in their side Signed-off-by: kerker <kerker@chromium.org> Change-Id: I57609c36e639cd6bd116b6f2f3a1baff02312070 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2543567 Tested-by: Henry Sun <henrysun@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Henry Sun <henrysun@google.com>
* tree: rename strtoul to strtoull since it is 64-bitJett Rink2020-11-111-2/+2
| | | | | | | | | | | | | | | A long is 32-bit, but a long long is 64-bit. The function name should be strtoull if it is returning 64 bits of data. BRANCH=none BUG=b:172592963 TEST=builds Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I04c40f9256ed37eb1cf9b6bd1b0ef0320fe49b0c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530874 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ecusb: Fix subprocess argument to make it py2/3 compatibleYilin Yang2020-09-261-6/+1
| | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: I78713f635e00cf01e1df641436b3a6d2f5c3c00b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2431318 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* usb_updater: Migrate fw_update.py to python2/3 compatibleYilin Yang2020-09-261-3/+4
| | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: I00a1c0868980e9b8a03ad13ea000fbe94ef3192f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2425791 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* usb_updater: Migrate servo_updater.py to python2/3 compatibleYilin Yang2020-09-261-2/+11
| | | | | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=`sudo python3 ./extra/usb_updater/servo_updater.py -b servo_v4 --force` shows "update complete". TEST=`sudo python2 ./extra/usb_updater/servo_updater.py -b servo_v4 --force` shows "update complete". Signed-off-by: kerker <kerker@chromium.org> Change-Id: I632203b9eca4aa99dc63063c37f0ab5fc2e54dbb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2425784 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ec: change usage of "sane" per inclusive languagePaul Fagerburg2020-07-221-4/+4
| | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the terms "sane", "sanity check", and similar with inclusive/non-stigmatizing alternatives. BUG=b:161832469 BRANCH=None TEST=`make buildall -j` succeeds. `grep -Eir "sane|sanity" .` shows results only in third-party code or documentation. Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Change-Id: I29e78ab27f84f17b1ded75cfa10868fa4e5ae88c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2311169 Reviewed-by: Jett Rink <jettrink@chromium.org>
* servo_updater: Updates the Servo V4.1 nameBrian J. Nemec2020-06-022-1/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* servo_updater: Re-add board name's to servo_updaterBrian J. Nemec2020-05-081-1/+5
| | | | | | | | | | | | | | | | | | | | Adds the board names back into servo_updater. These are used by manufacturing scripts in hdctools to identify which strings to pass to servo_updater. BUG=b:154527792 TEST=sudo emerge chromeos-base/ec-devutils Verified that emerge was successful TEST=sudo servo_updater Verified that the ServoV4 configuration is default TEST=sudo mfg_c2d2 Verified that C2D2 is used as target Change-Id: I75f7a8bcdd2c87951917f7ea3ec57f9288fda862 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2157570 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* servo_updater: Add Servo V4.1 to flash and servo updaterBrian J. Nemec2020-04-082-17/+30
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* servo_updater: Do not raise ServoUpdaterException on module importstabilize-12997.B-masterYu-Ping Wu2020-03-211-25/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | External tools such as platform/dev/contrib/dut-console may import servo_updater as a module. On import time, this module will check the existence of FIRMWARE_PATH and potentially raise ServoUpdaterException, which is unnecessary if the function the importing program calls does not have reference to the global variable FIRMWARE_PATH (for example, find_available_version()). In addition, there is only one function, findfiles(), that is currently using FIRMWARE_PATH and other similar global variables. Therefore, move the check for path existence inside findfiles(), so that ServoUpdaterException will not be raised on module import time. Also add servo board name constants to servo_updater to reduce duplicate string literals. BRANCH=none BUG=chromium:1061354 TEST=Run 'sudo servod -b kukui -m jacuzzi' and make sure findfiles() is called without exceptions Cq-Depend: chromium:2102179 Change-Id: I0179c44ba2a3947cb26035d97cd1ebeb453ef67a Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2102247 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* remove cr50 related filesNamyoon Woo2020-03-095-3560/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* c2d2: initial c2d2 addJett Rink2020-01-302-1/+16
| | | | | | | | | | | | | | | | | 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>
* gsctool: add 'force_ro' optionVadim Bendebury2019-12-072-2/+12
| | | | | | | | | | | | | | | | | | | | | | By design gsctool does not update the inactive RO unless the running RO version is lower than the version in the Cr50 image being transferred. With transition to the new RO version, keys and rollback map state, there is a need to enforce that both ROs on the device are updated. This patch adds a command line option which allows to update the inactive RO to the contents of the Cr50 image. BRANCH=none BUG=b:136284186 TEST=running 'gsctool -q cr50.bin' updates the inactive RO section. Change-Id: I79c21fc2cd41c40070352d8fbce0b71dd3ae2b1f Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1949547 Reviewed-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: delay RO update for old cr50 imagesMary Ruthven2019-11-221-0/+35
| | | | | | | | | | | | | | | | If Cr50 is running older than 0.3.20, delay the RO update 1 minute after the RW update, so Cr50 doesn't reject the RO blocks because their offsets are less than the RW offsets. BUG=b:144873413 BRANCH=none TEST=update board running RO 0.0.10 RW 0.3.18 to the RO 0.0.11 RW 0.3.22 image. Change-Id: I0179cc235c692133b08cd3430d71069b2f94bf69 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1929481 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* board/hammer: Fix masterball touchpad settingsNicolas Boichat2019-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the dimensions, and also the size, and make sure that updating the FW actually works (it seems like increasing the timeout to 2000ms is needed). BRANCH=kukui BUG=b:140596094 TEST=Flash masterball, no warning in console on start TEST= Host: make TOUCHPAD_FW=S8648A-15H0_FW01.bin BOARD=masterball -j USE=updater_utils emerge-kukui -av ec-utils cros deploy $IP ec-utils DUT: usb_updater2 -d 18d1:503c -r; sleep 0.5; \ usb_updater2 -d 18d1:503c -s; usb_updater2 -d 18d1:503c ec.bin usb_updater2 -d 18d1:503c -p S8648A-15H0_FW01.bin Change-Id: Ia473ac420b42f52ad1639f950a3f08ff5d32df09 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1847512 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* Unify #! use in python scriptsStefan Reinauer2019-10-012-2/+2
| | | | | | | | | | | | | | | | | | Right now we have several different versions of #! in our python scripts. Unify them all and specify that we are using python2. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BUG=none BRANCH=none TEST=make buildall Change-Id: Iab33a3f5d4b827451a55542bcee8837b00da7867 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1817948 Commit-Queue: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* servo_updater: enable paths to work on test images as wellRuben Rodriguez Buchillon2019-08-221-4/+34
| | | | | | | | | | | | | | | | | | | | | | | This change adds some logic to find config and firmware files on test images as well, where they end up being located at /usr/local/share instead. BUG=b:120921028 BRANCH=None TEST=manual testing // on fizz-labstation test image sudo servo_updater --board servo_v4 observe servo v4 getting updated Note: Test images right now do not have usb_updater2 yet (WIP) hence the test is done using fizz-labstation, a board that does come with usb_updater2 Change-Id: I4838424ed17bad5c3e2911cb967193863cd0b231 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1760974 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
* usb_updater2: fix compiler warningRuben Rodriguez Buchillon2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | The compiler complained about this, noting that error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]. This seems to fix it. BUG=b:120921028 BRANCH=None TEST=manual testing sudo emerge ec-devutils -j32 // warning disappears Change-Id: I4a4392ec7e6bc7af06dc54b6382e52a1f2c91252 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1761467 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* gsctool: print devid in image version outputMary Ruthven2019-08-131-0/+24
| | | | | | | | | | | | | | | If the image is node locked to a devid, print that information in the '-b' output. BUG=none BRANCH=none TEST=get version output of node locked and prod signed image. Change-Id: I0db2828d7bd699013ec84467c7e2a4b918bd7b27 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1742913 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: add support for endorsement seed vcMary Ruthven2019-08-131-3/+85
| | | | | | | | | | | | | | | Add support for getting and setting the endorsement key using the vendor command. BUG=b:138943966 BRANCH=none TEST=Get/Set endorsement seed using vendor command. Change-Id: I5c2f5d9efa0fbc236731430cac650785693c8db8 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1740076 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: make options mutually exclusiveMary Ruthven2019-08-131-2/+3
| | | | | | | | | | | | | | | | Fix the mutually exclusive check, so using 2 raises an error. Also fix the error message to show -U instead of -u. Upstart isn't exclusive. CCD unlock is. BUG=none BRANCH=none TEST=gsctool -i -U raises an error. Change-Id: Iaf43f18fefc1a8c4b6612b05daa5c82a7680b310 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1742220 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: process intermittent flash log retrieval errorsVadim Bendebury2019-06-041-12/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Flash log access could be denied in case there is a previously started log operation in progress. Flash log by design is a 'the best effort' facility, let's re-try a few times if Cr50 returns an error when flash log read is attempted. Also, allow the -L optional parameter to be a decimal value, this is better aligned with the output format where timestamp is reported as a decimal value. BRANCH=none BUG=b:132287488 TEST=ran two concurrent processes, one constantly adding flash log entries using Cr50 console command, and another one constantly retrieving entries using 'gsctool -a -L' observed reliable operation over long periods of time, with occasional flash log lockup log entries reported by the Cr50 (as expected). - verified proper operation when a decimal value is passed in as a -L optional parameter. Change-Id: I4510490c73d616e0d84776f483b9ee7bf11bcbc3 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1639094 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: make more debug output availableVadim Bendebury2019-06-011-4/+4
| | | | | | | | | | | | | | This would allow to see up to 20 bytes of each packet sent to the TPM when -v command line option is passed to gsctool. BRANCH=none BUG=none TEST=ran 'gsctool -a -L -v' and observed expected traces. Change-Id: If0988e71a3856b2e213b906315651a84051317ce Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1639095 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* ec-devutils: update for pyusb-1.0.2Nick Sanders2019-05-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pyusb 1.0.2 changed two API calls upon which we depend: b3ee6cdfef8f find function returns an iterator. dac78933f6a6 Removed unnecessary length argument to util.get_string This CL only updates callers of these APIs (the previous CL contained some unrelated changes around kernel driver detach and closing stm32usb). Signed-off-by: Nick Sanders <nsanders@chromium.org> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Based-on: https://chromium-review.googlesource.com/1125354 BRANCH=None BUG=chromium:958677 TEST=precq passes TEST=chromiumos-sdk tryjob buildbucketId=8915374561970847360 TEST=using servo v2 servod -b grunt => no python exceptions when starting servod TEST=using servo v4 servod -b grunt => no python exceptions when starting servod TEST=using u-Servo: servod -b grunt => no python exceptions when starting servod for i in {1..10000} ; do echo $i $(dut-control ec_uart_en spi1_buf_en ); done => No stability regression versus pyusb-1.0.0b1 TEST=servo_updater, EC console via servo Cq-Depend: chromium:1597548,chromium:1597156,chromium:1597157 Change-Id: Ic8101707838e5d19e901cf1f7125b97b5102f089 Reviewed-on: https://chromium-review.googlesource.com/1597156 Commit-Ready: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
* gsctool: add ability to get/set flash log timestamp baseVadim Bendebury2019-05-241-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recently introduced vendor command is used to get or set flash log timestamp. BRANCH=none BUG=b:132287488 TEST=on the device ran various incarnations of the command (> prompt on the Cr50 console, # is the DUT bash): > flo 10 10 > flo 1:00 13:0a 0a 0b 0c 0d 0e 0f 10 11 12 13 ==== afger a few seconds ===== # /var/tmp/gsctool -a -T Current H1 time is 68 ==== afger some more time ===== > flo 5 5 > flo 1:00 13:0a 0a 0b 0c 0d 0e 0f 10 11 12 13 398:05 05 06 07 08 09 # /var/tmp/gsctool -a -T 300 error: return value 1 # /var/tmp/gsctool -a -T 1000000 > flo 6 6 > flo 1:00 13:0a 0a 0b 0c 0d 0e 0f 10 11 12 13 398:05 05 06 07 08 09 1000022:06 06 07 08 09 0a 0b # /var/tmp/gsctool -a -T Current H1 time is 1000052 Change-Id: I16ceb97a32b4d452705f9df3826151f3e4e45832 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1610721 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: further optimize parameter descriptionVadim Bendebury2019-05-241-56/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to duplicate short and long option strings in the .opt and .help_text fields, one is enough. To properly format --help output in case the command line argument expects a parameter, part of the .help_text string has to be printed concatenated with the option strings. Let's retrieve the short and long option strings form from the .opt structure and use '%' as the formatting character to allow to indicate that the the beginning of the help message needs to be printed concatenated with the option strings. Also correct the general description. BRANCH=none BUG=none TEST=help text before this change: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv $ gsctool -h Usage: gsctool [options] [<binary image>] This utility allows to update Cr50 RW firmware, configure various aspects of Cr50 operation, analyze Cr50 binary images, etc. The required argument is the file name of a full RO+RW binary image. A typical Chromebook use would expect -s -t options included in the command line. Options: -a,--any Try any interfaces to find Cr50 (-d, -s, -t are all ignored) -b,--binvers Report versions of Cr50 image's RW and RO headers, do not update -c,--corrupt Corrupt the inactive rw -d,--device VID:PID USB device (default 18d1:5014) -f,--fwver Report running Cr50 firmware versions -F,--factory [enable|disable] Control factory mode -h,--help Show this message -I,--ccd_info Get information about CCD state -i,--board_id [ID[:FLAGS]] Get or set Info1 board ID fields ID could be 32 bit hex or 4 character string. -k,--ccd_lock Lock CCD -L,--flog [prev entry] Retrieve contents of the flash log (newer than <prev entry> if specified) -M,--machine Output in a machine-friendly way. Effective with -b, -f, -i, and -O. -m,--tpm_mode [enable|disable] Change or query tpm_mode -n,--serial SERIAL Cr50 CCD serial number -O,--openbox_rma <desc_file> Verify other device's RO integrity using information provided in <desc file> -o,--ccd_open Start CCD open sequence -P,--password Set or clear CCD password. Use 'clear:<cur password>' to clear it -p,--post_reset Request post reset after transfer -R,--sn_rma_inc RMA_INC Increment SN RMA count by RMA_INC. RMA_INC should be 0-7. -r,--rma_auth [auth_code] Request RMA challenge, process RMA authentication code -S,--sn_bits SN_BITS Set Info1 SN bits fields. SN_BITS should be 96 bit hex. -s,--systemdev Use /dev/tpm0 (-d is ignored) -T,--tstamp <stamp> Set flash log timestamp base -t,--trunks_send Use `trunks_send --raw' (-d is ignored) -U,--ccd_unlock Start CCD unlock sequence -u,--upstart Upstart mode (strict header checks) -V,--verbose Enable debug messages -v,--version Report this utility version -w,--wp Get the current wp setting ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ and after this change: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv $ ./extra/usb_updater/gsctool -h Usage: gsctool [options] [<binary image>] This utility allows to update Cr50 RW firmware, configure various aspects of Cr50 operation, analyze Cr50 binary images, etc. <binary image> is the file name of a full RO+RW binary image. Options: -a,--any Try any interfaces to find Cr50 (-d, -s, -t are all ignored) -B,--background_update_supported Force background update mode (relevant only when interacting with Cr50 versions before 0.0.19) -b,--binvers Report versions of Cr50 image's RW and RO headers, do not update -c,--corrupt Corrupt the inactive rw -d,--device VID:PID USB device (default 18d1:5014) -f,--fwver Report running Cr50 firmware versions -F,--factory [enable|disable] Control factory mode -h,--help Show this message -I,--ccd_info Get information about CCD state -i,--board_id [ID[:FLAGS]] Get or set Info1 board ID fields. ID could be 32 bit hex or 4 character string. -k,--ccd_lock Lock CCD -L,--flog [prev entry] Retrieve contents of the flash log (newer than <prev entry> if specified) -M,--machine Output in a machine-friendly way. Effective with -b, -f, -i, and -O. -m,--tpm_mode [enable|disable] Change or query tpm_mode -n,--serial Cr50 CCD serial number -O,--openbox_rma <desc_file> Verify other device's RO integrity using information provided in <desc file> -o,--ccd_open Start CCD open sequence -P,--password Set or clear CCD password. Use 'clear:<cur password>' to clear it -p,--post_reset Request post reset after transfer -R,--sn_rma_inc RMA_INC Increment SN RMA count by RMA_INC. RMA_INC should be 0-7. -r,--rma_auth [auth_code] Request RMA challenge, process RMA authentication code -S,--sn_bits SN_BITS Set Info1 SN bits fields. SN_BITS should be 96 bit hex. -s,--systemdev Use /dev/tpm0 (-d is ignored) -T,--tstamp [<tstamp>] Get or set flash log timestamp base -t,--trunks_send Use `trunks_send --raw' (-d is ignored) -U,--ccd_unlock Start CCD unlock sequence -u,--upstart Upstart mode (strict header checks) -V,--verbose Enable debug messages -v,--version Report this utility version -w,--wp Get the current wp setting ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Change-Id: I5afd2473dbdaf9edc515ee9f02b932effe3755c5 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1628113 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: consolidate processing of optional parametersVadim Bendebury2019-05-241-29/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Standard libc getopt_long() and getopt() functions do not allow the optional parameters to follow the command line option without the equal sign ('='), but gsctool utility users expect this form to be available, so additional processing is done for command line arguments accepting optional parameters. This additional processing code is duplicated for each such argument. On top of that, some arguments which described as requiring the parameter (not optional) still include code which looks for the command line option. Information about expected parameter type is included in the long options descriptor table, so it is not readily available if the user specified the short version of the argument in the command line. To consolidate processing of the optional parameters in one place, in case the user specified the short version of the command line argument, the long_opts table is looked up to find the appropriate long version, then the parameter type is checked, and if the parameter is supposed to be optional, the next command line token is examined to determine if this is the optional parameter. BRANCH=none BUG=none TEST=tried the following commands: - tried the following commands: ./extra/usb_updater/gsctool -b # reports missing file name error # All the following succeed processing command line parameters: ./extra/usb_updater/gsctool -m ./extra/usb_updater/gsctool -m enable ./extra/usb_updater/gsctool --tpm_mode enable ./extra/usb_updater/gsctool --tpm_mode=enable # All the following fail processing command line parameters # reporting 'Invalid tpm mode arg: xxx.': ./extra/usb_updater/gsctool -m xxx ./extra/usb_updater/gsctool --tpm_mode xxx ./extra/usb_updater/gsctool --tpm_mode=xxx Change-Id: I68e9cc312aa8a5a2cccbd78df66a24ac71f78c36 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1621185 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: refactor command line arguments processingVadim Bendebury2019-05-241-89/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a couple of issues with command line processing code: - command line options must be listed in two different places if we want to allow both short and long forms of the same argument - help text for commands is included in yet another place in the code Indeed, from the libc getopt_long() point of view the long options table and short options string are completely unrelated: the function scans the command line arguments vector for -x[x[y]] or --word command line options style and looks up either short_opts or long_opts depending on the encountered command line token's style. The standard way to cross reference long options table and the short options string is to put the short option character in the long option table's entries .val field. This is how it is done in gsctool. What this means is that as long as all short command options are referenced in the long_opts table, the short command option string could be generated based no the long_opts table. The help text and long_opts table would still remain separate and require manual syncing. To help with that problem this patch introduces a container structure, which includes both long option contents and the help text for each command line option. This allows to build the long_opts table and then the short_opts string on the fly, based on the contents of the single table, and also generated the --help output, ensuring consistency of all representations. BRANCH=none BUG=none TEST=as follows: - temporarily added debug code to print out the generated short option string, got the following: aBbcd:fF:hIikLMmn:O:oPpR:rS:stUuVvw which is extended to include previously omitted 'f': aBbcd:F:fhIikLMmn:O:oPpR:rS:stUuVvw - verified that 'gsctool -h' outputs before and after this patch are the same apart from including help text for -B - verified that it is still possible to update a Cr50 - verified --board_id/-i command with various optional parameter representations. Change-Id: Ie8d409c6c8866247323cee93ce5b9bfbe22046fa Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1617077 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: use the usb serial number to find the usb deviceMary Ruthven2019-05-121-3/+19
| | | | | | | | | | | | | | | | | Add a serial number arg that can be used to specify which CCD device to use. If there are multiple CCD devices, you can use this arg to pick which device to update. BUG=none BRANCH=none TEST='gsctool -f -n $SERIAL' can be used to get the cr50 version from two chromebooks connected to the same machine. 'gsctool -f' still works too. Change-Id: I91cbfdc7d62bee2623919e4dded62f92ba7adb19 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1600501 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* usb_if: use the device with the matching serial numberMary Ruthven2019-05-121-1/+1
| | | | | | | | | | | | | | There might be multiple devices with the same VID:PID connected to the host. Use the serial number to find the correct device if it is given. BUG=none BRANCH=none TEST=none Change-Id: I96f31e8e7ceb0dd2c3c643771b38752da88a2a9e Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1600500 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* gsctool: enforce order of Cr50 section updatesVadim Bendebury2019-04-301-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When both RO and RW updates are required, and the RO includes a new RW signing key, to ensure recovery from failed updates, the RW section of the image needs to be updated before the RO section, In this case interrupted RO or RW update will result in the H1 rebooting still using the original RO and original RW. If the RO was updated first and the RW update was interrupted, the chip could end up with the newer RO with no RW to verify with the new key. BRANCH=none BUG=b:74100307 TEST=created an image with fake RO_B version number of 0.0.106, and then tried to update to this image. Observed that RW_B was transferred before RO_B [1067.694175 FW update: starting...] at 0x84000 at 0x84400 at 0x84800 ... at 0xbb400 at 0x80000 at 0x80400 at 0x80800 at 0x80c00 at 0x81000 at 0x81400 at 0x81800 at 0x81c00 at 0x82000 at 0x82400 Change-Id: Ie5240c14c6b7d73c00baac693be724fab4636992 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1586590 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* servo_updater: make regex more robustRuben Rodriguez Buchillon2019-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | Seen some logs where due to the regex cutting out too soon, the servo_updater assumes an update might be needed whereas the version on the v4/micro is actually already up to date. This change tightens the regex used to query the version by requiring it to match some sort of newline character after the version string as well. BRANCH=None BUG=chromium:933978 TEST=manual testing sudo servod_updater [observe it working well] Change-Id: I0b3139a120087d49d6f4bd52267d191716d3b541 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1481770 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* gsctool: add command line option for log retrievalVadim Bendebury2019-03-281-5/+53
| | | | | | | | | | | | | | | | | The new command line option accepts a single optional parameter, the timestamp. If the parameter is not given, the entire log is retrieved one entry at a time. If the parameter is given, only entries newer than the passed in timestamp are retrieved. BRANCH=none BUG=b:63760920 TEST=tried retrieving log entries from an H1 running the updated Cr50 code. Change-Id: I317a659dfc7ebe24cf6f1d957bf0b6d29fb94518 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1525149 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* Make the argument to --sn_bits a 96-bits hex stringYves Arrouye2019-03-261-22/+41
| | | | | | | | | | | | | | This makes the argument simpler to understand and produce. BUG=chromium:940327 TEST=manual on a device Change-Id: I9226116f52011dab1967196e1c236dd36b11e4c4 Signed-off-by: Yves Arrouye <drcrash@google.com> Reviewed-on: https://chromium-review.googlesource.com/1514215 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Yves Arrouye <drcrash@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: Add error code description if authcode fails.Cheng-Han Yang2019-03-201-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When doing RMA reset and the auth code is rejected, gsctool only reports the error code, which is not clear for the user. This CL adds the failure reason to make the message clearer. BUG=b:128801501 TEST=make gsctool; manually test on DUT BRANCH=none [Before fix] localhost $ gsctool -a -r "A" rma unlock failed, code 1 Processing response... localhost $ gsctool -a -r "ABCDEFGH" rma unlock failed, code 6 Processing response... [After fix] localhost $ gsctool -a -r "A" Processing response... rma unlock failed, code 1 (wrong authcode size) localhost $ gsctool -a -r "ABCDEFGH" Processing response... rma unlock failed, code 6 (authcode mismatch) Change-Id: I5db4d8f7cffe5b582f48fdc3b7fb27493b3715ff Signed-off-by: Cheng-Han Yang <chenghan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1527905 Commit-Ready: Cheng-Han Yang <chenghan@chromium.org> Tested-by: Cheng-Han Yang <chenghan@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: fix bug in scanning Boolean optionsVadim Bendebury2019-03-181-1/+1
| | | | | | | | | | | | | The scan should continue while scanned entries are not empty. BRANCH=none BUG=none TEST='gsctool -f is not reporting error anymore. Change-Id: Ie8316de1b95b511ed6c2b3f65c4cfbd92822edf8 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1529711 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* gsctool: refactor assignment of Boolean flag optionsVadim Bendebury2019-03-172-42/+57
| | | | | | | | | | | | | | | Many of gsctool command line options result in setting a Boolean flag. This patch collects all such flags in a structure, and uses a function to iterate over flags when examining command line options. BRANCH=none BUG=none TEST=verified that Boolean command line options still can be set. Change-Id: Id4a14e573ced893650c4c1c81f8ef92fc0d03bc5 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1525148 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* gsctool: noop clean upVadim Bendebury2019-03-171-19/+26
| | | | | | | | | | | | | | Replace C++ style comments with C style comments and alphabetize the help output. BRANCH=none BUG=none TEST=gsctool still builds, -h output is ordered. Change-Id: I1a6f10873c123d61773911e97cbf32fce7447ff7 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1525147 Reviewed-by: Namyoon Woo <namyoon@chromium.org>