diff options
author | Mary Ruthven <mruthven@chromium.org> | 2022-04-20 11:33:59 -0500 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-04-25 19:20:28 +0000 |
commit | 44744edfcac4125900903f719b1096baf3d73ece (patch) | |
tree | 3b4c8644fdebabce93a70b0fb7260fe721ed1486 | |
parent | 8181f5e938ab5e5b2dea0da6f5d1cc155f5d08cf (diff) | |
download | chrome-ec-44744edfcac4125900903f719b1096baf3d73ece.tar.gz |
factory_mode: don't reset the AP after enabling factory mode
Resetting the AP interferes with factory processes. Wipe the tpm,
disable AP communications, and then enable factory mode without
resetting the AP, so factory scripts can continue running and don't need
to handle a device reset.
BUG=b:229355653
TEST=manual
# "Disconnect" the battery, so cr50 can enable factory mode.
bp disconnect atboot
# Enable factory mode
gsctool -aF enable
# Verify cr50 wipes the TPM
[52.115535 tpm_reset_request(1, 1)]
[52.116683 tpm_reset_now(1)]
[52.494602 Compaction done, went from 12304 to 60 bytes]
...
[52.587989 tpm_reset_now: done]
[52.588844 TPM is erased]
# Verify the AP stayed up and the TPM is disabled
gsctool -af
Problems reading from TPM, got 10 bytes
Failed to start transfer
Change-Id: If64df4e834c8ae65de36c0ebb7ea868d558089bd
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3597032
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r-- | board/cr50/factory_mode.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/board/cr50/factory_mode.c b/board/cr50/factory_mode.c index a68a253da2..298d6cf010 100644 --- a/board/cr50/factory_mode.c +++ b/board/cr50/factory_mode.c @@ -93,7 +93,11 @@ static enum vendor_cmd_rc vc_factory_reset(enum vendor_cmd_cc code, return VENDOR_RC_NOT_ALLOWED; CPRINTF("factory reset\n"); - enable_ccd_factory_mode(1); + /* + * Don't reset the AP after enabling factory mode. Just wipe the TPM + * and disable AP communications until the device resets on its own. + */ + enable_ccd_factory_mode(0); return VENDOR_RC_SUCCESS; } |