tpm2: add SPI TPM driver

Hardware / Coreboot - Vadim Bendebury [chromium.org] - 23 June 2016 10:14 UTC

This introduces a SPI TPM driver compliant with the TCG issued "TPM Profile (PTP) Specification Revision 00.43" which can be found by googling its title.

The driver implements both the hardware flow control protocol and the TPM state machine.

The hardware flow control allows to map SPI based TPM devices to the LPC address space on x86 platforms, on all other platforms it needs to be implemented in the driver software.

The tis layer is somewhat superficial, it might have to be expanded later.

A lot more implementation details can be found in the code comments.

Also, it is worth mentioning that this is not a complete version of the driver: its robustness needs to be improved, delay loops need to be bound, error conditions need to propagate up the call stack.

BRANCH=none BUG=chrome-os-partner:52132, chrome-os-partner:50645, chrome-os-partner:54141 TEST=with the rest of the patches applied coreboot is able complete Chrome OS factory initialization of the TPM2 device.

Change-Id: I967bc5c689f6e6f345755f08cb088ad37abd5d1c

e31d243 tpm2: add SPI TPM driver
src/drivers/spi/Makefile.inc | 2 +
src/drivers/spi/tpm/Makefile.inc | 7 +
src/drivers/spi/tpm/tis.c | 84 ++++++
src/drivers/spi/tpm/tpm.c | 552 ++++++++++++++++++++++++++++++++++++++
src/drivers/spi/tpm/tpm.h | 48 ++++
5 files changed, 693 insertions(+)

Upstream: review.coreboot.org


  • Share