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.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/common/tpm_registers.c b/common/tpm_registers.c
index c4353dd566..7d4ecccfbf 100644
--- a/common/tpm_registers.c
+++ b/common/tpm_registers.c
@@ -850,10 +850,24 @@ void tpm_task(void)
} else
#endif
{
- ExecuteCommand(tpm_.fifo_write_index,
- tpm_.regs.data_fifo,
- &response_size,
- &response);
+ if (board_id_is_mismatched()) {
+ static const char tpm_broken_response[] = {
+ 0x80, 0x01, /* TPM_ST_NO_SESSIONS */
+ 0, 0, 0, 10, /* Response size. */
+ 0, 0, 9, 0x21 /* TPM_RC_LOCKOUT */
+ };
+ CPRINTF("%s: Ignoring TPM commands\n",
+ __func__);
+ response = tpm_.regs.data_fifo;
+ response_size = sizeof(tpm_broken_response);
+ memcpy(response, tpm_broken_response,
+ response_size);
+ } else {
+ ExecuteCommand(tpm_.fifo_write_index,
+ tpm_.regs.data_fifo,
+ &response_size,
+ &response);
+ }
}
CPRINTF("got %d bytes in response\n", response_size);
if (response_size &&