summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2016-08-11 08:52:11 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-05 23:22:15 -0700
commitef4ccb2318cafb040be782bffac6f2e836e17961 (patch)
tree10a20ee74b6fa549dbfb821e16b5296271bd66d7 /common
parente4f389a275fb81c112b1186df0465e48ff163cfd (diff)
downloadchrome-ec-ef4ccb2318cafb040be782bffac6f2e836e17961.tar.gz
Cr50: I2CS TPM: Unify tpm_registers interface between SPI and I2C
Removed 3 TPM register definitions which were not used in tpm_registers.c and added missing entries to the I2CS translation table for TPM register address lookup. Moved the SPI specific locality 0 offset from tpm_registers.c to sps_tpm.c so the register defines in tmp_registers.c can be common to both the SPS and I2CS interface. BRANCH=none BUG=chrome-os-partner:40397 TEST=manual For I2CS verification on Reef AP console used the command 'i2cget -y 8 0x50 <addr> b' to read both the TPM access and RID register. For SPI verifcation updated Cr50 FW on Kevin and verified that the AP successfully boots. Additionally, issued the command from the Kevin console 'trunks_client --own' and got the following console output without any errors being listed. [INFO:tpm_utility_impl.cc(1692)] CreateStorageRootKeys: Created RSA SRK. [INFO:tpm_utility_impl.cc(1735)] CreateStorageRootKeys: Created ECC SRK. Change-Id: Ib0b70e22cd46de2c59bd2e73f3c9aebd661e66c4 Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/368621 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/i2cs_tpm.c11
-rw-r--r--common/tpm_registers.c21
2 files changed, 15 insertions, 17 deletions
diff --git a/common/i2cs_tpm.c b/common/i2cs_tpm.c
index 0e3071b590..dfc89ea822 100644
--- a/common/i2cs_tpm.c
+++ b/common/i2cs_tpm.c
@@ -68,10 +68,13 @@ struct i2c_tpm_reg_map {
uint16_t tpm_address;
};
static const struct i2c_tpm_reg_map i2c_to_tpm[] = {
- {0, 1, 0}, /* TPM Access */
- {1, 4, 0x18}, /* TPM Status */
- {5, 0, 0x24}, /* TPM Fifo, variable size. */
- {6, 4, 0xf00}, /* TPM DID VID */
+ {0, 1, 0}, /* TPM Access */
+ {1, 4, 0x18}, /* TPM Status */
+ {5, 0, 0x24}, /* TPM Fifo, variable size. */
+ {6, 4, 0xf00}, /* TPM DID VID */
+ {0xa, 4, 0x14}, /* TPM TPM_INTF_CAPABILITY */
+ {0xe, 1, 0xf04}, /* TPM RID */
+ {0xf, 4, 0xf90}, /* TPM_FW_VER */
};
static void wr_complete_handler(void *i2cs_data, size_t i2cs_data_size)
diff --git a/common/tpm_registers.c b/common/tpm_registers.c
index 0158e22f2f..95071c10c9 100644
--- a/common/tpm_registers.c
+++ b/common/tpm_registers.c
@@ -31,20 +31,15 @@
#define CPRINTS(format, args...) cprints(CC_TPM, format, ## args)
#define CPRINTF(format, args...) cprintf(CC_TPM, format, ## args)
-#define TPM_LOCALITY_0_SPI_BASE 0x00d40000
-
/* Register addresses for FIFO mode. */
-#define TPM_ACCESS (TPM_LOCALITY_0_SPI_BASE + 0)
-#define TPM_INT_ENABLE (TPM_LOCALITY_0_SPI_BASE + 8)
-#define TPM_INT_VECTOR (TPM_LOCALITY_0_SPI_BASE + 0xC)
-#define TPM_INT_STATUS (TPM_LOCALITY_0_SPI_BASE + 0x10)
-#define TPM_INTF_CAPABILITY (TPM_LOCALITY_0_SPI_BASE + 0x14)
-#define TPM_STS (TPM_LOCALITY_0_SPI_BASE + 0x18)
-#define TPM_DATA_FIFO (TPM_LOCALITY_0_SPI_BASE + 0x24)
-#define TPM_INTERFACE_ID (TPM_LOCALITY_0_SPI_BASE + 0x30)
-#define TPM_DID_VID (TPM_LOCALITY_0_SPI_BASE + 0xf00)
-#define TPM_RID (TPM_LOCALITY_0_SPI_BASE + 0xf04)
-#define TPM_FW_VER (TPM_LOCALITY_0_SPI_BASE + 0xf90)
+#define TPM_ACCESS (0)
+#define TPM_INTF_CAPABILITY (0x14)
+#define TPM_STS (0x18)
+#define TPM_DATA_FIFO (0x24)
+#define TPM_INTERFACE_ID (0x30)
+#define TPM_DID_VID (0xf00)
+#define TPM_RID (0xf04)
+#define TPM_FW_VER (0xf90)
#define GOOGLE_VID 0x1ae0
#define GOOGLE_DID 0x0028