summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2016-06-23 12:03:18 -0700
committerMartin Roth <martinroth@google.com>2016-07-11 23:42:32 +0200
commit05155c0013d76ef324edcedb40ab61e50807a6a8 (patch)
tree426d553480b6a68e339dea514d81450c7524d3d8
parente5c00a5d2c71cc7689e783f26a6031997857d661 (diff)
downloadcoreboot-05155c0013d76ef324edcedb40ab61e50807a6a8.tar.xz
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 <martinroth@chromium.org> Original-Commit-Id: 43344fff5d58ec235e50030413fc38c98dd0a9a1 Original-Change-Id: I2de6fa6c05d3eca989d6785228d5adde1f2a7ab7 Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/355620 Original-Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://review.coreboot.org/15568 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
-rw-r--r--src/drivers/spi/tpm/tpm.c12
1 files 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 {