summaryrefslogtreecommitdiff
path: root/extra
Commit message (Collapse)AuthorAgeFilesLines
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-198-8/+8
| | | | | | | | | | | | | | | | 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>
* ec-devutils: restore servo_updater functionalityKevin Shelton2019-06-052-0/+6
| | | | | | | | | | | | | | | | | | Adds back and uses the close method that was defined in change 1125354. BRANCH=None BUG=chromium:968700 TEST=ran servo updater on a servo that needed an update (so that the version check was exercised twice). Signed-off-by: Kevin Shelton <kmshelton@chromium.org> Change-Id: I0ddce9749a3548d5019c138a2a2266fd93a85ca9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1643658 Tested-by: Kevin Shelton <kmshelton@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org> Commit-Queue: Kevin Shelton <kmshelton@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-244-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ec-devutils: Fix fdpexpect importDaniel Kurtz2019-05-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | As of pexpect 3.0, the fdexpect module was moved into the pexpect package. Prior to 4.0, a wrapper module was installed along with pexpect, so "import fdexpect" continued to work. In 4.0 this wrapper was removed. Importing fdexpect from pexpect works for our current pexpect 3.3, and will continue to work when we update pexpect to 4.0+. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> BRANCH=none BUG=chromium:958677 TEST=(0) with pexpect 3.3, (1) sudo servod --board=grunt TEST=(0) Uprev pexpect to 4.2.1, (1) sudo servod --board=grunt => servod works in both cases Change-Id: I9d21042713d0cc1826cf55da4af7a16f44b746bb Reviewed-on: https://chromium-review.googlesource.com/1593419 Commit-Ready: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Chris McDonald <cjmcdonald@chromium.org> Reviewed-by: Scott Collyer <scollyer@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>
* tasks: convert TASK_EVENT_CUSTOM macro to bitJett Rink2019-04-241-5/+5
| | | | | | | | | | | | | | | | | | | | | We should ensure that all custom task definition are non-zero and fit with the globally defined events. Add compile time check and change semantics to specify bit number (instead of making all callers use the BIT macro). This also fixes an error with TASK_EVENT_PHY_TX_DONE for ITE being 0. The bug that made that happen hasn't landed on any firmware branches that use it though. BRANCH=none BUG=none TEST=builds Cq-Depend:chrome-internal:1178968,chrome-internal:1178952 Change-Id: I5e1d1312382d200280c548e9128e53f4eddd3e61 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1570607 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* i2c-pseudo: Simplify install shell script.Matthew Blecker2019-04-051-18/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The script now unconditionally attempts to (re)install the module, even if it is already loaded. (This also removes a message which had a typo, mistakingly referring to i2c-dev instead of i2c-pseudo.) The script no longer attempts to load i2c-dev, since servod does that now. The script now runs "make clean" before "make" . The header comment no longer references a section of the README that was never checked in. BRANCH=none BUG=b:79684405 TEST=I ran the install script in various scenarios: 1) No i2c-pseudo module loaded or installed. 2) i2c-pseudo module loaded but not installed. 3) i2c-pseudo module installed but not loaded 4) i2c-pseudo module loaded and installed. In all cases the module was (re)installed and either left loaded (if applicable), or loaded (if not previously loaded). The script does not attempt to unload and re-load the module when re-installing only for simplicity. Change-Id: I5f2677b92406b8a49d229bc84d2efcca5504f501 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1552245 Reviewed-by: Nick Sanders <nsanders@chromium.org>
* Add i2c-pseudo Linux kernel module.Matthew Blecker2019-03-307-0/+3624
| | | | | | | | | | | | | | | | | | | | | | This Linux kernel module provides I2C adapters that can be backed by userspace programs. This allows for userspace implementations of functionality such as tunneling I2C through another communication channel to a remote I2C bus. BRANCH=none BUG=b:79684405 TEST=Used i2c-tools CLI to i2c-dev to issue I2C queries, and Python interactive interpreter as the I2C pseudo adapter controller. The i2c-pseudo module correctly proxied write, read, write+read, and multi-byte reads through the controller character device, and it correctly proxied back the responses from the character device, including the specific byte values read. Later, I implemented an I2C pseudo controller in Servod and used it to flash an ITE EC over I2C using both Servo Micro and Suzy-Q. Change-Id: Idda764e56b9e9d577302b59286e873291ea36d25 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1250029 Reviewed-by: Nick Sanders <nsanders@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>
* gsctool: do not include hashes of unrelated directoriesVadim Bendebury2019-03-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When building gsctool, getversion.sh is invoked by the Makefile, and since BOARD environment variable is set to cr50, getversion.sh is trying to retrieve the state of directories used by Cr50, but not present when gsctool is built. Let's just make sure that BOARD is not set to 'cr50' when getversion.sh is invoked. BRANCH=none BUG=none TEST='sudo emerge ec-utils' does not produce getversion.sh errors about not being able to change directory to ../../third_party/{tpm2,cryptoc}, but the version string is still available: $ gsctool -v Version: 1.1.9999-d2e5b7e, built on by @eskimo.mtv.corp.google.com note that date and user name are also not included in this case, but this is a separate unrelated issue. Change-Id: Iadd7615f980e9444c539b5e04afca3f23d080174 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1501836 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* gsctool: make sure programmed image size is properly alignedVadim Bendebury2019-03-061-0/+6
| | | | | | | | | | | | | | | | | Flash driver of the g chip requires that the size of the programmed area is evenly divisible by 4. This patch makes sure that gsctool complies with this requirement. BRANCH=none BUG=b:127295653 TEST=without this patch attempts to update Cr50 to an image built from ToT fails, with this patch the same image programs just fine. Change-Id: I064d22130a56e9e703f728bc898fd5de82d365d4 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1499657 Reviewed-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: fix version string generation and processingVadim Bendebury2019-02-192-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function reporting the version of the gsctool expects the VERSION variable generated by ./util/getversion.sh utility to start with a single underscore without a prefix. But the utility could be adding various prefixes to the VERSION string depending on the environment variable settings. Those settings are irrelevant for gsctool, it should ignore the prefix up to the first underscore character found in the VERSION string. Also, modify the Makefile to make sure the build date reported by getversion.sh is accurate. BRANCH=none BUG=chromium:932361 TEST=built gsctool and checked version reporting: make BOARD=cr50 CR50_DEV=1 gsctool ./gsctool -v Version: v2.0.821+e890d0974 tpm2:v0.0.320-e987095 \ cryptoc:v0.0.10-b256f39, built on 2019-02-15 10:25:08 \ by vbendeb@eskimo.mtv.corp.google.com Change-Id: I5fb6c4aa1dea6e857fffc7ec5e5a599d61175044 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1474736 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* console.py: Handle non-TTY input (e.g. piped input), and other improvements.Matthew Blecker2019-02-081-69/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - Do not assume stdin input is a TTY. Only attempt to manipulate terminal settings when connected to an actual terminal. - Exit upon EOF. This is mostly relevant for non-TTY input, e.g. piped input, though this is not conditioned on TTY-ness. - For non-TTY inputs, sleep before exiting after EOF, in order to allow for for reading a response from the USB console device (e.g. from the Servo). The sleep time is configurable by -S / --notty-exit-sleep command line option, default 0.2 seconds. - Replace os.sleep(0.1) busy loop with waiting on a threading.Event. - Print a newline character upon exit so that a user's shell prompt will not be printed mid-line. BRANCH=none BUG=b:123727520 TEST=I tested handling of non-TTY input by piping Servo v4 console commands such as: $ echo version | ./console.py -d 18d1:501b $ echo reboot | ./console.py -d 18d1:501b With this change, console.py now exits on its own after sending the piped command. Previously when given piped input it would lose the first character of the input due to the attempt to change TTY settings, then it would wait indefinitely for ctrl+c or other signal, and finally it would traceback upon ctrl+c. I tested handling of TTY input in the usual manner, without redirecting stdin. That still works smootly, exits without error upon ctrl+c, and no longer causes the next shell prompt to start mid-line. Change-Id: I894a40a4409b0c422b82158f452f81943277285d Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1459139 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* powerlog: Don't hijack logger when import as modulePuthikorn Voravootivat2019-01-291-5/+7
| | | | | | | | | | | BRANCH=master BUG=b:112865585,b:123259683 TEST=No log spam when import as module from autotest Change-Id: I7ced102bbb893bc1baa88c625b8c7279a1e32677 Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1437515 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* servo_updater: include sweetberry into servo_updater logicRuben Rodriguez Buchillon2019-01-032-7/+6
| | | | | | | | | | | | | | | | | | | This change allows for sweetberry to be a valid configuration for servo_updater BRANCH=None BUG=b:120449224 TEST=manual testing sudo servod_updater --board sweetberry ... ... update complete image updated Change-Id: If6a9113beb89ae8b58c70e959a77c9bb9f00607d Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1369506 Reviewed-by: Nick Sanders <nsanders@chromium.org>
* usb_updater2: increase send timeout to 2sRuben Rodriguez Buchillon2018-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | To 'successfully' flash sweetberry the 1s timeout is not sufficient. Increase to 2s. BRANCH=None BUG=b:120449224 TEST=manual test sudo servo_updater --board sweetberry ... offset: writable at 0x40000 sending 0xb580 bytes to 0x40000 ------- update complete image updated ... Change-Id: I38bf8c852caf97069fcf67f4b77f9c0a30008235 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1369507 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* gsctool: Add commands to set sn bits.Louis Collard2018-12-061-1/+146
| | | | | | | | | | | | | | | | | | Adds two commands to set sn bits, and increment sn rma count. These commands will be used in factory and RMA flows. 'gsctool -S 0x123:0x456:0x789' can be used to set sn bits 'gsctool -R <0-7>' can be used to increment rma count BUG=chromium:905408 BRANCH=none TEST=local manual tests on soraka Change-Id: Iefb2076d5f53105ab36e84973d68f571b9626501 Signed-off-by: Louis Collard <louiscollard@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1347831 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: verbose flag should print debug messagesJoel Kitching2018-12-031-8/+11
| | | | | | | | | | | | | | | | | Currently the verbose flag is stored in `verbose_mode` but never used. Print conditionally on this flag within a new `debug` function. BUG=None TEST=try running various commands with --verbose check for verbose output BRANCH=master Change-Id: Iadaf1a91ea1b02b0638e6364077c2c148f26e03c Reviewed-on: https://chromium-review.googlesource.com/1351926 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: correct a typoJoel Kitching2018-12-031-1/+1
| | | | | | | | | | | | BUG=None TEST=check for correct output with --help flag BRANCH=master Change-Id: Idf0448791e3d043313bc1291810d71d3f4846a6a Reviewed-on: https://chromium-review.googlesource.com/1351925 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: fix in setting '--tpm_mode'.Namyoon Woo2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b:119626285 reported the problem with '--tpm_mode'. $ gsctool -a --tpm_mode Unrecognized option: -m $ gsctool -a --tpm_mode enable TPM Mode: enabled (0) $ gsctool -a --tpm_mode disable TPM Mode: enabled (0) "tpm_mode" long opt should have 'has_arg' set to 'optional_argumenet', not 'required_argument'. Before this CL, --tpm_mode worked in a wrong way as reported in BRANCH=none BUG=b:119626285 TEST=manually and with autotest (crrev.com/c/1340640) as well. $ gsctool -a --tpm_mode TPM Mode: enabled (0) $ gsctool -a --tpm_mode enable TPM Mode: enabled (1) $ gsctool -a --tpm_mode disable TPM Mode: disabled (2) Change-Id: Ie11852925a21a3a3b8d9dda6092eac5040f1cd5c Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1340642 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: explicitly set buffering type to line bufferedWei-Cheng Xiao2018-11-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | This CL allows gsctool outputs to be instantly piped and shown in crosh when crosh executes cr50-verify-ro.sh, which calls gsctool, indirectly via debugd. Program stdout buffering type by default changes from line buffered to block buffered if the output is redirected to a file or pipe. Since we are going to call gsctool from inside debugd (CL:1337190) and want to pipe the output instantly to the dbus request sender, the buffering type of gsctool needs to be explicitly set. BRANCH=none BUG=b:113893821 TEST=in crosh run verify_ro, which indirectly runs gsctool via debugd, and verify that output is instantly piped and shown in crosh. (see CL:1337190 for detailed output) Signed-off-by: Wei-Cheng Xiao <garryxiao@chromium.org> Change-Id: I515854a29e5e2ede0acc8c2d9e2c4df367a5062e Reviewed-on: https://chromium-review.googlesource.com/1337250 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Louis Collard <louiscollard@chromium.org>
* gsctool: fix RO_B version number output for debug Cr50 imagesWei-Cheng Xiao2018-11-131-2/+2
| | | | | | | | | | | | | | | | | | For cr50 debug images, the RO_B version number format should be -1.-1.-1. I previously changed the output format to unsigned int, which caused the outputted version to be UINT_MAX. BRANCH=none BUG=b:119223356 TEST=manually run gsctool on a soraka device $ gsctool -b cr50.dbg.prod RO_A:0.0.10 RW_A:0.3.10[00000000:00000000:00000000] RO_B:-1.-1.-1 RW_B:0.3.10[00000000:00000000:00000000] Signed-off-by: Wei-Cheng Xiao <garryxiao@chromium.org> Change-Id: I5f842d4d5e50f35effbd2e5269dfd6946746acc2 Reviewed-on: https://chromium-review.googlesource.com/1328661 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* gsctool: minor code pruning.Namyoon Woo2018-11-051-6/+5
| | | | | | | | | | | | | | Removed a redundant if-statement BRANCH=none BUG=none TEST=gsctool -i Board ID space: 41434245:bebcbdba:00007f7f Change-Id: Ie6a1237fb5d1dc6085c1680dc1b37a9b127511f0 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1315629 Reviewed-by: Bob Moragues <moragues@chromium.org>
* gsctool: add RO_B and RW_B back to the output of gsctool -bWei-Cheng Xiao2018-11-021-38/+27
| | | | | | | | | | | | | | | | | Previous change CL:1278414 removed RO_B and RW_B from gsctool -b output and broke cr50 tests. This CL adds them back. BRANCH=none BUG=b:118701324 TEST=manually run gsctool on a soraka device $ gsctool -b cr50.bin.prod RO_A:0.0.10 RW_A:0.3.10[00000000:00000000:00000000] RO_B:0.0.10 RW_B:0.3.10[00000000:00000000:00000000] Change-Id: I0d76052ef9b6e34c4c8f4be40ac48ed3559ef3ec Signed-off-by: Wei-Cheng Xiao <garryxiao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1308242 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: Add options to print out RLZ codesBob Moragues2018-10-301-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This RLZ code is used by cr50-verify-ro.sh. The RLZ code selects the verify_ro db to use. BUG=b:90495590 BRANCH=none TEST=gsctool -i -M; gsctool -i -M -t Unit Test Rewults: localhost ~ # gsctool -i -M open_device 18d1:5014 found interface 3 endpoint 4, chunk_len 64 READY ------- BID_TYPE=4e425153 BID_TYPE_INV=b1bdaeac BID_FLAGS=00007f7f BID_RLZ=NBQS <-- CORRECT DUT RLZ localhost ~ # gsctool -i -M -t BID_TYPE=58574a45 BID_TYPE_INV=a7a8b5ba BID_FLAGS=00007f7f BID_RLZ=XWJE <-- CORRECT Test Device RLZ localhost ~ # Change-Id: I12fbca6885e3a1453544a1d379ad12ef3f6fd290 Signed-off-by: Bob Moragues <moragues@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1297034 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* gsctool: add machine output support (-M) to chip board ID (-i, -O)Wei-Cheng Xiao2018-10-254-16/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now gsctool can print out GSC board ID in a machine-friendly way. This allows other programs (e.g., debugd) to parse the output. This is the final CL that adds machine output support to gsctool during verify_ro migration. BRANCH=none BUG=None TEST=manually run gsctool -M -i and gsctool -O verify_ro.db -M on a soraka device connected with a naultilus and check the board ID part in the outputs. Sample output (the board ID part is identical in the outputs of both commands): BID_TYPE=5a534b4d BID_TYPE_INV=a5acb4b2 BID_FLAGS=00007f80 Signed-off-by: Wei-Cheng Xiao <garryxiao@chromium.org> Change-Id: Ia275806672c08841c5b5fcc7758d8e0c777b3fc9 Reviewed-on: https://chromium-review.googlesource.com/1286312 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Wei-Cheng Xiao <garryxiao@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: add machine output support (-M) to FW image info (-b)Wei-Cheng Xiao2018-10-251-91/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now can print out FW versions and board ID in the image in a machine-friendly way. This allows other programs (e.g., debugd) to parse the output. Add equality check to the firmware versions and board IDs in slot A and B. Now gsctool prints out an error message to stdout if the contents do not match; otherwise, it prints out only one copy of the contents instead of two. Sample runs: $ gsctool -b cr50.bin.prod RO_A:0.0.10 RW_A:0.3.10[ABCD:00000000:00000000] $ gsctool -b cr50.bin.prod -M IMAGE_RO_FW_VER=0.0.10 IMAGE_RW_FW_VER=0.3.10 IMAGE_BID_STRING=ABCD IMAGE_BID_MASK=00000000 IMAGE_BID_FLAGS=00000000 BRANCH=none BUG=None TEST=manually run gsctool -M -b cr50.bin.prod and gsctool -b cr50.bin.prod on a soraka device connected with a naultilus. Outputs are as the examples above. Signed-off-by: Wei-Cheng Xiao <garryxiao@chromium.org> Change-Id: I1c4c5110fe236debb93b3db118abb4c922b98bdf Reviewed-on: https://chromium-review.googlesource.com/1278414 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Wei-Cheng Xiao <garryxiao@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* gsctool: add a cmd line option -M to gsctool to allow machine-friendly outputs.Wei-Cheng Xiao2018-10-241-8/+73
| | | | | | | | | | | | | | | | | | | | Add the option's support to remote firmware version output (-f). This allows other programs (e.g., debugd) to parse gsctool outputs without worrying about any future updates on current human-readable outputs. BRANCH=none BUG=None TEST=manually run gsctool -f -M on a soraka device connected with a nautilus. Sample output: RO_FW_VER=0.0.10 RW_FW_VER=0.3.10 Signed-off-by: Wei-Cheng Xiao <garryxiao@chromium.org> Change-Id: Ic6514a191b379d05acf2656e5e395d82086d93cd Reviewed-on: https://chromium-review.googlesource.com/1278073 Reviewed-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* ec: Add macro to check if constant index is too largeGwendal Grignou2018-10-231-0/+2
| | | | | | | | | | | | | | | | | BUILD_ASSERT can only be used for declarative code, add a macro to check if a condition resolved at build time is true or not. Take advantage of compiler detection of division by zero error message. [-Werror=div-by-zero] BUG=none BRANCH=eve,nocturne TEST=compile, check error is detected when condition is not true. Change-Id: I4ab1ad4ae516c00c9e30e778dd81f18893ef1673 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1283969 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* cr50: CCD Info indicates whether all CCD capabilities are default.Namyoon Woo2018-10-111-1/+4
| | | | | | | | | | | | | | | | | CR50 provides whether CCD capabilities are default or not. Factory process can utilize this value instead of CCD cap bitmap information. Users can use either 'gsctool -I' or CR50 console command 'ccd'. BRANCH=cr50_tools BUG=b:117200472 TEST=manually set and clear the password using gsctool -a -F and check the result of gsctool -I. Change-Id: Ic6be2ce880476c3a73150fe0e29007dd6a7e328f Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1272190 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cr50: minor code revision with macros regarding CCD capabilities.Namyoon Woo2018-10-111-4/+6
| | | | | | | | | | | | | | | | | | | | Defined "Number of bits in CCD cap expression", "Bitmask for a CCD cap expression", and "Number of CCD cap expressions in a Byte," and replaced constant uses with macros in CR50 and gsctool codes. No binary size changes in either CR50 or gsctool. BRANCH=cr50_ccd BUG=none TEST=manually tested with gsctool -I and CR50 console command 'ccd'. Signed-off-by: Namyoon Woo <namyoon@chromium.org> Change-Id: If91305090444395b6a938f920f4e47e2acbba886 Reviewed-on: https://chromium-review.googlesource.com/1274007 Commit-Ready: Namyoon Woo <namyoon@chromium.org> Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* touchpad_st: make panel initialization synchronousWei-Han Chen2018-10-091-1/+1
| | | | | | | | | | | | | | | | the entire process would take up to 2 seconds. CQ-DEPEND=CL:1264236 BRANCH=nocturne BUG=b:117203130 TEST=manual on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I0cdcdb8caf3b1d9cf6a5787b93bf8cdb13832a74 Reviewed-on: https://chromium-review.googlesource.com/1264237 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* cr50_rma_open: check ccd open capabilitiesMary Ruthven2018-09-261-4/+16
| | | | | | | | | | | | | | | | | | OpenNoDevMode and OpenFromUSB will be set to Always during rma unlock. This will make open accessible from usb without dev mode. Update the testlab enable part of the script to check these before telling the user to enter dev mode. BUG=none BRANCH=none TEST=none Change-Id: I69fb7cdb9e33aa21ae1537e935046529c987edbc Signed-off-by: Mary Ruthven <mruthven@google.com> Reviewed-on: https://chromium-review.googlesource.com/1208228 Commit-Ready: Mary Ruthven <mruthven@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* servo_updater: account for versions starting with v2Vadim Bendebury2018-09-221-3/+6
| | | | | | | | | | | | | | With resent base tag update the hardcoded version number pattern in servo_updater.py needs to be adjusted. BRANCH=none BUG=b:112475211 TEST=TBD Change-Id: If3b18f563ff48eb98db95864d8f2298ead04495d Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1237714 Reviewed-by: Nick Sanders <nsanders@chromium.org>
* gsctool: refactor USB interfaceVadim Bendebury2018-09-173-171/+19
| | | | | | | | | | | | | | | | | | | | | | | | Communications with Cr50 exposed USB endpoints could be needed by other utilities, in particular, ./util/iteflash when it is extended to operate over Cr50. This patch moves USB interface functions into a separate file in the ./util directory and makes USB endpoint coordinates run time variables, so that the user of the interface can connect to various endpoints. Some refactoring is required to allow using the generic USB transfer function. BRANCH=none BUG=b:75976718 TEST=verified that gsctool still operates properly - updated a Cr50, read Cr50 version number, etc. Change-Id: I3d77a93932f5395fff0f5823f0dd79e1d1d670c8 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1198345 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* servo_updater: more informative error on failNick Sanders2018-09-081-1/+2
| | | | | | | | | | | | | | 'Can't detect updater version' is replaced with an error specifying the failed regex string. BRANCH=None BUG=None TEST=None Change-Id: Ia3a52ee27e31d0b4aab0d8f04d5cf5f346498c37 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1213556 Reviewed-by: Mary Ruthven <mruthven@chromium.org>