char: tpm: add i2c driver for cr50
authorDuncan Laurie <dlaurie@chromium.org>
Mon, 7 Dec 2020 14:20:16 +0000 (16:20 +0200)
committerJarkko Sakkinen <jarkko@kernel.org>
Tue, 16 Feb 2021 08:40:27 +0000 (10:40 +0200)
commit3a253caaad11cf4ac371dd6549a9ec6e2f2152fa
treef1c95b03b6483bc6f8fcb09e21ce420b8d271961
parentd87719c14464825aee86d5f193c4e09285cca0b3
char: tpm: add i2c driver for cr50

Add TPM 2.0 compatible I2C interface for chips with cr50 firmware.

The firmware running on the currently supported H1 MCU requires a
special driver to handle its specific protocol, and this makes it
unsuitable to use tpm_tis_core_* and instead it must implement the
underlying TPM protocol similar to the other I2C TPM drivers.

- All 4 bytes of status register must be read/written at once.
- FIFO and burst count is limited to 63 and must be drained by AP.
- Provides an interrupt to indicate when read response data is ready
and when the TPM is finished processing write data.

This driver is based on the existing infineon I2C TPM driver, which
most closely matches the cr50 i2c protocol behavior.

Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Tested-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/Kconfig
drivers/char/tpm/Makefile
drivers/char/tpm/tpm_tis_i2c_cr50.c [new file with mode: 0644]