diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2017-10-23 10:41:47 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-24 12:57:45 -0700 |
commit | e3d15afa68d9e4c8866a0301b33ff6e6d78b1750 (patch) | |
tree | b8589583f7211d8e919bb120c9be5baf0258bdf5 /common/tpm_registers.c | |
parent | 9eac4de2efaf253ba9e89b822f430c060e59bf6b (diff) | |
download | chrome-ec-e3d15afa68d9e4c8866a0301b33ff6e6d78b1750.tar.gz |
tpm: let the caller of TPM reset decide if the EC needs to be reset too
TPM reset sequence when TPM wipeout is requested has a side effect of
rebooting the entire device. This is not always desirable, in some
cases other actions need to happen before the device is rebooted.
This patch makes resetting the EC the TPM reset caller's responsibility,
BRANCH=cr50
BUG=none
TEST=verified that RMA reset and WP disable properly wipe out the TPM
and reboot the device.
Change-Id: I6e827ce923a2454ae5b2e2597d1a4c9390bbb8b6
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/733813
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'common/tpm_registers.c')
-rw-r--r-- | common/tpm_registers.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/common/tpm_registers.c b/common/tpm_registers.c index d97e5bc4f1..46d2b7fdf1 100644 --- a/common/tpm_registers.c +++ b/common/tpm_registers.c @@ -815,20 +815,11 @@ static void tpm_reset_now(int wipe_first) /* This is more related to TPM task activity than TPM transactions */ cprints(CC_TASK, "%s(%d)", __func__, wipe_first); - if (wipe_first) { - /* - * Blindly zapping the TPM space while the AP is awake and - * poking at it will bork the TPM task and the AP itself, so - * force the whole system off by holding the EC in reset. - */ - cprints(CC_TASK, "%s: force EC off", __func__); - assert_ec_rst(); - + if (wipe_first) /* Now wipe the TPM's nvmem */ wipe_result = nvmem_erase_user_data(NVMEM_TPM); - } else { + else wipe_result = EC_SUCCESS; - } /* * Clear the TPM library's zero-init data. Note that the linker script @@ -866,12 +857,6 @@ static void tpm_reset_now(int wipe_first) waiting_for_reset = TASK_ID_INVALID; } - if (wipe_first) { - /* Allow AP & EC to boot again */ - cprints(CC_TASK, "%s: allow EC to boot", __func__); - deassert_ec_rst(); - } - cprints(CC_TASK, "%s: done", __func__); /* |