summaryrefslogtreecommitdiff
path: root/lib/tpm-v1.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-02-21 16:24:52 +0300
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2023-02-28 10:44:33 +0300
commita11be4c303eabb142e074c7ca14b6ae0d293f0cb (patch)
tree99ebfce19f20a994bdc246bff46b39758675512e /lib/tpm-v1.c
parent4fef65715196364cb28ddbd7396b6015d78c778c (diff)
downloadu-boot-a11be4c303eabb142e074c7ca14b6ae0d293f0cb.tar.xz
tpm: Implement tpm_auto_start() for TPMv1.2
Add an implementation of this, moving the common call to tpm_init() up into the common API implementation. Add a test. Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/tpm-v1.c')
-rw-r--r--lib/tpm-v1.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/tpm-v1.c b/lib/tpm-v1.c
index d0e3ab1b21..60a18ca504 100644
--- a/lib/tpm-v1.c
+++ b/lib/tpm-v1.c
@@ -69,6 +69,20 @@ u32 tpm1_continue_self_test(struct udevice *dev)
return tpm_sendrecv_command(dev, command, NULL, NULL);
}
+u32 tpm1_auto_start(struct udevice *dev)
+{
+ u32 rc;
+
+ rc = tpm1_startup(dev, TPM_ST_CLEAR);
+ /* continue on if the TPM is already inited */
+ if (rc && rc != TPM_INVALID_POSTINIT)
+ return rc;
+
+ rc = tpm1_self_test_full(dev);
+
+ return rc;
+}
+
u32 tpm1_clear_and_reenable(struct udevice *dev)
{
u32 ret;