summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* apro: clear AP_RO_FAIL on combo0Mary Ruthven2022-08-251-1/+16
| | | | | | | | | | | | | | | | | | | | | | There are a couple of known issues saving the AP RO verification hash in cr50, so it's possible AP RO verification will fail even if the AP RO is ok. Add support for releasing the EC from reset with PWRB + refresh after AP RO verification fails. This just makes it easier to recover the device. If the device is released from reset, the status is set to AP_RO_FAIL_CLEARED and a APROF_FAIL_CLEARED flog event is logged. This only releases EC reset if the device failed AP RO verification. Any other verification status won't get cleared by the key combo. BUG=b:240530668 TEST=trigger verification on a device with a bad hash. Verify the EC is held in reset until PWRB + refresh is pressed. make -C extra/usb_updater gsctool Change-Id: I03a02501e7c91a41374816d82f48a5289f289c39 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3805820 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* cr50/nvmem: fix unmarshalling of objectContextID in TPM2 state loadVadim Sukhomlinov2022-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems this field is only accessed by TPM2_ContextSave command, didn't affect the format of data and only led to faster increase of object context ids. It is unclear if it is related to TPM_RC_OBJECT_MEMORY errors. BUG=b:242870497 TEST=TCG test ------------------------------- Test Environment ----------------------- Test Suite Version: 2.1a Operating System: Linux TDDL Version: SocketTDDL ---------------------------------- Test Object ------------------------- TPM Vendor: CROS TPM Firmware Version: 2de0a64 8 TPM Spec Version: 1.16 Vendor Specific Info: xCG , fTPM, , Tested Spec Version: 1.16 ------------------------------ Test Result Summary --------------------- Test executed on: Fri Aug 19 10:04:45 2022 Performed Tests: 248 Passed Tests: 248 Failed Tests: 0 Errors: 0 Warnings: 0 ======================================================================== Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Change-Id: I81c4e8ffbb79c709b046f4db57d86d6007d3574d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3842207 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Code-Coverage: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org>
* apro: add new return codes (take two)Mary Ruthven2022-08-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new ap_ro_integrity_check return codes. The existing AP_RO_PASS (1) return code doesn't verify the GBB. Rename it to AP_RO_PASS_UNVERIFIED_GBB. Shimless RMA should only treat AP_RO_PASS (6) as a pass. Nothing returns this right now. This CL also adds AP_RO_IN_PROGRESS(7). AP_RO_IN_PROGRESS is used if AP RO verification is ongoing. AP_RO_FAIL_CLEARED will be used in a followup CL. old: 1 - AP_RO_PASS new: 1 - AP_RO_PASS_UNVERIFIED_GBB ... 6 - AP_RO_PASS 7 - AP_RO_IN_PROGRESS This saves 8 bytes since it also shortens a print message. The remaining space changes from 5804 to 5812 bytes. BUG=b:234497234 TEST=make buildall -j; make -C extra/usb_updater/ gsctool Change-Id: I9f8b45f5564d453cbb4386b318b65d977d8b3f73 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3828596 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Revert "apro: add new return codes"stabilize-15054.98.B-cr50_stabstabilize-15054.26.B-cr50_stabstabilize-15054.115.B-cr50_stabrelease-R106-15054.B-cr50_stabJudy Hsiao2022-08-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c1f5a5481f1121e2f408055f04906205b779dc91. Reason for revert: b:242249503 ``` gsctool.c:2382:2: error: duplicate case value 2382 | case AP_RO_UNSUPPORTED_NOT_TRIGGERED: | ^~~~ gsctool.c:2373:2: note: previously used here 2373 | case AP_RO_UNSUPPORTED_NOT_TRIGGERED: | ^~~~ ``` Original change's description: > apro: add new return codes > > Add new ap_ro_integrity_check return codes. The existing AP_RO_PASS (2) > return code doesn't verify the GBB. Rename it to > AP_RO_PASS_UNVERIFIED_GBB. Shimless RMA should only treat > AP_RO_PASS (7) as a pass. Nothing returns this right now. > This CL also adds AP_RO_FAIL_CLEARED(8) and AP_RO_IN_PROGRESS(9). > AP_RO_IN_PROGRESS is used if AP RO verification is ongoing. > AP_RO_FAIL_CLEARED will be used in a followup CL. > > old: > 2 - AP_RO_PASS > > new: > 2 - AP_RO_PASS_UNVERIFIED_GBB > ... > 7 - AP_RO_PASS > 8 - AP_RO_FAIL_CLEARED > 9 - AP_RO_IN_PROGRESS > > This saves 8 bytes since it also shortens a print message. The remaining > space changes from 5804 to 5812 bytes. > > BUG=b:234497234 > TEST=make buildall -j > > Change-Id: I8d19a411c2534236c9defa82291872420c19a15b > Signed-off-by: Mary Ruthven <mruthven@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3805819 > Reviewed-by: Andrey Pronin <apronin@chromium.org> > Commit-Queue: Andrey Pronin <apronin@chromium.org> Bug=b:234497234, b:242249503 Change-Id: I63ebc6a1343410e3b2a5ab0684a8a533553ec1ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3826713 Reviewed-by: Andrey Pronin <apronin@chromium.org> Auto-Submit: Judy Hsiao <judyhsiao@google.com> Tested-by: Judy Hsiao <judyhsiao@google.com> Owners-Override: Judy Hsiao <judyhsiao@google.com> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Andrey Pronin <apronin@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org>
* apro: add new return codesMary Ruthven2022-08-111-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new ap_ro_integrity_check return codes. The existing AP_RO_PASS (2) return code doesn't verify the GBB. Rename it to AP_RO_PASS_UNVERIFIED_GBB. Shimless RMA should only treat AP_RO_PASS (7) as a pass. Nothing returns this right now. This CL also adds AP_RO_FAIL_CLEARED(8) and AP_RO_IN_PROGRESS(9). AP_RO_IN_PROGRESS is used if AP RO verification is ongoing. AP_RO_FAIL_CLEARED will be used in a followup CL. old: 2 - AP_RO_PASS new: 2 - AP_RO_PASS_UNVERIFIED_GBB ... 7 - AP_RO_PASS 8 - AP_RO_FAIL_CLEARED 9 - AP_RO_IN_PROGRESS This saves 8 bytes since it also shortens a print message. The remaining space changes from 5804 to 5812 bytes. BUG=b:234497234 TEST=make buildall -j Change-Id: I8d19a411c2534236c9defa82291872420c19a15b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3805819 Reviewed-by: Andrey Pronin <apronin@chromium.org> Commit-Queue: Andrey Pronin <apronin@chromium.org>
* chargen: update for cr50 branchMary Ruthven2022-08-051-1/+1
| | | | | | | | | | | | | | | The cr50 branch doesn't have uart_buffer_full. It has uart_buffer_room. Update chargen to use uart_buffer_room instead of uart_buffer_full, so it'll work with cr50. BUG=b:240718978 TEST=none Change-Id: I5f9a5d8a3cdc15db7a7ca66d54f7997dce165fd9 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3805823 Commit-Queue: Andrey Pronin <apronin@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* base64: add implementation for encoding binary into base64Vadim Bendebury2022-06-132-0/+105
| | | | | | | | | | | | | | | | | | | | In the Cr50 tree there is no really output devices other than console where base64 encoding output could be sent, and there is no use for decoding function yet. Add the encoding function implementation, make it possible to send output to console by default and optionally to a passed in function. Add test to verify proper encoding. BUG=b:234745585 TEST='make run-base64' succeeds. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: Ibc10681632bc649320d602e319e4f634b4b3a1d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3701141 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* cr50: Add corp format to u2f_attestHoward Yang2022-06-031-13/+31
| | | | | | | | | | | | | | | Add a format for u2fd-corp attestation to u2f_attest, and corresponding test case in u2f_test.py BUG=b:233147441 TEST=make buildall -j TEST=u2f_test.py Change-Id: I4d12345fd0531a4be091c05670215444fe38e706 Signed-off-by: Howard Yang <hcyang@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3670107 Reviewed-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* ap_ro_integrity_check: update hash until the bid type is savedMary Ruthven2022-05-041-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some devices the board id flags are set to lock in the phase and the board id type isn't set until the board is finalized. RO may be changed until the board id type is written. Change the check from board_id_is_erased to board_id_type_is_blank, so the factory can update the AP RO hash until the board is finalized. This is the same check we do in sn_bits. Try to read the board id and then check the type. In the future, we may want to consolidate. BUG=b:230430292 TEST=manual Clear the board id Set the hash python ap_ro_hash.py GBB gsctool -aA prints the digest Set the BID flags gsctool -ai 0xffffffff:0x1234 Clear the hash gsctool -aH gsctool -aA get hash rc: 10 AP RO hash unprogrammed Set the hash python ap_ro_hash.py GBB gsctool -aA prints the digest Clear the hash gsctool -aH gsctool -aA get hash rc: 10 AP RO hash unprogrammed Set the BID type gsctool -ai $(cros_config / brand-code):0x1234 Verify cr50 rejects setting the hash python ap_ro_hash.py GBB ERROR: Cr50 returned 7 (BID programmed) Change-Id: I440ee84b3c86e16f027a8b9dcd51ea3031171ea1 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3627808 Reviewed-by: Andrey Pronin <apronin@chromium.org> Commit-Queue: Andrey Pronin <apronin@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* ap_ro_integrity_check: delay sleep after deasserting AP FLASH SELMary Ruthven2022-04-251-0/+2
| | | | | | | | | | | | | | Delay sleep to give AP_FLASH_SELECT enough time to discharge. Future CLs will do more to ensure AP_FLASH_SELECT isn't asserted entering deep sleep. This CL does the bare minimum to fix AP RO verification. BUG=b:229974371 TEST=Trigger AP RO verification on Hoglin Change-Id: Iec10c51dfe8e7df2b1bb2210c4705d90c3c89c54 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3606093 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* u2f: do not commit state changes on TPM command context.Vadim Bendebury2022-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | g2f_attestation_cert() is another function which is invoked on the TPM command context, when virtual TPM NVMEM spaces are read. One of the side effects of invoking of g2f_attestation_cert() is the creation of the U2F state, if it did not exist before. In this case the state should not be immediately committed to the NVMEM, the commit will happen when the TPM command execution is completed. BUG=b:199981251 TEST=running ./test/tpm_test/tpmtest.py does not trigger the 'attempt to commit in unlocked state' message any more. 'make buildall' and 'make CRYTPO_TEST=1 BOARD=cr50' pass Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I708e8807ffd3207cc6ab84a0e380908e715f7a15 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3482487 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* ccd_config: add more options to why_deniedMary Ruthven2022-03-011-1/+2
| | | | | | | | | | | | | Some boards don't use battery presence for ccd. They just have a chassis_open signal. Update the why_denied message to add this option. BUG=b:197974058 TEST=check ccd open denial message Change-Id: I92254b35cc98492709ec14a26a71cecc7d273a6b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3498701 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* ccd_config: allow the option to restrict ccd in prepvt imagesMary Ruthven2022-03-011-2/+0
| | | | | | | | | | | | | | | | | By default ccd open can be sent from the console in normal mode with prepvt images. The open capabilities are set to Always which should determine that open is allowed, but prepvt images completely ignore the ccd settings. This change modifies the CCD_OPEN_PREPVT behavior to honor the capabilities, so someone could restrict ccd open in prepvt images with the ccd capability settings. BUG=b:221260041 TEST=manual see bug Change-Id: I1c3fc4f5be27a08ea9071966cc01c4b9ff20dbe5 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3498700 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* cr50: return the time since user_pres was assertedMary Ruthven2022-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a vendor command that returns the time since user_pres_l was asserted. This is only used for testing. Tracking user_pres_l needs to be enabled with a vendor command since DIOM4 may not be pulled up and may be pulled down on old boards. Enabling the vendor command survives deep sleep reset. It gets cleared after cr50 reset. Cr50 clears the user_pres_l status if tracking is disabled. BUG=b:219981194,b:208504127 TEST=manual # Verify it survives deep sleep sudo gsctool -y enable sudo gsctool -y ... user pres enabled # enter deep sleep sudo gsctool -y ... user pres enabled # Verify it doesn't survive cr50 reboot sudo gsctool -y enable sudo gsctool -y ... user pres enabled cr50 > reboot sudo gsctool -y ... user pres disabled # Check gsctool output after triggering DIOM4 pulse sudo gsctool -y enable # Trigger pulse and wait 5 seconds sudo gsctool -y ... user pres enabled last press: 5064331 Change-Id: Ib37980a5cd8d3378bf718e8e32a7d4152435a816 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3495863 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* cr50: preserve ordely nv spaces over TPM resetstabilize-quickfix-14526.91.B-cr50_stabstabilize-14528.B-cr50_stabstabilize-14526.89.B-cr50_stabstabilize-14526.84.B-cr50_stabstabilize-14526.73.B-cr50_stabstabilize-14526.67.B-cr50_stabstabilize-14526.57.B-cr50_stabrelease-R100-14526.B-cr50_stabAndrey Pronin2022-02-161-4/+24
| | | | | | | | | | | | | | | | | | This CL in case of unorderly TPM reset that doesn't also reset GSC preserves RAM-backed values of orderly nv indices. BUG=b:201101365 TEST=1) create an orderly counter 2) increment it 3) trigger EC reset 4) verify that the counter value was preserved Cq-Depend: chromium:3417937 Change-Id: I799183ad06584055d025c2acf5f83ff2ded32d39 Signed-off-by: Andrey Pronin <apronin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3418122 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org>
* ccd_config: save the config after setting the passwordMary Ruthven2022-02-121-1/+1
| | | | | | | | | | | | | | | | | | Fix a logical error, so cr50 will save the ccd config after setting the password. BUG=b:219075883 TEST=see comment#4 from the bug Change-Id: I2e389c90c9ffe49dc340846258569835ca867ffb Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3457942 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org> Commit-Queue: Andrey Pronin <apronin@chromium.org>
* ccd_config: treat ALT_IF commands the same as USB commandsMary Ruthven2022-02-121-5/+10
| | | | | | | | | | | | | | | | | | Reject VENDOR_CMD_FROM_ALT_IF commands everywhere VENDOR_CMD_FROM_USB commands are rejected. ccd_config generates ALT_IF tpm commands from the 'ccd' console command. Treat these the same as VENDOR_CMD_FROM_USB commands. Reject setting the ccd password and ccd open from the console unless usb commands are allowed. BUG=b:219075883 TEST=run firmware_Cr50Open.ccd_open_restricted and firmware_Cr50Password grep for VENDOR_CMD_FROM_USB in platform/cr50 to make sure all flags checks have been updated. Change-Id: I69590a55d14745fd14d813b0adfa555ec40f0229 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3456708 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* add vendor command to disable deep sleepMary Ruthven2022-01-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a vendor command to disable deep sleep the next time TPM_RST_L is asserted. Normally cr50 enters deep sleep whenever TPM_RST_L is asserted. New boards want to disable deep sleep during certain power states. This vendor command allows the AP to disable deep sleep for the next suspend cycle. When deep sleep is disabled, cr50 modifies TPM_RST_L to be WAKE_HIGH and sets it back to WAKE_LOW after TPM_RST_L is deasserted, so TPM_RST_L doesn't constantly wake cr50 from regular sleep. This uses 248 bytes BUG=b:214479456 TEST=manual # Check G3 resume works ok. # Disable Deep Sleep from the AP. The vendor command is 59 # (0x3b) trunks_send --raw 80010000000c20000000003b ccdstate DS Dis: on AP > shutdown -P now ... [454.992733 Block DS] ccdstate DS Dis: on pinmux 40060018: DIOM3 0 IN WAKE_HIGH idle idle action: sleep # Verify cr50 starts cycling through sleep spinner at two ticks # a second. EC > powerbtn # check the cr50 console ... Aï¿œUART on] 10/ 1 [102.484012 Missed edge] [102.484352 deferred_tpm_rst_isr] [102.484580 AP on] [102.484779 set TPM wake] [102.484981 tpm_reset_request(0, 0)] [102.485279 tpm_reset_now(0)] [547.928375 AP on] [547.928615 set TPM wake] pinmux 40060018: DIOM3 0 IN WAKE_LOW # Disable Deep Sleep from the AP. The vendor command is 59 # (0x3b) trunks_send --raw 80010000000c20000000003b ccdstate DS Dis: on ecrst pulse ... [602.638427 AP on] [547.928615 set TPM wake] [602.638668 tpm_reset_request(0, 0)] ... ccdstate DS Dis: off # Check S3 resume works ok. # Use AP commands to enter S3 AP > trunks_send --raw 80010000000c20000000003b AP > echo deep > /sys/power/mem_sleep AP > echo mem > /sys/power/state 10\ 1 [243.409412 dis DS] 1|[249.536811 tpm_rst_asserted] [250.537197 AP off] [250.537631 Block DS] # Wake the AP with a power button press from the EC EC > powerbtn # verify cr50 prints "Missed edge", but the device resumes ok. 1/ 10- 1 [270.112655 Missed edge] [270.113037 deferred_tpm_rst_isr] [270.113315 AP on] [270.113529 set TPM wake] [270.113712 tpm_reset_request(0, 0)] [270.114013 tpm_reset_now(0)] [270.116996 tpm_init] tpm_manufactured: manufactured [270.118301 tpm_reset_now: done] [270.156967 PinWeaver: Loading Tree!] [270.189353 Skipping commit] Change-Id: I96049a9d38b5c66acad9c73628f588f4cf6b2b3f Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3406587 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* brdprop: log invalid and ambiguous eventsMary Ruthven2022-01-151-1/+1
| | | | | | | | | | | | | | | | Log brdprop errors in flog, so the team can track brdprop errors from the AP without grepping through cr50 logs. BUG=b:214550629 TEST=flash on red board. Verify invalid strap events are logged. enable closed-loop-reset on the red board. Verify "ambiguous" strap logs are ignored. Change-Id: Ibea73fb19119fa81ed3652c5d68e430cdbae9fa5 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3386405 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* extension: allow pop flog over usb on DBG imagesMary Ruthven2022-01-141-0/+1
| | | | | | | | | | | BUG=none TEST=none Change-Id: Icc4198dc7e87c74cbbc5466b4a04d716ebab22a2 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3386404 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* ap ro verification: add log entry for the 'unsupported' caseVadim Bendebury2021-12-291-1/+2
| | | | | | | | | | | | | | Let's have different log entries for the case when AP RO verification is provisioned but failed, and when it is supported. BUG=b:211762871 TEST=none Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: If99c89e6c6c0d10eec2d9e9c97d13e85bb3f1f23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3360091 Tested-by: Vadim Bendebury <vbendeb@gmail.com> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* ap_ro_verification: fix cached verification stateVadim Bendebury2021-12-291-9/+12
| | | | | | | | | | | | | | | | | | | | | The apro_result variable saves the state reported by an attempted AP RO verification, setting this variable to AP_RO_FAIL prevents releasing of the EC reset on the following reboots. In case verification could not be run because control structures have not been found, and there is no evidence of a previously succeeding verification, apro_result has to be set to AP_RO_UNSUPPORTED_TRIGGERED. BUG=b:211762871 TEST=verified various states of AP RO verification, in particular confirmed that running verification on a device where it is not supported does not prevent future reboots. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I74ad47a6fd92c6d906e723df6e7d37520ff92b27 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3360089 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* cr50: Revert U2F_Sign back to not checking authorizationHoward Yang2021-12-161-3/+4
| | | | | | | | | | | | | | | | | In crrev.com/c/3221264 we uncommented the code that starts checking auth_hmac for v1 key handles, but u2fd is not ready to provide the auth secret yet. Comment the code back and put NULL for authTimeSecret for v1 key handles before secret enforement is implemented in u2fd. BUG=b:210366574, b:172971998 TEST=make buildall -j Change-Id: I8cf008213c88b8c88ab91f0601c319aea7ebfde0 Signed-off-by: Howard Yang <hcyang@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3337970 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* ap_ro_integrity_check: call keep_ec_in_reset in do_ap_ro_checkstabilize-14385.B-cr50_stabfactory-kukui-14374.B-cr50_stabMary Ruthven2021-11-291-6/+41
| | | | | | | | | | | | | | | | | | Move the keep_ec_in_reset call into do_ap_ro_check, so AP RO verification will hold the EC in reset when it's triggered from the AP. This change removes the ap_ro_verification_failed_ variable, so all of the AP RO verification is included in ap_ro_info. ap_ro_ver_state isn't needed anymore, so this CL removes it. BUG=b:207545621 TEST=make clobber ; make buildall -j Change-Id: Id0b2e04b042d48f2b8a9dae021e762369ca5f3eb Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300174 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* ap_ro_check: fix error processing logicVadim Bendebury2021-11-291-15/+13
| | | | | | | | | | | | | | | | | | | In a situation where there is a failing V1 check and no V2 information in the AP flash, the results of V2 check were overriding the results of V2 check, replacing 'failed' with 'not found'. This patch prevents the override and simplifies the verification logic - always check for V2 if V1 check fails. BUG=b:207545621 TEST=the DUT properly stops booting when a corrupted V1 structure is detected and V2 structure is not present. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I0abe19780bf34ed4455f1a1a61b9cf23ff83173f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3299280 Reviewed-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* Revert "console_channel.inc: Add more ifdef to reduce number of channels"Mary Ruthven2021-11-221-2/+2
| | | | | | | | | | | | | This reverts commit b5cebbaadb4966e9d1820b0dcabd690d3e5d762e. BUG=b:207391162 TEST=The chan output is the same on ToT and mp images. Change-Id: Ief9bc6f6c9b027284b423e46681c313fd3fd73aa Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3296743 Reviewed-by: Andrey Pronin <apronin@chromium.org> Commit-Queue: Andrey Pronin <apronin@chromium.org>
* coil: replace non-inclusive pronounsMary Ruthven2021-11-191-1/+1
| | | | | | | | | | BUG=b:173227629 TEST=make buildall -j Change-Id: Ic1d704233bca5438a0832f5f3533d640464ce1a5 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3293253 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* coil: replace non-inclusive terms with "placeholder"Mary Ruthven2021-11-193-9/+9
| | | | | | | | | | BUG=b:173227629 TEST=make buildall -j Change-Id: I2b203dfe45416aa3b632f6f788d14264b08f44e0 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3293252 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* remove spi_norMary Ruthven2021-11-192-1092/+0
| | | | | | | | | | | | | Nothing uses spi_nor and sfdp.h has non-inclusive terms in it. Remove both to make the codebase more inclusive. BUG=b:173227629 TEST=make buildall -j Change-Id: I2b880fcae3ab9619ff9703ba49be2936a5a9bd73 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3293251 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* coil: replace non-inclusive terms with "validity"Mary Ruthven2021-11-1910-13/+13
| | | | | | | | | | BUG=b:173227629 TEST=make buildall -j Change-Id: Iaf8028984cc58cc4108907fdba4ea4b38c43cf70 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3293250 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "KBL/SKL: Add wait between DSW_PWROK and PWRBTN"Mary Ruthven2021-11-181-10/+0
| | | | | | | | | | | | This reverts commit 627f3a8ac28751f549fbdb5266f8ccee417d339d. BUG=b:200823466 TEST=make buildall -j Change-Id: Id942eb041f8f28cc4fcf533d720a1c9ee79e92f4 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3285828 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "common/led_common: Add API for controlling LED state"Mary Ruthven2021-11-181-9/+0
| | | | | | | | | | | | This reverts commit 2bb9aec01aded925b726f7b18a66cdad181ac8db. BUG=b:200823466 TEST=make buildall -j Change-Id: Ia3a6d52c21dd864898cf91a31e6e742cb6b915f1 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3285827 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "ec_features / coral: Allow disabling keyboard backlight feature"Mary Ruthven2021-11-181-10/+1
| | | | | | | | | | | | This reverts commit 09136dea764dbe482392c29b3c8d1763149df3e6. BUG=b:200823466 TEST=make buildall -j Change-Id: Ibd86be5017c3c984ba10c59a8c0cca6e5c392af5 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3285823 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "chip/mt_scp: support software gain"Mary Ruthven2021-11-181-11/+0
| | | | | | | | | | | | This reverts commit 8fe3e6a850f06b499cc60834a925736ce95171d9. BUG=b:200823466 TEST=make buildall -j Change-Id: I02223d61ec727c8b5891fa23868930ed20d7b394 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3285760 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "common: add i2c tracing functionality"Mary Ruthven2021-11-183-211/+6
| | | | | | | | | | | | This reverts commit f8d6179a26bf512c43638d0916fde0fc966cc3fb. BUG=b:200823466 TEST=make buildall -j Change-Id: I8e7a4bbd01bc99bedd2abf77b0d482ed679de865 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3285753 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "i2c: add i2clookup host command"Mary Ruthven2021-11-181-28/+0
| | | | | | | | | | | | This reverts commit 45434aed20e695e08fcbb3f74c43e03f6fa19bf2. BUG=b:200823466 TEST=make buildall -j Change-Id: I353994692fd6b02ff1460234f448ac813cad04cb Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3285752 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "rsa: Optimization of multiplications for Cortex-M0"Mary Ruthven2021-11-181-6/+6
| | | | | | | | | | | | This reverts commit 49ff62bf0be5cfc88e092f987d77c18a0b21390a. BUG=b:200823466 TEST=make buildall -j Change-Id: I144e310c00d6490d278ca6215bf0a37d3cfc7d4f Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3285751 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "gpio: extend flags size to accommodate GPIO_ flags"Mary Ruthven2021-11-181-20/+26
| | | | | | | | | | | | This reverts commit 7d36fb8991e7a249ae56db508078480c27914f2e. BUG=b:200823466 TEST=make buildall -j Change-Id: Ifbef35feaf42fca1faa3fc78ceff5cb9bced19f8 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3285750 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "common: Add uptime host command"Mary Ruthven2021-11-183-54/+27
| | | | | | | | | | | | This reverts commit af51b9ea19c0ba4c6d57cdc4c5f3380647be3034. BUG=b:200823466 TEST=make buildall -j Change-Id: Ib620967f239dd2ee3fdd0f4749d08bd544509fcb Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3285747 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* ccd_config: add flag restricting ccd openMary Ruthven2021-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | On prePVT images we want to allow ccd open from the console without dev mode enabled. This change adds a config option limiting ccd open. BUG=b:112861587 TEST=ccd open is still disabled from the console unless the password is set. Change-Id: I2adbf9b0e900a693ab513a6bf6650b320b7320d4 Signed-off-by: Mary Ruthven <mruthven@google.com> Reviewed-on: https://chromium-review.googlesource.com/1188927 Commit-Ready: Mary Ruthven <mruthven@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 2a4bd4a152d81f5e24cea00b177c0be6d6246d15) Reviewed-on: https://chromium-review.googlesource.com/c/1403842 Tested-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> (cherry picked from commit d11aa8c6a6e74e6bc579f026ab321d458f88eabe) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273471 Commit-Queue: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "hostcmd: Remove EC_CMD_VBNV_CONTEXT handler for most boards"Mary Ruthven2021-11-181-3/+7
| | | | | | | | | | | | This reverts commit 6ba124a81bd6d5af1edae5f30add22e81b8b7de7. BUG=b:200823466 TEST=make buildall -j Change-Id: I4038924250569e3bb8b491ded4eef1a61f98a4bb Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273470 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "system: Add support for emulated sysrq"Mary Ruthven2021-11-182-35/+0
| | | | | | | | | | | | This reverts commit 871bf8da2cf5fa9bcfe8771b96af4b55c2503616. BUG=b:200823466 TEST=make buildall -j Change-Id: I126176dcf85d4850213308f77eefb554454f50d0 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273469 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "system: Fixups in emulated sysrq code"Mary Ruthven2021-11-182-2/+2
| | | | | | | | | | | | This reverts commit e3f5e6bf6ad2d1e2c283a75cf08e17155633e0a5. BUG=b:200823466 TEST=make buildall -j Change-Id: I60dbc01a5345a28fe759975f62a8d9216dcef7fe Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273468 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "rwsig: do not jump if reset source is hard pin reset"Mary Ruthven2021-11-181-15/+3
| | | | | | | | | | | | This reverts commit ba105838f582793716d02eebee09a6f283ef73b3. BUG=b:200823466 TEST=make buildall -j Change-Id: Idc4a2eb4f9fc778ddb76504cd4e0fab296df41a8 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273465 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "Add system_can_boot_ap API"Mary Ruthven2021-11-181-6/+0
| | | | | | | | | | | | This reverts commit cdaca7c97eaefe93ab3a0148a954b2f139f5caad. BUG=b:200823466 TEST=make buildall -j Change-Id: I860b04167c3ab7335de63f561d31cf073cb5e897 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273461 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "system: Allow sysjump command to jump to RW_B"Mary Ruthven2021-11-181-7/+1
| | | | | | | | | | | | This reverts commit d33618ce9f9a6b95632d0de3ebed1eca196cd982. BUG=b:200823466 TEST=make buildall -j Change-Id: Ib0424b6f13086771f4cddfc293dd7163bafbff71 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273458 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "vboot: Jump to RW early"Mary Ruthven2021-11-181-2/+6
| | | | | | | | | | | | This reverts commit 921e9b71258c318f364457d97a94d3fb9e1bbbfc. BUG=b:200823466 TEST=make buildall -j Change-Id: Ic168ce083509437ff729f41dc43784bd15913c55 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273457 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "Add OTP support"Mary Ruthven2021-11-182-47/+25
| | | | | | | | | | | | This reverts commit 1b25735b732e7766aceb3f060e4ca205aba6d358. BUG=b:200823466 TEST=make buildall -j Change-Id: I2e29902d7026c63f23871af0141a3ee7d319852d Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273456 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "coral: Add host command to fetch SKU ID"Mary Ruthven2021-11-181-16/+0
| | | | | | | | | | | | | | This reverts commit f747f70816ca825a4ff4f9c6234f97e93611dbaa. Nothing uses CONFIG_HOSTCMD_SKUID. Remove support. BUG=b:200823466 TEST=make buildall -j Change-Id: Iea545047659ab265025878c50986b74d1b3654b1 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273455 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "EFS: Rename CONFIG_VBOOT_EC to _EFS"Mary Ruthven2021-11-181-3/+4
| | | | | | | | | | | | This reverts commit 3dc0eae365305c84947fff5d1976e74d950b04e3. BUG=b:200823466 TEST=make buildall -j Change-Id: Icf59ad506c2392d3fc743321f696506c19243f2c Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273454 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>