tpm: add TPM2_PCR_Read command support
Add support for the TPM2_PCR_Read command.
Change the command file and the help accordingly.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/include/tpm-v2.h b/include/tpm-v2.h
index 25bb15a..2b8600a 100644
--- a/include/tpm-v2.h
+++ b/include/tpm-v2.h
@@ -164,4 +164,17 @@
*/
u32 tpm2_pcr_extend(u32 index, const uint8_t *digest);
+/**
+ * Issue a TPM2_PCR_Read command.
+ *
+ * @idx Index of the PCR
+ * @idx_min_sz Minimum size in bytes of the pcrSelect array
+ * @data Output buffer for contents of the named PCR
+ * @updates Optional out parameter: number of updates for this PCR
+ *
+ * @return code of the operation
+ */
+u32 tpm2_pcr_read(u32 idx, unsigned int idx_min_sz, void *data,
+ unsigned int *updates);
+
#endif /* __TPM_V2_H */