From fb2c09d5162719a72f0fbc533bec0aa3e8458b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Tue, 13 Feb 2024 15:36:25 +0100 Subject: [PATCH] drivers/crb: Disable device if CRB TPM not present MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If CRB TPM is not detected in the system it may mean it is inactive due to disabled or neutered ME. In such case, the chipset will route the TPM traffic to LPC/SPI on Intel systems. If CRB TPM is not probed, disable the CRB TPM device driver, so that coreboot will not generate improper SMBIOS/SSDT ACPI tables. Change-Id: Ie0928536d9042b1f680d585e1ca9ad2cadf0c8ef Signed-off-by: Michał Żygowski Reviewed-on: https://review.coreboot.org/c/coreboot/+/80454 Tested-by: build bot (Jenkins) Reviewed-by: Lean Sheng Tan Reviewed-by: Sergii Dmytruk --- src/drivers/crb/tis.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drivers/crb/tis.c b/src/drivers/crb/tis.c index 5e81935d49..df45125f01 100644 --- a/src/drivers/crb/tis.c +++ b/src/drivers/crb/tis.c @@ -207,6 +207,11 @@ static struct device_operations __maybe_unused crb_ops = { static void enable_dev(struct device *dev) { + if (crb_tis_probe(NULL) == NULL) { + dev->enabled = 0; + return; + } + #if !DEVTREE_EARLY dev->ops = &crb_ops; #endif