diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2016-09-22 18:52:47 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-09-26 22:16:45 -0700 |
commit | 5a6bb19a889f5b7fa5f4b590aba5893bee9d5452 (patch) | |
tree | adac78be67c57bcde092587fc2ade2d57ca6f5fc /include/tpm_registers.h | |
parent | 75aaabcd9ade5d2a2ad068d2543e8e82011b979f (diff) | |
download | chrome-ec-5a6bb19a889f5b7fa5f4b590aba5893bee9d5452.tar.gz |
tpm: reset communications channels when resetting TPM
TPM resets happen asynchronously, conceivably there is some interface
(i2cs or sps) activity under way when TPM is reset.
Sps driver provides a means of disconnecting the client of the driver,
while the i2cs driver does not. Come to think of it, there is no real
need to provide a special function to disconnect a client, this makes
API simpler and allows to add driver initialization to the client
registration function.
To make tpm_registers.c more flexible - allow to register a callback
for interface initialization, this way when TPM is reset, the
interface can be also re-initialized and is guaranteed to start from
scratch after reset.
BRANCH=none
BUG=chrome-os-partner:52366
TEST=both firmware_TPMExtend and firmware_TPMKernelVersion autotests
pass
Change-Id: I212166a23f9cd512d8f75315377d1f5620aea070
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/388886
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/tpm_registers.h')
-rw-r--r-- | include/tpm_registers.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/tpm_registers.h b/include/tpm_registers.h index 037fc73441..9c9390ffb7 100644 --- a/include/tpm_registers.h +++ b/include/tpm_registers.h @@ -23,14 +23,13 @@ void tpm_register_put(uint32_t regaddr, /* The SPI master is reading data from a TPM register. */ void tpm_register_get(uint32_t regaddr, uint8_t *dest, uint32_t data_size); -/* Enable SPS TPM driver. */ -void sps_tpm_enable(void); -/* Disable SPS TPM driver. */ -void sps_tpm_disable(void); - /* 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); + /* * Reset the TPM. This sends a request to the TPM task, so that the reset can * happen when the TPM task finishes whatever it's doing at the moment. |