[coreboot-gerrit] Change in coreboot[master]: drivers/pc80/tpm: add support for SLB9665 TPM2.0 module

Kamil Wcisło (Code Review) gerrit at coreboot.org
Thu Oct 12 13:13:44 CEST 2017


Kamil Wcisło has uploaded this change for review. ( https://review.coreboot.org/21983


Change subject: drivers/pc80/tpm: add support for SLB9665 TPM2.0 module
......................................................................

drivers/pc80/tpm: add support for SLB9665 TPM2.0 module

SLB9665 are not initialized correctly. Add support for the TPM2.0
startup sequence and correctly identify the chip.

Change-Id: Ic20b9a65ef6a4ee392a9352f7c9bf01b2496f482
Signed-off-by: Kamil Wcislo <kamil.wcislo at 3mdeb.com>
---
M src/drivers/pc80/tpm/romstage.c
M src/drivers/pc80/tpm/tpm.c
2 files changed, 17 insertions(+), 4 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/21983/1

diff --git a/src/drivers/pc80/tpm/romstage.c b/src/drivers/pc80/tpm/romstage.c
index 5531458..95e65f2 100644
--- a/src/drivers/pc80/tpm/romstage.c
+++ b/src/drivers/pc80/tpm/romstage.c
@@ -48,6 +48,12 @@
 
 static const struct {
 	u8 buffer[12];
+} tpm2_startup_cmd = {
+	{0x80, 0x01, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x01, 0x44, 0x0, 0x0 }
+};
+
+static const struct {
+	u8 buffer[12];
 } tpm_deactivate_cmd = {
 	{0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x99, 0x0, 0x3 }
 };
@@ -229,9 +235,15 @@
 			return;
 		}
 	} else {
-		printk(BIOS_SPEW, "TPM: Startup\n");
-		result = TlclSendReceive(tpm_startup_cmd.buffer,
-					response, sizeof(response));
+		if (IS_ENABLED(CONFIG_TPM2)) {
+			printk(BIOS_SPEW, "TPM2: Startup\n");
+			result = TlclSendReceive(tpm2_startup_cmd.buffer,
+						response, sizeof(response));
+		} else {
+			printk(BIOS_SPEW, "TPM: Startup\n");
+			result = TlclSendReceive(tpm_startup_cmd.buffer,
+						response, sizeof(response));
+		}
 	}
 
 	tis_close();
diff --git a/src/drivers/pc80/tpm/tpm.c b/src/drivers/pc80/tpm/tpm.c
index c0afd4c..d25cee0 100644
--- a/src/drivers/pc80/tpm/tpm.c
+++ b/src/drivers/pc80/tpm/tpm.c
@@ -125,10 +125,11 @@
 
 static const struct device_name infineon_devices[] = {
 	{0x000b, "SLB9635 TT 1.2"},
-	{0x001a, "SLB9660 TT 1.2"},
 #if IS_ENABLED(CONFIG_TPM2)
+	{0x001a, "SLB9665 TT 2.0"},
 	{0x001b, "SLB9670 TT 2.0"},
 #else
+	{0x001a, "SLB9660 TT 1.2"},
 	{0x001b, "SLB9670 TT 1.2"},
 #endif
 	{0xffff}

-- 
To view, visit https://review.coreboot.org/21983
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic20b9a65ef6a4ee392a9352f7c9bf01b2496f482
Gerrit-Change-Number: 21983
Gerrit-PatchSet: 1
Gerrit-Owner: Kamil Wcisło <kamil.wcislo at 3mdeb.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171012/5f354cdf/attachment-0001.html>


More information about the coreboot-gerrit mailing list