diff options
author | Michał Żygowski <michal.zygowski@3mdeb.com> | 2024-02-13 15:32:26 +0100 |
---|---|---|
committer | Lean Sheng Tan <sheng.tan@9elements.com> | 2024-04-25 10:12:39 +0000 |
commit | 3979dd6df00e6534ba29f036a2774b08e31be5be (patch) | |
tree | b1b5689aa696d259118096c475a160353f40237c /src/drivers/crb | |
parent | 11afdb3afc697d3b5f5e8227d324f4dc126f14f1 (diff) |
drivers/crb: Check for PTT before attempting to initialize CRB TPM
We can assume that platforms, which select HAVE_INTEL_PTT, will not
have any other CRB TPM than PTT. Check whether PTT is available before
forcefully initializing the TPM and selecting the CRB interface in the
TPM configuration registers.
Change-Id: If0ec6217b0e321b7d7a9410b70defde3c3195fc3
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80453
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michał Kopeć <michal.kopec@3mdeb.com>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Diffstat (limited to 'src/drivers/crb')
-rw-r--r-- | src/drivers/crb/tis.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/drivers/crb/tis.c b/src/drivers/crb/tis.c index 3893917118..5e81935d49 100644 --- a/src/drivers/crb/tis.c +++ b/src/drivers/crb/tis.c @@ -50,6 +50,14 @@ tis_sendrecv_fn crb_tis_probe(enum tpm_family *family) { struct crb_tpm_info info; + if (CONFIG(HAVE_INTEL_PTT)) { + if (!ptt_active()) { + printk(BIOS_ERR, "%s: Intel PTT is not active.\n", __func__); + return NULL; + } + printk(BIOS_DEBUG, "%s: Intel PTT is active.\n", __func__); + } + /* Wake TPM up (if necessary) */ if (crb_tpm_init()) return NULL; @@ -63,14 +71,6 @@ tis_sendrecv_fn crb_tis_probe(enum tpm_family *family) printk(BIOS_INFO, "Initialized TPM device %s revision %d\n", tis_get_dev_name(&info), info.revision); - if (CONFIG(HAVE_INTEL_PTT)) { - if (!ptt_active()) { - printk(BIOS_ERR, "%s: Intel PTT is not active.\n", __func__); - return NULL; - } - printk(BIOS_DEBUG, "%s: Intel PTT is active.\n", __func__); - } - return &crb_tpm_sendrecv; } |