summaryrefslogtreecommitdiff
path: root/src/drivers/spi/tpm/tpm.c
diff options
context:
space:
mode:
authorJes Klinke <jbk@google.com>2022-03-28 14:22:24 -0700
committerMartin L Roth <martinroth@google.com>2022-04-24 22:09:42 +0000
commit1430b043f0376f00d4e1064d231745cb3e62edf0 (patch)
tree057384f10a7fefa2de190b203e143d0471f94196 /src/drivers/spi/tpm/tpm.c
parent9d8df30950710635c9e7c099ef8d0c8d047658ca (diff)
tpm: Allow separate handling of Google Ti50 TPM
A new iteration of Google's TPM implementation will advertize a new DID:VID, but otherwise follow the same protocol as the earlier design. This change makes use of Kconfigs TPM_GOOGLE_CR50 and TPM_GOOGLE_TI50 to be able to take slightly different code paths, when e.g. evaluating whether TPM firmware is new enough to support certain features. Change-Id: I1e1f8eb9b94fc2d5689656335dc1135b47880986 Signed-off-by: Jes B. Klinke <jbk@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63158 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/drivers/spi/tpm/tpm.c')
-rw-r--r--src/drivers/spi/tpm/tpm.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/drivers/spi/tpm/tpm.c b/src/drivers/spi/tpm/tpm.c
index 1462dd9f7f..8625a7921b 100644
--- a/src/drivers/spi/tpm/tpm.c
+++ b/src/drivers/spi/tpm/tpm.c
@@ -419,6 +419,7 @@ static enum cb_err tpm2_claim_locality(void)
/* Device/vendor ID values of the TPM devices this driver supports. */
static const uint32_t supported_did_vids[] = {
0x00281ae0, /* H1 based Cr50 security chip. */
+ 0x504a6666, /* H1D3C based Ti50 security chip. */
0x0000104a /* ST33HTPH2E32 */
};
@@ -496,15 +497,13 @@ int tpm2_init(struct spi_slave *spi_if)
printk(BIOS_INFO, "Connected to device vid:did:rid of %4.4x:%4.4x:%2.2x\n",
tpm_info.vendor_id, tpm_info.device_id, tpm_info.revision);
- /* Do some cr50-specific things here. */
- if (CONFIG(TPM_GOOGLE) && tpm_info.vendor_id == 0x1ae0) {
- struct cr50_firmware_version ver;
-
+ /* Do some GSC-specific things here. */
+ if (CONFIG(TPM_GOOGLE)) {
if (tpm_first_access_this_boot()) {
/* This is called for the side-effect of printing the firmware version
string */
- cr50_get_firmware_version(&ver);
- cr50_set_board_cfg();
+ cr50_get_firmware_version(NULL);
+ cr50_set_board_cfg();
}
}
return 0;