Michał Żygowski has uploaded this change for review.

View Change

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>
---
M src/drivers/crb/tis.c
1 file changed, 8 insertions(+), 8 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/80453/1
diff --git a/src/drivers/crb/tis.c b/src/drivers/crb/tis.c
index 32216b4..2176cc6 100644
--- a/src/drivers/crb/tis.c
+++ b/src/drivers/crb/tis.c
@@ -50,6 +50,14 @@
{
struct tpm2_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 (tpm2_init())
return NULL;
@@ -62,14 +70,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;
}


To view, visit change 80453. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: If0ec6217b0e321b7d7a9410b70defde3c3195fc3
Gerrit-Change-Number: 80453
Gerrit-PatchSet: 1
Gerrit-Owner: Michał Żygowski <michal.zygowski@3mdeb.com>
Gerrit-MessageType: newchange