aboutsummaryrefslogtreecommitdiff
path: root/src/security/tpm
diff options
context:
space:
mode:
authorYu-Ping Wu <yupingso@chromium.org>2022-05-17 09:33:18 +0800
committerJulius Werner <jwerner@chromium.org>2022-06-08 00:28:27 +0000
commitae1e702e7b10ea2695be706ae53013b5b0817cb3 (patch)
treec7b408f7ae21d0ab048c4a272c390263f1849109 /src/security/tpm
parent20b58bc882c40b80584cb0d035acbda8daf95ed0 (diff)
drivers/tpm/cr50: Add TPM IRQ timeout Kconfig option
The current 10ms timeout for SPI TPM IRQ is not enough for platforms using ti50 (such as corsola). Therefore, introduce a new Kconfig option 'GOOGLE_TPM_IRQ_TIMEOUT_MS'. For platforms using cr50, we need to support legacy pre-ready-IRQ cr50 factory images during the initial boot, so the timeout remains 100ms for I2C TPM and 10ms for SPI TPM. For all the other platforms using ti50, the default timeout is increased to 750ms, as suggested by the ti50 team (apronin@google.com). BUG=b:232327704 TEST=emerge-corsola coreboot BRANCH=none Change-Id: I8dbb919e4a421a99a994913613a33738a49f5956 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64412 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/security/tpm')
-rw-r--r--src/security/tpm/tis.h2
-rw-r--r--src/security/tpm/tss/vendor/cr50/Kconfig10
2 files changed, 12 insertions, 0 deletions
diff --git a/src/security/tpm/tis.h b/src/security/tpm/tis.h
index 660ec81231..8868e1a0fe 100644
--- a/src/security/tpm/tis.h
+++ b/src/security/tpm/tis.h
@@ -76,6 +76,8 @@ int tis_close(void);
int tis_sendrecv(const u8 *sendbuf, size_t send_size, u8 *recvbuf,
size_t *recv_len);
+/* TODO: This is supposed to be used only for Google TPM.
+ Consider moving this to drivers/tpm/cr50.h. */
/*
* tis_plat_irq_status()
*
diff --git a/src/security/tpm/tss/vendor/cr50/Kconfig b/src/security/tpm/tss/vendor/cr50/Kconfig
index 1fad3c0686..547f0fde3e 100644
--- a/src/security/tpm/tss/vendor/cr50/Kconfig
+++ b/src/security/tpm/tss/vendor/cr50/Kconfig
@@ -40,4 +40,14 @@ config TI50_FIRMWARE_VERSION_NOT_SUPPORTED
FW < 0.0.15. The config will be removed once all Ti50 stocks are updated to
0.0.15 or higher.
+config GOOGLE_TPM_IRQ_TIMEOUT_MS
+ int
+ default 100 if TPM_GOOGLE_CR50 && I2C_TPM
+ default 10 if TPM_GOOGLE_CR50
+ default 750
+ help
+ Timeout in milliseconds for waiting for TPM IRQ. Default to 100ms/10ms on platforms
+ using Cr50 in order to support legacy pre-ready-IRQ cr50 factory images. Default to
+ 750ms otherwise.
+
endif