aboutsummaryrefslogtreecommitdiff
path: root/include/tpm-v2.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-06 14:23:41 -0700
committerTom Rini <trini@konsulko.com>2021-03-02 15:53:37 -0500
commit7785bc1d5f94d28497bef6935ecbaa1b0ddd3e26 (patch)
tree27f83962679608c05adcb0ee964b6bf6f28c6177 /include/tpm-v2.h
parent6719cbe31afef2cba4bc10b33350b38c4a51c3ac (diff)
downloadu-boot-7785bc1d5f94d28497bef6935ecbaa1b0ddd3e26.zip
u-boot-7785bc1d5f94d28497bef6935ecbaa1b0ddd3e26.tar.gz
u-boot-7785bc1d5f94d28497bef6935ecbaa1b0ddd3e26.tar.bz2
tpm: Add TPM2 support for write_lock
Implement this API function for TPM2. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'include/tpm-v2.h')
-rw-r--r--include/tpm-v2.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/tpm-v2.h b/include/tpm-v2.h
index b73a2d2..fa3296a 100644
--- a/include/tpm-v2.h
+++ b/include/tpm-v2.h
@@ -243,6 +243,7 @@ enum tpm2_command_codes {
TPM2_CC_NV_DEFINE_SPACE = 0x012a,
TPM2_CC_PCR_SETAUTHPOL = 0x012C,
TPM2_CC_NV_WRITE = 0x0137,
+ TPM2_CC_NV_WRITELOCK = 0x0138,
TPM2_CC_DAM_RESET = 0x0139,
TPM2_CC_DAM_PARAMETERS = 0x013A,
TPM2_CC_NV_READ = 0x014E,
@@ -572,4 +573,15 @@ u32 tpm2_pcr_setauthvalue(struct udevice *dev, const char *pw,
*/
u32 tpm2_get_random(struct udevice *dev, void *data, u32 count);
+/**
+ * Lock data in the TPM
+ *
+ * Once locked the data cannot be written until after a reboot
+ *
+ * @dev TPM device
+ * @index Index of data to lock
+ * @return code of the operation
+ */
+u32 tpm2_write_lock(struct udevice *dev, u32 index);
+
#endif /* __TPM_V2_H */