tpm: introduce TPM SPI driver
authorVadim Bendebury <vbendeb@chromium.org>
Thu, 23 Jun 2016 02:14:01 +0000 (19:14 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Fri, 24 Jun 2016 03:19:55 +0000 (20:19 -0700)
commit77de9dec83123a952cd62aac9a3f587eed7086e1
tree1727668f55d723c3168d67ffefe3a12d0f2a95b5
parent0e044797f1f582d409e491582ca1dafaddd6c9fb
tpm: introduce TPM SPI driver

This ports the SPI TPM driver from coreboot. The driver is 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.

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

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:50645, chrome-os-partner:54141
TEST=with the rest of the patches applied; attempts of vboot_firmware
     to communicate with the TPM trigger proper TPM initialization
     (which indicates that SPI interface is operational and is plugged
     in properly). Chrome OS boot fails because vboot_firmware does not
     speak TPM2 yet.

Change-Id: Ic084c8b7ed14a24fd210cfe9ef59430f636696fc
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/355320
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
src/drivers/tpm/Kconfig
src/drivers/tpm/Makefile.inc
src/drivers/tpm/spi.c [new file with mode: 0644]
src/drivers/tpm/spi.h [new file with mode: 0644]