aboutsummaryrefslogtreecommitdiffstats
path: root/src/hw/tpm_drivers.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-02-26 09:12:14 -0500
committerKevin O'Connor <kevin@koconnor.net>2018-02-27 11:29:11 -0500
commit9c6e73b5ebf1f184f96e9ed498a8d1a51512e807 (patch)
tree150354f6657d529aab78c30bfc68e0eea95b9747 /src/hw/tpm_drivers.h
parenta197e204cadd70758de3ea94cfb6d647e88ada95 (diff)
downloadseabios-9c6e73b5ebf1f184f96e9ed498a8d1a51512e807.tar.gz
tpm: add TPM CRB device support
The CRB device was introduced with TPM 2.0 to be physical-bus agnostic and defined in TCG PC Client Platform TPM Profile (PTP) Specification Family “2.0” Level 00 Revision 01.03 v22 It seems to be required with Windows 10. It is also a simpler device than FIFO/TIS. This patch only support locality 0 since also the CRB device in QEMU only supports this locality. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Diffstat (limited to 'src/hw/tpm_drivers.h')
-rw-r--r--src/hw/tpm_drivers.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/hw/tpm_drivers.h b/src/hw/tpm_drivers.h
index 56fd9e81..adf18396 100644
--- a/src/hw/tpm_drivers.h
+++ b/src/hw/tpm_drivers.h
@@ -24,6 +24,32 @@ int tpmhw_transmit(u8 locty, struct tpm_req_header *req,
enum tpmDurationType to_t);
void tpmhw_set_timeouts(u32 timeouts[4], u32 durations[3]);
+/* CRB driver */
+/* address of locality 0 (CRB) */
+#define TPM_CRB_BASE_ADDRESS 0xfed40000
+
+#define CRB_REG(LOCTY, REG) \
+ (void *)(TPM_CRB_BASE_ADDRESS + (LOCTY << 12) + REG)
+
+/* hardware registers */
+#define CRB_REG_LOC_STATE 0x0
+#define CRB_REG_LOC_CTRL 0x8
+#define CRB_REG_LOC_STS 0xC
+#define CRB_REG_INTF_ID 0x30
+#define CRB_REG_CTRL_EXT 0x38
+#define CRB_REG_CTRL_REQ 0x40
+#define CRB_REG_CTRL_STS 0x44
+#define CRB_REG_CTRL_CANCEL 0x48
+#define CRB_REG_CTRL_START 0x4C
+#define CRB_REG_INT_ENABLE 0x50
+#define CRB_REG_INT_STS 0x54
+#define CRB_REG_CTRL_CMD_SIZE 0x58
+#define CRB_REG_CTRL_CMD_LADDR 0x5C
+#define CRB_REG_CTRL_CMD_HADDR 0x60
+#define CRB_REG_CTRL_RSP_SIZE 0x64
+#define CRB_REG_CTRL_RSP_ADDR 0x68
+#define CRB_REG_DATA_BUFFER 0x80
+
/* TIS driver */
/* address of locality 0 (TIS) */
#define TPM_TIS_BASE_ADDRESS 0xfed40000