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>
diff --git a/src/drivers/spi/tpm/tpm.c b/src/drivers/spi/tpm/tpm.c
index a46042d..b02fc5f 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 {