Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/62058 )
Change subject: security/tpm: Add vendor-specific tis functions to read/write TPM regs ......................................................................
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 --- M src/security/tpm/tis.h 1 file changed, 28 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/security/tpm/tis.h b/src/security/tpm/tis.h index 5b2c001..3b65134 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_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_ */
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.