summaryrefslogtreecommitdiff
path: root/chip/g/sps_tpm.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2016-08-05 10:25:42 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-24 13:53:26 -0700
commitb94747d501ad7e4347b50c3ea55e615422d96212 (patch)
treeb2c078ca5b87a8af29827474789475903f5b316f /chip/g/sps_tpm.c
parent5fa727805ca3222e9268755c54c15bbf87c5b2bd (diff)
downloadchrome-ec-b94747d501ad7e4347b50c3ea55e615422d96212.tar.gz
cr50: reset only the TPM state on SYS_RST_L
Rather than doing a full cr50 reset when the system reset SYS_RST_L is asserted, just reset the state of the TPM task and library. Re-clear .bss for those modules, then re-initialize. BRANCH=none BUG=chrome-os-partner:52366 CQ-DEPEND=CL:366792 TEST=make buildall; test on Gru Trigger a SYS_RST_L by using the AP's reboot command, power off/on, log in/out/in. See that the Cr50 does not reboot and the firmware and userspace are still happy about the TPM. Change-Id: I32cd2bb72316f68c74db77a20a8d09112b402d4b Signed-off-by: Randall Spangler <rspangler@chromium.org> Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/361680
Diffstat (limited to 'chip/g/sps_tpm.c')
-rw-r--r--chip/g/sps_tpm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/chip/g/sps_tpm.c b/chip/g/sps_tpm.c
index 2c3f6876e7..3ef12994e6 100644
--- a/chip/g/sps_tpm.c
+++ b/chip/g/sps_tpm.c
@@ -271,3 +271,12 @@ void sps_tpm_enable(void)
sps_register_rx_handler(SPS_GENERIC_MODE, tpm_rx_handler, 3);
init_new_cycle();
}
+
+void sps_tpm_disable(void)
+{
+ sps_tpm_state = SPS_TPM_STATE_PONDERING;
+ sps_unregister_rx_handler();
+ /* We don't care anymore, so we can sleep whenever */
+ delay_sleep_by(0);
+ enable_sleep(SLEEP_MASK_SPI);
+}