trunks: ftdi: add TPM interface initialization code
This patch initializes the FTDI interface and then tries establishing
connection with the TPM2 device.
For the purposes of this installation the C232HM USB to FTDI to SPI
cable is connected to the TPM2 device as follows:
3.3V => Red
CLK => Orange
CS => Brown
GND => Black
MISO => Green
MOSI => Yellow
RESSET => Grey
The use of SPI interface for controlling TPM2 is described in the
following TCG publication:
TCG PC Client Platform TPM Profile (PTP) Specification
Family "2.0"
Level 00 Revision 00.43
January 26, 2015
The device is first reset, then its Vendor ID is read, which allows to
confirm that the actual TPM2 device is present, then the Locality 0 is
claimed.
BUG=chromium:498861
TEST=connect the device and execute the following command inside chroot:
$ sudo trunks_client --ftdi --startup
Connected to device vid:did:rid of 15d1:001b:10
[ERROR:tpm_utility_impl.cc(113)] Error shutting down: TPM_RC_INSUFFICIENT
The error is expected, as the actual TPM command is not yet passed on
to the device.
Change-Id: I8adf0aac53524c811cadf596f22fa80ba4423cdc
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/277165
Reviewed-by: Utkarsh Sanghi <usanghi@chromium.org>
3 files changed