summaryrefslogtreecommitdiff
path: root/src/security/tpm
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2022-02-16 13:44:48 -0700
committerFelix Held <felix-coreboot@felixheld.de>2022-03-01 16:52:31 +0000
commit63632d7d82648f77067eadb1bf8c539d7b2d7aaf (patch)
tree5d8e0ac79002d1599970fbe857c742d024cb3b47 /src/security/tpm
parent591c7ebf18359e9686aa592bc5636e9811a5a468 (diff)
security/tpm: Add vendor-specific tis functions to read/write TPM regs
In order to abstract bus-specific logic from TPM logic, the prototype for two vendor-specific tis functions are added in this patch. tis_vendor_read() can be used to read directly from TPM registers, and tis_vendor_write() can be used to write directly to TPM registers. Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Change-Id: I939cf5b6620b6f5f6d454c53fcaf37c153702acc Reviewed-on: https://review.coreboot.org/c/coreboot/+/62058 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/security/tpm')
-rw-r--r--src/security/tpm/tis.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/security/tpm/tis.h b/src/security/tpm/tis.h
index 5b2c001070..3b65134d27 100644
--- a/src/security/tpm/tis.h
+++ b/src/security/tpm/tis.h
@@ -5,6 +5,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <types.h>
enum tis_access {
TPM_ACCESS_VALID = (1 << 7),
@@ -84,4 +85,31 @@ int tis_sendrecv(const u8 *sendbuf, size_t send_size, u8 *recvbuf,
*/
int tis_plat_irq_status(void);
+/*
+ * tis_vendor_write()
+ *
+ * Vendor-specific function to send the requested data to the TPM.
+ *
+ * @addr - address of the register to write to
+ * @sendbuf - buffer of the data to send
+ * @send_size - size of the data to send
+ *
+ * Returns CB_SUCCESS 0 on success, CB_ERR on failure.
+ */
+cb_err_t tis_vendor_write(unsigned int addr, const void *sendbuf, size_t send_size);
+
+/*
+ * tis_vendor_read()
+ *
+ * Vendor-specific function to read the requested data from the TPM.
+ *
+ * @addr - address of the register to read from
+ * @recvbuf - buffer of the data to read
+ * @recv_size - size of the output buffer
+ *
+ * Returns CB_SUCCESS on success or -1 on failure.
+ */
+cb_err_t tis_vendor_read(unsigned int addr, void *recvbuf, size_t recv_size);
+
+
#endif /* TIS_H_ */