From 05155c0013d76ef324edcedb40ab61e50807a6a8 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Thu, 23 Jun 2016 12:03:18 -0700 Subject: [PATCH] tpm: use proper locality zero SPI bus addresses The "PC Client Protection Profile for TPM 2.0" document defines SPI bus addresses for different localities. That definition is not honored in the cr50 implementation, this patch fixes it: locality zero register file is based off 0xd40000. BRANCH=none BUG=chrome-os-partner:54720 TEST=with the fixed cr50 image and the rest of TPM2 initialization patches applied factory initialization sequence on Gru succeeds. Change-Id: I49b7ed55f0360448b9a6602ebd31a3a531608da3 Signed-off-by: Martin Roth Original-Commit-Id: 43344fff5d58ec235e50030413fc38c98dd0a9a1 Original-Change-Id: I2de6fa6c05d3eca989d6785228d5adde1f2a7ab7 Original-Signed-off-by: Vadim Bendebury Original-Reviewed-on: https://chromium-review.googlesource.com/355620 Original-Reviewed-by: Bill Richardson Reviewed-on: https://review.coreboot.org/15568 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Philipp Deppenwiese --- src/drivers/spi/tpm/tpm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/drivers/spi/tpm/tpm.c b/src/drivers/spi/tpm/tpm.c index a46042d431..b02fc5fbea 100644 --- a/src/drivers/spi/tpm/tpm.c +++ b/src/drivers/spi/tpm/tpm.c @@ -24,12 +24,14 @@ #include "tpm.h" +#define TPM_LOCALITY_0_SPI_BASE 0x00d40000 + /* Assorted TPM2 registers for interface type FIFO. */ -#define TPM_ACCESS_REG 0 -#define TPM_STS_REG 0x18 -#define TPM_DATA_FIFO_REG 0x24 -#define TPM_DID_VID_REG 0xf00 -#define TPM_RID_REG 0xf04 +#define TPM_ACCESS_REG (TPM_LOCALITY_0_SPI_BASE + 0) +#define TPM_STS_REG (TPM_LOCALITY_0_SPI_BASE + 0x18) +#define TPM_DATA_FIFO_REG (TPM_LOCALITY_0_SPI_BASE + 0x24) +#define TPM_DID_VID_REG (TPM_LOCALITY_0_SPI_BASE + 0xf00) +#define TPM_RID_REG (TPM_LOCALITY_0_SPI_BASE + 0xf04) /* SPI Interface descriptor used by the driver. */ struct tpm_spi_if {