summaryrefslogtreecommitdiff
path: root/include/tpm_registers.h
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-10-31 18:51:51 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-11-07 17:52:15 -0800
commit3919001a390f593ba8e022f223bf1e43b7dbc0a2 (patch)
tree5a5534aca31394c15d4cc6f09197348b66f786ef /include/tpm_registers.h
parent0354ad02cba910c90fd0c0e622c3b0b698802a1c (diff)
downloadchrome-ec-3919001a390f593ba8e022f223bf1e43b7dbc0a2.tar.gz
tpm: provide means of shutting down comms layer while in reset
Currently the Cr50 code resets TPM communications layer at a certain point during TPM reset process. It turns out that this is not sufficient - the comms layer keeps receiving and trying to invoke TPM layer, which does not mesh well with TPM reset. Let's provide two callbacks for each comms layer - to shut it down and to bring it back up. We shut down the comms when starting TPM reset and bring them back up when reset is completed. BRANCH=cr50 BUG=b:68012381 TEST=ran AP firmware test suite on both SPI and I2C based devices. Change-Id: I7caf4a09b9a5c6e5fc6bfe60eae1c0d64ab24904 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/754502 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'include/tpm_registers.h')
-rw-r--r--include/tpm_registers.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/tpm_registers.h b/include/tpm_registers.h
index cf7fbe5758..5da9ab6c2f 100644
--- a/include/tpm_registers.h
+++ b/include/tpm_registers.h
@@ -26,9 +26,13 @@ void tpm_register_get(uint32_t regaddr, uint8_t *dest, uint32_t data_size);
/* Get the current value of the burst size field of the status register. */
size_t tpm_get_burst_size(void);
-/* Register a function to restart TPM communications layer. */
-typedef void (*interface_restart_func)(void);
-void tpm_register_interface(interface_restart_func interface_restart);
+/*
+ * Register functions to start and stop TPM communications layer. The
+ * communications layer should be kept down while TPM is being reset.
+ */
+typedef void (*interface_control_func)(void);
+void tpm_register_interface(interface_control_func interface_start,
+ interface_control_func interface_stop);
/*
* This requests the TPM task to reset itself.