drivers/tpm/cr50: Add TPM IRQ timeout Kconfig option
commitae1e702e7b10ea2695be706ae53013b5b0817cb3
authorYu-Ping Wu <yupingso@chromium.org>
Tue, 17 May 2022 01:33:18 +0000 (17 09:33 +0800)
committerJulius Werner <jwerner@chromium.org>
Wed, 8 Jun 2022 00:28:27 +0000 (8 00:28 +0000)
treec7b408f7ae21d0ab048c4a272c390263f1849109
parent20b58bc882c40b80584cb0d035acbda8daf95ed0
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>
src/drivers/i2c/tpm/cr50.c
src/drivers/spi/tpm/tpm.c
src/drivers/tpm/cr50.c
src/drivers/tpm/cr50.h
src/security/tpm/tis.h
src/security/tpm/tss/vendor/cr50/Kconfig