summaryrefslogtreecommitdiff
path: root/common/tpm_registers.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/tpm_registers.c')
-rw-r--r--common/tpm_registers.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/common/tpm_registers.c b/common/tpm_registers.c
index fdbe771dec..db974f05b9 100644
--- a/common/tpm_registers.c
+++ b/common/tpm_registers.c
@@ -436,9 +436,6 @@ void tpm_register_put(uint32_t regaddr, const uint8_t *data, uint32_t data_size)
{
uint32_t i;
- if (reset_in_progress)
- return;
-
CPRINTF("%s(0x%03x, %d,", __func__, regaddr, data_size);
for (i = 0; i < data_size && i < 4; i++)
CPRINTF(" %02x", data[i]);
@@ -515,6 +512,8 @@ void tpm_register_get(uint32_t regaddr, uint8_t *dest, uint32_t data_size)
static uint32_t last_sts;
static uint32_t checked_sts;
+ reset_in_progress = 0;
+
if (regaddr != TPM_STS) {
CPRINTF("%s(0x%06x, %d)\n", __func__, regaddr, data_size);
checked_sts = 0;
@@ -899,8 +898,6 @@ static void tpm_reset_now(int wipe_first)
*/
hook_call_deferred(&reinstate_nvmem_commits_data, 3 * SECOND);
- reset_in_progress = 0;
-
if_start();
}
@@ -916,6 +913,14 @@ void tpm_stop(void)
/* Stop the TPM interface if it has been initialized. */
if (if_stop)
if_stop();
+ /*
+ * tpm_stop stops tpm communication until the tpm is reset.
+ * reset_in_progress blocks tpm resets until there's tpm communication.
+ * If reset_in_progress is 1 when the tpm is stopped, the system will
+ * not be able to clear either.
+ * Clear reset in progress to ensure that doesn't happen.
+ */
+ reset_in_progress = 0;
}
void tpm_task(void *u)