From 1457ea2155f118d2e4127babadcdc417ad966db2 Mon Sep 17 00:00:00 2001 From: nagendra modadugu Date: Tue, 28 Jun 2016 03:44:59 -0700 Subject: [PATCH] tpm test: use proper locality zero SPI bus addresses The fix for SPI bus base address missed the tpm test driver, this patch fixes the issue. BRANCH=none BUG=chrome-os-partner:54720 TEST=tpmtest.py connects over ftdi & tests pass Change-Id: I5a59a6e089aee5a7c25466e0d183f3647c67343a Signed-off-by: nagendra modadugu Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/356556 --- test/tpm_test/ftdi_spi_tpm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/tpm_test/ftdi_spi_tpm.c b/test/tpm_test/ftdi_spi_tpm.c index 2b9f30992a..69b6cf57da 100644 --- a/test/tpm_test/ftdi_spi_tpm.c +++ b/test/tpm_test/ftdi_spi_tpm.c @@ -18,11 +18,13 @@ static unsigned locality_; /* Set at initialization. */ static int ftdi_trace_enabled; /* 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_LOCALITY_0_SPI_BASE 0x00d40000 + +#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) static struct swig_string_data empty_string_data = (struct swig_string_data){ .size = 0, .data = NULL