Lean Sheng Tan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/80453?usp=email )
Change subject: drivers/crb: Check for PTT before attempting to initialize CRB TPM ......................................................................
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 --- M src/drivers/crb/tis.c 1 file changed, 8 insertions(+), 8 deletions(-)
Approvals: Sean Rhodes: Looks good to me, but someone else must approve Lean Sheng Tan: Looks good to me, but someone else must approve build bot (Jenkins): Verified Michał Kopeć: Looks good to me, approved
diff --git a/src/drivers/crb/tis.c b/src/drivers/crb/tis.c index 3893917..5e81935 100644 --- a/src/drivers/crb/tis.c +++ b/src/drivers/crb/tis.c @@ -50,6 +50,14 @@ { 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 @@ 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; }