aboutsummaryrefslogtreecommitdiff
path: root/include/tpm-common.h
diff options
context:
space:
mode:
authorSimon Glass2022-08-30 21:05:36 -0600
committerIlias Apalodimas2022-09-03 16:59:05 +0300
commit3bb4db4c3883c66ee0bbf152e9ba1d2504fa8c9f (patch)
treeb94da976937e8039287e79b395ca9068f9f9e34f /include/tpm-common.h
parent6694c997b210656fc3e6ce63ba780bc9bf97c077 (diff)
tpm: Allow reporting the internal state
It is useful to read information about the current TPM state, where supported, e.g. for debugging purposes when verified boot fails. Add support for this to the TPM interface as well as Cr50. Add a simple sandbox test. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'include/tpm-common.h')
-rw-r--r--include/tpm-common.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/tpm-common.h b/include/tpm-common.h
index a28629e7013..b2c5404430f 100644
--- a/include/tpm-common.h
+++ b/include/tpm-common.h
@@ -120,6 +120,16 @@ struct tpm_ops {
int (*get_desc)(struct udevice *dev, char *buf, int size);
/**
+ * report_state() - Collect information about the current TPM state
+ *
+ * @dev: Device to check
+ * @buf: Buffer to put the string
+ * @size: Maximum size of buffer
+ * Return: return code of the operation (0 = success)
+ */
+ int (*report_state)(struct udevice *dev, char *buf, int size);
+
+ /**
* send() - send data to the TPM
*
* @dev: Device to talk to
@@ -235,6 +245,16 @@ u32 tpm_clear_and_reenable(struct udevice *dev);
int tpm_get_desc(struct udevice *dev, char *buf, int size);
/**
+ * tpm_report_state() - Collect information about the current TPM state
+ *
+ * @dev: Device to check
+ * @buf: Buffer to put the string
+ * @size: Maximum size of buffer
+ * Return: return code of the operation (0 = success)
+ */
+int tpm_report_state(struct udevice *dev, char *buf, int size);
+
+/**
* tpm_xfer() - send data to the TPM and get response
*
* This first uses the device's send() method to send the bytes. Then it calls