Sean Rhodes has submitted this change. ( https://review.coreboot.org/c/coreboot/+/86513?usp=email )
Change subject: acpi: Fix incorrect TPM2 table generation for CRB_TPM ......................................................................
acpi: Fix incorrect TPM2 table generation for CRB_TPM
If CONFIG(CRB_TPM) is enabled but the TPM is inactive, and no other TPM interface (SPI, I2C, Memory-Mapped) is configured, the function would incorrectly fallback to generate a TPM2 table for FIFO mode.
This commit adds a check to ensure crb_tpm_is_active() is only called if CONFIG(CRB_TPM) is enabled and no other TPM interface is present. If the CRB TPM is inactive and no other TPMs are available, the function now exits early to prevent generating an invalid TPM2 table.
Test=boot `starlabs/starlite_adl` and check Linux doesn't probe for a TPM when PTT is not active.
Change-Id: I153779aa1f3d84ffeb694543f9da1d09b120f98f Signed-off-by: Sean Rhodes sean@starlabs.systems Reviewed-on: https://review.coreboot.org/c/coreboot/+/86513 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Matt DeVillier matt.devillier@gmail.com --- M src/acpi/acpi.c 1 file changed, 5 insertions(+), 1 deletion(-)
Approvals: Matt DeVillier: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 8f5c09f..0687954 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -258,6 +258,10 @@ if (tlcl_get_family() != TPM_2) return;
+ if (CONFIG(CRB_TPM) && !(CONFIG(SPI_TPM) || CONFIG(I2C_TPM) || CONFIG(MEMORY_MAPPED_TPM))) + if (!crb_tpm_is_active()) + return; + acpi_tpm2_t *tpm2 = (acpi_tpm2_t *)header; u32 tpm2_log_len; void *lasa; @@ -275,7 +279,7 @@
/* Hard to detect for coreboot. Just set it to 0 */ tpm2->platform_class = 0; - if (CONFIG(CRB_TPM) && crb_tpm_is_active()) { + if (CONFIG(CRB_TPM)) { /* Must be set to 7 for CRB Support */ tpm2->control_area = CONFIG_CRB_TPM_BASE_ADDRESS + 0x40; tpm2->start_method = 7;