Skip to content
Commit bbc23a07 authored by Alexander Steffen's avatar Alexander Steffen Committed by Jarkko Sakkinen
Browse files

tpm: Add tpm_tis_i2c backend for tpm_tis_core



Implement the TCG I2C Interface driver, as specified in the TCG PC
Client Platform TPM Profile (PTP) specification for TPM 2.0 v1.04
revision 14, section 8, I2C Interface Definition.

This driver supports Guard Times. That is, if required by the TPM, the
driver has to wait by a vendor-specific time after each I2C read/write.
The specific time is read from the TPM_I2C_INTERFACE_CAPABILITY register.

Unfortunately, the TCG specified almost but not quite compatible
register addresses. Therefore, the TIS register addresses need to be
mapped to I2C ones. The locality is stripped because for now, only
locality 0 is supported.

Add a sanity check to I2C reads of e.g. TPM_ACCESS and TPM_STS. This is
to detect communication errors and issues due to non-standard behaviour
(E.g. the clock stretching quirk in the BCM2835, see 4dbfb5f4). In
case the sanity check fails, attempt a retry.

Co-developed-by: default avatarJohannes Holland <johannes.holland@infineon.com>
Signed-off-by: default avatarJohannes Holland <johannes.holland@infineon.com>
Co-developed-by: default avatarAmir Mizinski <amirmizi6@gmail.com>
Signed-off-by: default avatarAmir Mizinski <amirmizi6@gmail.com>
Signed-off-by: default avatarAlexander Steffen <Alexander.Steffen@infineon.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
parent f25534a6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment