aboutsummaryrefslogtreecommitdiff
path: root/cmd/tpm-common.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-06-13 13:14:49 -0400
committerTom Rini <trini@konsulko.com>2023-06-13 13:14:49 -0400
commitcb4fe56eca1109780e97c68329e6b71ef33bf0e6 (patch)
tree55d67b8fea6be17e32964d52b276a7b200faa1e9 /cmd/tpm-common.c
parent7da82de916d6aaeeef62431810cb3335e1207b28 (diff)
parent011f015540d788227a1a2d16dd6245120827bdec (diff)
downloadu-boot-WIP/13Jun2023-next.zip
u-boot-WIP/13Jun2023-next.tar.gz
u-boot-WIP/13Jun2023-next.tar.bz2
Merge tag 'tpm-for_tom-13062023' of https://source.denx.de/u-boot/custodians/u-boot-tpm into nextWIP/13Jun2023-next
tpm autostart
Diffstat (limited to 'cmd/tpm-common.c')
-rw-r--r--cmd/tpm-common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c
index d0c63ca..a7dc23d 100644
--- a/cmd/tpm-common.c
+++ b/cmd/tpm-common.c
@@ -11,6 +11,7 @@
#include <asm/unaligned.h>
#include <linux/string.h>
#include <tpm-common.h>
+#include <tpm_api.h>
#include "tpm-user-utils.h"
static struct udevice *tpm_dev;
@@ -367,6 +368,21 @@ int do_tpm_init(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
return report_return_code(tpm_init(dev));
}
+int do_tpm_autostart(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ struct udevice *dev;
+ int rc;
+
+ if (argc != 1)
+ return CMD_RET_USAGE;
+ rc = get_tpm(&dev);
+ if (rc)
+ return rc;
+
+ return report_return_code(tpm_auto_start(dev));
+}
+
int do_tpm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct cmd_tbl *tpm_commands, *cmd;