summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* flash_cr50: add support to reboot with the consolestabilize-14026.B-cr50_stabMary Ruthven2021-06-091-4/+33
| | | | | | | | | | | | | | If cr50 is open, flash_cr50 can just run 'reboot' on the cr50 console to reboot cr50. Add support for doing that. BUG=none TEST=flash_cr50.py -p 9999 -i $IMG -c cr50-rescue -r console_reboot Change-Id: Ibe0d7f98c64faf7f0ac35b04dfad89ad58333cac Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2945957 Reviewed-by: Namyoon Woo <namyoon@chromium.org> Commit-Queue: Namyoon Woo <namyoon@chromium.org>
* tpm_test: drbg_test: add support for using lab vectorsMary Ruthven2021-06-094-33/+245
| | | | | | | | | | | | | This adds support for running drbg_test with the lab vectors. BUG=b:189376694 TEST=./tpmtest Change-Id: I44f3671f55e1befcac36006568bf1a4deb2d4685 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2924406 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* tpm_test: add u2f hmac drbg vectorsMary Ruthven2021-06-092-0/+27226
| | | | | | | | | | | BUG=b:189376694 TEST=none Change-Id: I943a94ff35e6a387717032df5bd9d6c5ac8d4293 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2924405 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* tpm_test: drbg_test: reformat test to fix too many local variables errorMary Ruthven2021-06-091-27/+76
| | | | | | | | | | | | | | pylint says there are too many local variables in drbg test. Break out the drbg op handling into separate functions. BUG=b:189376694 TEST=./tpmtest Change-Id: Ic26cf28e85a9b56ce4f681175daaf077aea14e58 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2924404 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* tpm_test: drbg_test: save the results in a listMary Ruthven2021-06-091-3/+26
| | | | | | | | | | | | | | | Save the results in a list with their group and test case ids. We'll need all of this information to generate the response vectors for the lab. BUG=b:189376694 TEST=./tpmtest Change-Id: I9a43d8397baed30e527b213c8860a0ec740c5398 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2924403 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* tpm_test: drbg_test: explicitly state whether to check the resultMary Ruthven2021-06-091-7/+11
| | | | | | | | | | | | | | | | | We won't have the responses for the lab vectors. Add a check_result bool to the DRBG_GENERATE test items, so there's a way to tell when it needs to record the result for the generate command. The test will compare the expected result to the actual result while running if check_result is True and the expected string is not empty. BUG=b:189376694 TEST=./tpmtest Change-Id: Ifbb5ad9737a6649affce4c885083b631f5056a26 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2924402 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* tpm_test: drbg_test: be explicit about output lengthMary Ruthven2021-06-091-6/+7
| | | | | | | | | | | | | | For lab testing we won't get the response vectors just the output bit length. Add a way to specify the byte length in TEST_INPUTS. BUG=b:189376694 TEST=./tpmtest Change-Id: I1c4f6940b4ccfced9494eefce6867176c79fa06f Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2923241 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* hmac_drbg: increase output sizeMary Ruthven2021-06-091-1/+1
| | | | | | | | | | | | | | Increase the size of the hmac output buffer to 512, so it's big enough to support the lab responses. BUG=b:189376694 TEST=drbg_test.py Change-Id: Id5ff4024079241d36a33f1c36f322a27c4b929d7 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2923240 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* make: fix awk complaintstabilize-14023.B-cr50_stabVadim Bendebury2021-06-041-1/+1
| | | | | | | | | | | | | | | | | | | It has not always been like that but recently the following message started showing up on the console when building Cr50 image with CR50_DEV and H1_DEVID variables defined: awk: cmd. line:1: warning: regexp escape sequence "' is not a ... This patch fixes the problem. BUG=none TEST=running 'CR50_DEV=1 H1_DEVIDS="0 1" make BOARD=cr50 -j' succeeds and does not generate the above error message any more. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I3a34e1dc5dc3ca58928bfeac32df1ac7e1aa3c4c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2931956 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* cr50: move trng.c under CONFIG_DCRYPTO control in chip/g/build.mkstabilize-14013.B-cr50_stabVadim Sukhomlinov2021-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | In preparation to dcrypto code refactoring as independent build unit for Cr50 U2F FIPS certifcation, need to enable disabling the use of crypto provided by chip/g/dcrypto and chip/g/trng.c. While use of chip/g/dcrypto is controlled by CONFIG_DCRYPTO, chip/g/trng.c is always linked in. Since all chip/g boards (cr50, cr52*, cr53*) enable CONFIG_DCRYPTO, and logically trng is cryptographic unit, move it under CONFIG_DCRYPTO control. BUG=b:134594373 TEST=make buildall -j Change-Id: I7be47abfe961c4a216a56e15c88254b60da10005 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2937383 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* host: fixing make runtestsVadim Sukhomlinov2021-06-034-13/+12
| | | | | | | | | | | | | | | | | | | | Changes in compiler resulted in multiple warnings treated as errors, failing host test builds. Addresing warnings by checking return values. BUG=none TEST=make runtests Change-Id: Idb2686370bf041791099b3e332ff25173338e994 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2936000 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* CRYPTO_TEST: open ccdMary Ruthven2021-05-251-1/+1
| | | | | | | | | | | | | CRYPTO_TEST images don't need to have restricted CCD. Open CCD for crypto test images like we do for DBG images. BUG=none TEST=ccd is automatically open in crypto test images Change-Id: I674ef9055e1a87caf9f8b2b28f9893e79ed9e7e5 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2916576 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* H1_RED_BOARD: force rddkeepaliveMary Ruthven2021-05-251-0/+4
| | | | | | | | | | | | | Enable rddkeepalive on red boards, so nothing needs to be done to enable ccd. BUG=none TEST=build red board image. Make sure ccd is automatically enabled. Change-Id: If629ead1307d8d12cd36678bae792f1109a0839c Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2916575 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* flash_cr50: wait up to 15 seconds for EC cutoffMary Ruthven2021-05-211-2/+9
| | | | | | | | | | BUG=b:188846962 TEST=run on hatch Change-Id: I1d9ea6048cec240c830dcd5d56c41b5cbfd622a1 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2911495 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* gsctool: add flags from ti50 repostabilize-13983.B-cr50_stabstabilize-13982.88.B-cr50_stabstabilize-13982.82.B-cr50_stabstabilize-13982.70.B-cr50_stabstabilize-13982.69.B-cr50_stabstabilize-13982.60.B-cr50_stabstabilize-13982.51.B-cr50_stabstabilize-13974.B-cr50_stabrelease-R92-13982.B-cr50_stabJett Rink2021-05-141-0/+2
| | | | | | | | | | | | | | | | | | Add the two new error flag values that were introduced in the ti50 report. See https://chrome-internal.googlesource.com/ti50/common/ti50/+/main/applications/fw_updater/src/structures.rs for ti50 definitions BUG=none TEST=none Cq-Depend: chrome-internal:3831829 Change-Id: I794a49d7c0814258350b479e90167d500081433a Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2897129 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* cr50: prepare to release 0.{5,6}.30Mary Ruthven2021-05-142-2/+2
| | | | | | | | | | | BUG=b:187083680 TEST=none Change-Id: I76ad8b29b32007fde0e8a6b527f08fa2333e801a Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2897918 Reviewed-by: Namyoon Woo <namyoon@chromium.org> Commit-Queue: Namyoon Woo <namyoon@chromium.org>
* cr50: debounce successive TPM reset pulses (take two)stabilize-13971.B-cr50_stabstabilize-13970.B-cr50_stabMary Ruthven2021-05-111-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some platforms generate more than one pulse when resetting, many Intel SOCs generate two pulses, some other chips could go even higher. TPM reset on Cr50 is processed asynchronously, repetitive pulses result in multiple reset processing cycles.In case pulses are coming too soon one after another this could cause some race conditions. Let's ignore repetitive reset pulses unless there has been an attempt by the host to read a register (which is usually the very first action of the AP when booting up). Clear reset_in_progress when the TPM is stopped to ensure they aren't set at the same time. TPM stop disables tpm communication until the TPM is reset. reset_in_progress blocks resetting the tpm until there's tpm communication. We need to ensure these aren't both set at the same time otherwise the system will get into a state where it rejects tpm resets and tpm communication forever. This fixes the ccd open issue from take one where the tpm would stay disabled after opening ccd because cr50 rejected the tpm resets that would clear if_stop. BUG=b:164130916 TEST=observed that only one reset is happening on an Octopus device, while there are two pulses present on the PLT_RST_L line. Verified proper reboot multiple times in a row. use rma_auth to open ccd. Verify subsequent tpm resets reset the TPM and don't say reset already in progress. Change-Id: I62717bf3f0e9bc6d9090122e5b15d13c8f4825e5 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832434 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* CRYPTO_TEST_SETUP: enable dev featuresMary Ruthven2021-05-072-1/+4
| | | | | | | | | | | | | | | | | Enable dev features in CRYPTO_TEST builds, so it's easier to update and rollback to MP images. Add the rollback command and disable update checks. BUG=b:186663661 TEST=make clobber ; make -j BOARD=cr50 make clobber ; make -j BOARD=cr50 CRYPTO_TEST=1 Change-Id: Id8929f67f206d3222c551532c91921bd646d2a50 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875480 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* CRYPTO_TEST_SETUP: enable the tpmMary Ruthven2021-05-071-3/+3
| | | | | | | | | | | | | | | | Enable the TPM with crypto test images, so boards can boot. We saved enough space by removing smaller features. Cr50 can be built with CRYPTO_TEST and the TPM enabled. BUG=b:186663661 TEST=make clobber ; make -j BOARD=cr50 make clobber ; make -j BOARD=cr50 CRYPTO_TEST=1 Change-Id: Iedb16c182183993b4f33658e5074d94a9e711ca9 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875479 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* CRYPTO_TEST_SETUP: remove ap ro verification and spi hashMary Ruthven2021-05-071-0/+4
| | | | | | | | | | | | | | | | Remove AP RO verification and spi hash support to save space. This saves 3952 bytes in the CRYPTO_TEST image. BUG=b:186663661 TEST=make clobber ; make -j BOARD=cr50 ; make clobber ; make -j BOARD=cr50 CRYPTO_TEST=1 Change-Id: I77eb3de547fad1e4a894b0e6eff62adaa8cbf65d Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875478 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* CRYPTO_TEST_SETUP: remove unnecessary commandsMary Ruthven2021-05-071-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove these commands. CONFIG_CMD_ECRST CONFIG_CMD_SYSRST CONFIG_CMD_WP CONFIG_CMD_DUMP_NVMEM CONFIG_CMD_PINMUX CONFIG_CMD_GPIOCFG CONFIG_CMD_SLEEPMASK CONFIG_CMD_TIMERINFO CONFIG_CONSOLE_HISTORY CONFIG_I2C_XFER CONFIG_I2C_SCAN CONFIG_CONSOLE_CMDHELP This saves 6068 bytes of space. BUG=b:186663661 TEST=make -j BOARD=cr50 Change-Id: I3f559fe853ab51b9618edb3e2a5bd215c2155325 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875477 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* add CONFIG_CMD_ROLLBACKMary Ruthven2021-05-073-1/+3
| | | | | | | | | | | | | Add CONFIG_CMD_ROLLBACK for building the rollback command. BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 Change-Id: Iea22485368fbb57eed114653c6f78758cc5c8111 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875476 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* add CONFIG_SPI_HASHMary Ruthven2021-05-073-6/+15
| | | | | | | | | | | | | Add CONFIG_SPI_HASH to control building spi hash support. BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 Change-Id: If2f731897bcddec226cd0f388e94e82f7eeaeb8f Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875475 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* isolate CONFIG_AP_RO_VERIFICATIONMary Ruthven2021-05-072-0/+4
| | | | | | | | | | | | | | | Isolate CONFIG_AP_RO_VERIFICATION BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 #undef CONFIG_AP_RO_VERIFICATION doesn't have build errors. Change-Id: I9bf7e897a44302062551ecb553236a08dc96432e Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875474 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* add CONFIG_CMD_GPIOCFGMary Ruthven2021-05-072-0/+3
| | | | | | | | | | | | | Add CONFIG_CMD_GPIOCFG to control building the gpiocfg command. BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 Change-Id: Ie723ef230ac838ff8298d39fd089c232f852871e Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875473 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* add CONFIG_CMD_PINMUXMary Ruthven2021-05-072-0/+3
| | | | | | | | | | | | | Add CONFIG_CMD_PINMUX to control building the pinmux command. BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 Change-Id: I17dba6f988388c39c58aebd11ee202ae0e7d5d9f Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875472 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* add CONFIG_CMD_DUMP_NVMEMMary Ruthven2021-05-072-0/+3
| | | | | | | | | | | | | Add CONFIG_CMD_DUMP_NVMEM to control building the dump_nvmem command. BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 Change-Id: Ie42e6c4b36ebca75ce99c2f5477fa7d917fcc87f Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875471 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* add CONFIG_CMD_WPMary Ruthven2021-05-072-0/+3
| | | | | | | | | | | | | | | | Add CONFIG_CMD_WP to control building the wp commands. This adds the wp console command, the bpforce console command, and the wp vendor command. BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 Change-Id: I707ace6d35b691a49d983b714ad519ae85c7e01f Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875470 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* add CONFIG_CMD_SYSRSTMary Ruthven2021-05-072-9/+12
| | | | | | | | | | | | | Add CONFIG_CMD_SYSRST to control building the sysrst command. BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 Change-Id: I4922b5b55d895bc2f4b43614fe2af210c5fbe134 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875469 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* add CONFIG_CMD_ECRSTMary Ruthven2021-05-072-0/+3
| | | | | | | | | | | | | Add CONFIG_CMD_ECRST to control building the ecrst command. BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 Change-Id: Ia3b7a0284c594d03257fa669bff0ab8bec155125 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875468 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* signer: advance version and erase new bit in rollback mapMary Ruthven2021-05-042-4/+4
| | | | | | | | | | | | | | | | | | | BUG=b:187081660 TEST=flashing the image erases the third rollback mask bit [0.049072 update_rollback_mask: bailing out at bit 0] [0.051795 update_rollback_mask: bailing out at bit 3] [0.052886 updated 1 info map words] > sysinfo ... Rollback: 0/0/1 3/3/3 ... Change-Id: Id802e3e4b010fbc7274e34360beaa47adcd0816f Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2869128 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* flashrom: remove --fast-verify from documentationDaniel Campello2021-04-301-1/+1
| | | | | | | | | | | | | | This options is not used anymore and it was never exercised for read operations. Updating documentation to reflect current state. BUG=b:186479007 TEST=none Signed-off-by: Daniel Campello <campello@chromium.org> Change-Id: I52b66e30b916b361e0fd2b2621147f369d0844bb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2863542 Commit-Queue: Andrey Pronin <apronin@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* ccdstate: displays "CCD_MODE" instead of "CCD EXT" fieldstabilize-RUST-13932.B-cr50_stabstabilize-13942.B-cr50_stabstabilize-13935.B-cr50_stabNamyoon Woo2021-04-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | | BUG=b:186048264 TEST=ran it on Octopus. > ccdstate AP: on AP UART: on EC: on Servo: undetectable Rdd: connected KeepAlive: disabled CCD_MODE: asserted State flags: UARTAP+TX UARTEC+TX I2C SPI USBEC+TX CCD ports blocked: (none) Signed-off-by: Namyoon Woo <namyoon@google.com> Change-Id: If854d5f56c812ab04a3271b07f1ebdd5ad1e6e86 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2845279 Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Namyoon Woo <namyoon@chromium.org>
* ccdstate: add 'KeepAlive' line in outputNamyoon Woo2021-04-212-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=b:186004390 TEST=checked 'ccdstate' output in Octopus: > ccdstate AP: on AP UART: on EC: on Servo: undetectable Rdd: connected KeepAlive: disabled CCD EXT: enabled State flags: UARTAP+TX UARTEC+TX I2C SPI USBEC+TX CCD ports blocked: (none) > > > rddkeepalive true Forcing Rdd detect keepalive > > > ccdstate AP: off AP UART: off EC: on Servo: undetectable Rdd: connected KeepAlive: enabled CCD EXT: enabled State flags: UARTEC+TX I2C SPI USBEC+TX CCD ports blocked: (none) > > rddkeepalive Rdd: connected KeepAlive: enabled > > rddkeepalive false Using actual Rdd state > > rddkeepalive Rdd: connected KeepAlive: disabled Signed-off-by: Namyoon Woo <namyoon@google.com> Change-Id: Ib0517a62ddd97f334cc62530abdb8fe612ac998c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2844339 Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Namyoon Woo <namyoon@chromium.org>
* i2cp: fix read chunk processingfactory-13929.B-cr50_stabMary Ruthven2021-04-191-1/+3
| | | | | | | | | | BUG=b:184965542 TEST=see BUG Change-Id: I340af997123ad0b5329a81311663ed90ffaab4b3 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2836190 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* cr50: prepare to release 0.{5,6}.10Mary Ruthven2021-04-192-2/+2
| | | | | | | | | | | BUG=none TEST=none Change-Id: I73cca2c2e9044f9dd8b7cb9a4d558ad9c6ec83b1 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2837405 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* remove serialno commandstabilize-quickfix-13904.98.B-cr50_stabstabilize-glibc-13901.B-cr50_stabstabilize-coil-13902.B-cr50_stabstabilize-13904.67.B-cr50_stabstabilize-13904.66.B-cr50_stabstabilize-13904.62.B-cr50_stabstabilize-13904.59.B-cr50_stabstabilize-13904.58.B-cr50_stabstabilize-13904.55.B-cr50_stabstabilize-13904.49.B-cr50_stabstabilize-13904.48.B-cr50_stabstabilize-13904.47.B-cr50_stabstabilize-13904.44.B-cr50_stabstabilize-13904.43.B-cr50_stabstabilize-13904.42.B-cr50_stabstabilize-13904.41.B-cr50_stabstabilize-13904.34.B-cr50_stabrelease-R91-13904.B-cr50_stabMary Ruthven2021-04-061-22/+0
| | | | | | | | | | | | | | | | | | | | The cr50 serial number is based on the devid, so the serial number can be found using the sysinfo devid output. The serial number is the devid without '0x's, capitalized, and the space is replaced with a '-'. echo ${DEVID//0x/} | tr '[:lower:]' '[:upper:]' | tr ' ' '-' No scripts or tests use serialno. This command saves 208 bytes. BUG=b:181999426 TEST=none Change-Id: Ib6629ceb9cfa001d8c758077119717f29116cb15 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799442 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* add 'atboot' arg to rddkeepalivestabilize-13895.B-cr50_stabMary Ruthven2021-04-014-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'atboot' arg to rddkeepalive that can be used to store rddkeepalive across cr50 resets. The atboot flag gets cleared with rddkeepalive disable. BUG=b:144724216 TEST=manual # Verify 'rddkeepalive disable' is unchanged rddkeepalive disable Using actual Rdd state rddkeepalive Rdd: connected # Verify 'rddkeepalive enable' is unchanged rddkeepalive enable Forcing Rdd detect keepalive rddkeepalive Rdd: keepalive # Verify 'rddkeepalive disable' disables keepalive rddkeepalive disable Using actual Rdd state rddkeepalive Rdd: connected ccd ... Flags: 0x000000 # Verify 'rddkeepalive enable atboot' enables keepalive and sets # the atboot flag. rddkeepalive enable atboot Forcing Rdd detect keepalive atboot. rddkeepalive Rdd: keepalive (atboot) # check the ccd rddkeepalive atboot flag (0x80000) ccd ... Flags: 0x080000 reboot ... rddkeepalive Rdd: keepalive (atboot) ccd ... Flags: 0x080000 # Verify this new string doesn't break dut-control dut-control cr50.ccd_keepalive_en ccd_keepalive_en:on # 'rddkeepalive enable' doesn't touch the atboot flag rddkeepalive enable Forcing Rdd detect keepalive rddkeepalive Rdd: keepalive (atboot) # 'rddkeepalive disable' clears it. rddkeepalive disable Using actual Rdd state rddkeepalive Rdd: connected Change-Id: I10227e335a5de6ed73290ff5be2e65892913de35 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799441 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* make rddkeepalive read-only when console is lockedMary Ruthven2021-04-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Print the Rdd state when the console is locked. Don't allow setting it. BUG=none TEST=manual > ccd lock CCD locked. > rddkeepalive Rdd: connected > rddkeepalive enable Parameter 1 invalid Usage: rddkeepalive [BOOLEAN] > ccd testlab open > ccd State: Opened ... > rddkeepalive enable Forcing Rdd detect keepalive > Change-Id: Ie309e42e7ef295bb0d7e7208d4bd6c17ce799e98 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799440 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* ec-comm: make EC_PACKET_MODE_EN a wake source in all statesMary Ruthven2021-04-012-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable EC_PACKET_MODE_EN wake on high in ec_comm_init_ instead of board_configure_deep_sleep_wakepins, so cr50 will wake from regular sleep and deep sleep when EC_PACKET_MODE_EN is asserted. BUG=b:183611249 TEST=manual # Verify EC-EFS after wake from deep sleep # shutdown AP wait for cr50 to enter deep sleep ec > reboot ap-off # wait for cr50 to enter deep sleep. # Verify cr50 wakes up from deep sleep and verifies EC hash. ec > reboot ap-off # Verify EC-EFS after wake from sleep # keep AP off. Set the idle action to sleep cr50 > idle s # Disable TPM_RST_L wake to prevent that from constantly waking # cr50. cr50 > rw 0x40060284 read 0x40060284 = 0x00860008 cr50 > rw 0x40060284 0x00860000 # Verify cr50 wakes up from sleep and verifies EC hash. ec > reboot ap-off Change-Id: I7fc31154becaafaa536fc1ee6775a7723e49a469 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799447 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* ccd_config: clarify the definition of public flagsMary Ruthven2021-04-011-1/+6
| | | | | | | | | | BUG=none TEST=none Change-Id: I23c35074f42e6e5d85890f4d5009f40425e89253 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799443 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* gsctool: use dauntless vid:pid as default for d2 imagesJett Rink2021-03-231-12/+12
| | | | | | | | | | | | | | | | If a dauntless image is passed in on the command line, then default the vid:pid to daunltess's vid:pid if it wasn't specified on the command line. BUG=none TEST=upgraded d2 image without specifying -d option TEST=upgraded cr50 image without specifying -d option Change-Id: I8387d9d27432f6911df03e16249e91bd44b5558b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2782361 Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* docs/case_closed_debugging_cr50: Expand ccd open instructionsstabilize-rust-13836.B-cr50_stabstabilize-quickfix-13816.67.B-cr50_stabstabilize-LTS-13816.60.B-cr50_stabstabilize-13856.B-cr50_stabstabilize-13851.B-cr50_stabstabilize-13836.B-cr50_stabstabilize-13821.B-cr50_stabstabilize-13816.82.B-cr50_stabstabilize-13816.80.B-cr50_stabstabilize-13816.64.B-cr50_stabstabilize-13816.63.B-cr50_stabstabilize-13816.55.B-cr50_stabstabilize-13816.53.B-cr50_stabstabilize-13816.51.B-cr50_stabstabilize-13816.40.B-cr50_stabrelease-R90-13816.B-cr50_stabDavid Stevens2021-02-261-3/+4
| | | | | | | | | | BUG=b:181273639 TEST=view in gitiles Change-Id: Ibd39f3e93b082757274ccf4f4790d25ac6bb261e Signed-off-by: David Stevens <stevensd@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2719401 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* cleanup: remove unnecessary image size paddingJett Rink2021-02-191-4/+2
| | | | | | | | | | | | | | | | For dauntless images, we say that the image goes to the next 16KB aligned address, but this will get reduce anyway since we don't send the 0xFFs as the end of the transfer. Removing this just reduces unnecessary complexity BUG=none TEST=update firmware on D2 TEST=update firmware on H1 (should be no change) Change-Id: I03ce12b85138b9200a8e48ad441221d3aa3f1609 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2706038 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: use SHA256 digest for D2 instead of SHA1Jett Rink2021-02-191-19/+60
| | | | | | | | | | | | | | | Since Dauntless does not support SHA1, we need to send a SHA256 digest prefix for each firmware update packet. Haven should be unaffected by this change as it will still use SHA1 BUG=b:179683616 TEST=Verify D2 using SHA256 for validation works TEST=Verify H1 using SHA1 still works Change-Id: I4627d3d4d90e0bbe0dae78d4bb29852fad1a3149 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702316 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: drop logic for non-background supportJett Rink2021-02-191-37/+10
| | | | | | | | | | | | | | | | | | | We won't encounter H1 older than 0.0.22, and all dauntless will support background update support The alpha firmware drop (b:180042261) contains support for VENDOR_CC_TURN_UPDATE_ON in addition to VENDOR_CC_IMMEDIATE_RESET. Use VENDOR_CC_TURN_UPDATE_ON as the default. BUG=b:162244909,b:172465629 TEST=Upgrade firmware with alpha firmware before and after this change TEST=verify that Cr50 upgrade works as well Change-Id: Ibaf1d867dd4135f0041aa53273515e4228508cc3 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702315 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* u2f: Move some u2f logic to common/ for testingYicheng Li2021-02-184-102/+110
| | | | | | | | | | | | | | | | | | | | | Since this is cr50's branch, there's no semantic difference whether we put logic in board/cr50/u2f.c or common/u2f.c. EC's build system doesn't quite allow unit-testing board-specific logic, so to unit-test some of the crypto logic in board/cr50/u2f.c, things need to move to common/u2f.c. There's no change in functionality. There should also be no problem for merging/cherry-picking ToT changes to cr50_stab, because any new u2f changes are made on cr50_stab only and not on ToT. BUG=b:172971998 TEST=make run-u2f TEST=make CR50_DEV=1 BOARD=cr50 Change-Id: I3cb8d78fd6427620a6fe20cef12708899d2896b5 Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702496 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* flash_cr50: add c2d2 to allowable servo typesstabilize-rust-13795.B-cr50_stabstabilize-13799.B-cr50_stabMary Ruthven2021-02-091-1/+1
| | | | | | | | | | BUG=none TEST=run flash_cr50 with c2d2 and servo_micro Change-Id: Idba1a344fb615347ccbdca6cad3956b05be2326b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2648393 Reviewed-by: Venkata Srinivasa Raju Penmetcha <venkataraju@chromium.org>
* cr50: prepare to release 0.{5,6}.9stabilize-rust-13776.B-cr50_stabstabilize-13768.B-cr50_stabMary Ruthven2021-02-022-2/+2
| | | | | | | | | | | BUG=b:179153941 TEST=none Change-Id: I6b35f52d94ffeb49d947abbb71eb1445e4a96e7b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2669267 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* trng: change TRNG_EMPTY_COUNT to 0x7ffMary Ruthven2021-02-021-4/+5
| | | | | | | | | | | | | | | Increase TRNG_EMPTY_COUNT, so boards with slow TRNG have enough time to generate a sample. BUG=b:172542178,b:178116958 TEST=generate RSA keys 50 times on the hatch with slow TRNG. Verify the average time is around 6 seconds. Change-Id: I1b821286e1e4b5da8baa59caeda907ab3fe49f81 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2641744 Reviewed-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>