From e663b2ff4ba2a7f49cb6bb96370f02f0e8a94296 Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Wed, 7 Jun 2023 12:18:10 +0300 Subject: tpm: Add 'tpm autostart' shell command For a TPM device to be operational we need to initialize it and perform its startup sequence. The 'tpm init' command currently calls tpm_init() which ends up calling the ->open() per-device callback and performs the initial hardware configuration as well as requesting locality 0 for the caller. There no code that currently calls tpm_init() without following up with a tpm_startup() and tpm_self_test_full() or tpm_continue_self_test(). So let's add a 'tpm autostart' command and call tpm_auto_start() which leaves the device in an operational state. It's worth noting that calling tpm_init() only, doesn't allow a someone to use the TPM since the startup sequence is mandatory. We always repeat the pattern of calling - tpm_init() - tpm_startup() - tpm_self_test_full() or tpm_continue_self_test() Reviewed-by: Simon Glass Signed-off-by: Ilias Apalodimas --- cmd/tpm-user-utils.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cmd/tpm-user-utils.h') diff --git a/cmd/tpm-user-utils.h b/cmd/tpm-user-utils.h index de4a934aab..dfa11353e1 100644 --- a/cmd/tpm-user-utils.h +++ b/cmd/tpm-user-utils.h @@ -20,6 +20,7 @@ int get_tpm(struct udevice **devp); int do_tpm_device(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_tpm_init(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +int do_tpm_autostart(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_tpm_info(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_tpm_report_state(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); -- cgit v1.2.3