Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tpm: Add field upgrade mode support for Infineon TPM2 modules

TPM2_GetCapability with a capability that has the property type value
of TPM_PT_TOTAL_COMMANDS returns a zero length list, when an Infineon
TPM2 is in field upgrade mode.
Since an Infineon TPM2.0 in field upgrade mode returns RC_SUCCESS on
TPM2_Startup, the field upgrade mode has to be detected by
TPM2_GetCapability.

Signed-off-by: Stefan Mahnke-Hartmann <stefan.mahnke-hartmann@infineon.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

authored by

Stefan Mahnke-Hartmann and committed by
Jarkko Sakkinen
af402ee3 e57b2523

+5 -1
+5 -1
drivers/char/tpm/tpm2-cmd.c
··· 754 754 rc = tpm2_get_cc_attrs_tbl(chip); 755 755 756 756 out: 757 - if (rc == TPM2_RC_UPGRADE) { 757 + /* 758 + * Infineon TPM in field upgrade mode will return no data for the number 759 + * of supported commands. 760 + */ 761 + if (rc == TPM2_RC_UPGRADE || rc == -ENODATA) { 758 762 dev_info(&chip->dev, "TPM in field upgrade mode, requires firmware upgrade\n"); 759 763 chip->flags |= TPM_CHIP_FLAG_FIRMWARE_UPGRADE; 760 764 rc = 0;