Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/80455?usp=email )
Change subject: drivers/pc80/tpm: Disable device if TPM not present ......................................................................
drivers/pc80/tpm: Disable device if TPM not present
If the TPM is not detected in the system it may mean it is inactive due to enabled ME with active PTT. In such case, the chipset will route the TPM traffic to PTT CRB TPM on Intel systems.
If TPM is not probed, disable the PC80 TPM device driver, so that coreboot will not generate improper SSDT ACPI table.
Change-Id: I05972ad74a36abaafa2f17a16f09710550a3a3f3 Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/80455 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Sergii Dmytruk sergii.dmytruk@3mdeb.com --- M src/drivers/pc80/tpm/tis.c 1 file changed, 9 insertions(+), 4 deletions(-)
Approvals: Sergii Dmytruk: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/drivers/pc80/tpm/tis.c b/src/drivers/pc80/tpm/tis.c index f922714..d811c52 100644 --- a/src/drivers/pc80/tpm/tis.c +++ b/src/drivers/pc80/tpm/tis.c @@ -905,11 +905,16 @@
static void enable_dev(struct device *dev) { - if (CONFIG(TPM)) - pnp_enable_devices(dev, &lpc_tpm_ops, - ARRAY_SIZE(pnp_dev_info), pnp_dev_info); - else + if (CONFIG(TPM)) { + if (pc80_tis_probe(NULL) == NULL) { + dev->enabled = 0; + return; + } + + pnp_enable_devices(dev, &lpc_tpm_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); + } else { pnp_enable_devices(dev, &noop_tpm_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); + } }
struct chip_operations drivers_pc80_tpm_ops = {