diff options
author | Michał Żygowski <michal.zygowski@3mdeb.com> | 2024-02-13 15:43:26 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-04-26 11:55:38 +0000 |
commit | 3742308875a3e303b3f28f77016055c9f7d7d9a3 (patch) | |
tree | 4ed03ef3c8b37ebb8ce69f4b456fef4f6e03693f /src/drivers/pc80/tpm/tis.c | |
parent | fb2c09d5162719a72f0fbc533bec0aa3e8458b93 (diff) |
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>
Diffstat (limited to 'src/drivers/pc80/tpm/tis.c')
-rw-r--r-- | src/drivers/pc80/tpm/tis.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/drivers/pc80/tpm/tis.c b/src/drivers/pc80/tpm/tis.c index f922714381..d811c52e90 100644 --- a/src/drivers/pc80/tpm/tis.c +++ b/src/drivers/pc80/tpm/tis.c @@ -905,11 +905,16 @@ static struct pnp_info pnp_dev_info[] = { 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 = { |