spi/tpm: read TPM version in larger chunks

Hardware / Coreboot - Vadim Bendebury [chromium.org] - 3 August 2016 13:07 UTC

The TPM version string has become much longer recently, and the TPM_FW_VER register available on VID 1ae0 devices supports reading in arbitrary size quantities.

Let's read 50 bytes at a time to reduce the SPI register read wrapper overhead, and increase the length limit to 300 bytes to accommodate longer version strings.

TEST=verified on the Kevin device: localhost ~ # grep cr50 /sys/firmware/log Firmware version: RO_A: 0.0.1/84e2dde7 RO_B:* 0.0.2/13eda43f RW_A:* cr50_v1.1.5005-444ddb7 RW_B: cr50_v1.1.5005-5aac83c cr50_v1.1.5005-444ddb7 private-cr51:v0.0.66-bd9a0fe tpm2:v0.0.259-8f3d735 cryptoc:v0.0.4-5319e83 2016-07-31 10:58:05 vbendeb@kvasha

Change-Id: Ifaf28c1a9a3990372a9cec108c098edbe50d3243

9e561f8 spi/tpm: read TPM version in larger chunks
src/drivers/spi/tpm/tpm.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)

Upstream: review.coreboot.org


  • Share