Attention is currently required from: Christian Walter, Julius Werner, Krystian Hebel, Sergii Dmytruk.
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69023 )
Change subject: drivers/pc80/tpm: probe for TPM family of a device ......................................................................
Patch Set 4:
(3 comments)
File src/drivers/pc80/tpm/tis.c:
https://review.coreboot.org/c/coreboot/+/69023/comment/8c4d5204_5240586e PS4, Line 407: sts = tpm_read_status(locality); We cannot rely on TPM_STS register as older TPMs may not implement TPM family field. See https://trustedcomputinggroup.org/wp-content/uploads/TCG_PCClientTPMInterfac... Table 15.
https://review.coreboot.org/c/coreboot/+/69023/comment/9e12c984_1e2395c7 PS4, Line 408: if ((intf_id & 0xf) == 0xf || (sts & TPM_STS_FAMILY_MASK) != TPM_STS_FAMILY_TPM_2_0) If intf_id is equal 0xf that means – FIFO interface as defined in TIS1.3 is active That doesn't mean the TPM is 2.0 or 1.2. We have to consult TIS_REG_INTF_CAPABILITY in such case. See Table 23 https://trustedcomputinggroup.org/wp-content/uploads/PC-Client-Specific-Plat... and check for the field InterfaceVersion, it should be supported by older TPMs: value 0 or 2 should mean TPM 1.2, and value of 3 should mean TPM 2.0
https://review.coreboot.org/c/coreboot/+/69023/comment/22fa3254_1b9b4092 PS4, Line 436: if (vendor_name == NULL) { : printk(BIOS_INFO, "Found TPM 0x%04x by 0x%04x\n", did, vid); : } else if (device_name == NULL) { : printk(BIOS_INFO, "Found TPM 0x%04x by %s (0x%04x)\n", did, vendor_name, vid); : } else { : const char *tpm_family = (family == TPM_1 ? "TPM1" : "TPM2"); : printk(BIOS_INFO, "Found %s %s (0x%04x) by %s (0x%04x)\n", tpm_family, : device_name, did, vendor_name, vid); : } : Let's report TPM family in each branch of execution.