summaryrefslogtreecommitdiff
path: root/cmd/tpm-v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/tpm-v2.c')
-rw-r--r--cmd/tpm-v2.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/cmd/tpm-v2.c b/cmd/tpm-v2.c
index 0cd39821bff..e6742656f57 100644
--- a/cmd/tpm-v2.c
+++ b/cmd/tpm-v2.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <command.h>
#include <dm.h>
#include <log.h>
#include <mapmem.h>
@@ -12,8 +13,8 @@
#include <tpm-v2.h>
#include "tpm-user-utils.h"
-static int do_tpm2_startup(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm2_startup(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
enum tpm2_startup_types mode;
struct udevice *dev;
@@ -37,8 +38,8 @@ static int do_tpm2_startup(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm2_startup(dev, mode));
}
-static int do_tpm2_self_test(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm2_self_test(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
enum tpm2_yes_no full_test;
struct udevice *dev;
@@ -62,8 +63,8 @@ static int do_tpm2_self_test(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm2_self_test(dev, full_test));
}
-static int do_tpm2_clear(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm2_clear(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 handle = 0;
const char *pw = (argc < 3) ? NULL : argv[2];
@@ -91,8 +92,8 @@ static int do_tpm2_clear(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm2_clear(dev, handle, pw, pw_sz));
}
-static int do_tpm2_pcr_extend(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm2_pcr_extend(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct tpm_chip_priv *priv;
@@ -122,8 +123,8 @@ static int do_tpm2_pcr_extend(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_pcr_read(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_pcr_read(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct tpm_chip_priv *priv;
@@ -160,8 +161,8 @@ static int do_tpm_pcr_read(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_get_capability(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_get_capability(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 capability, property, rc;
u8 *data;
@@ -203,7 +204,7 @@ unmap_data:
return report_return_code(rc);
}
-static int do_tpm_dam_reset(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_tpm_dam_reset(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const char *pw = (argc < 2) ? NULL : argv[1];
@@ -224,7 +225,7 @@ static int do_tpm_dam_reset(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm2_dam_reset(dev, pw, pw_sz));
}
-static int do_tpm_dam_parameters(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_tpm_dam_parameters(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const char *pw = (argc < 5) ? NULL : argv[4];
@@ -268,7 +269,7 @@ static int do_tpm_dam_parameters(cmd_tbl_t *cmdtp, int flag, int argc,
lockout_recovery));
}
-static int do_tpm_change_auth(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_tpm_change_auth(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
u32 handle;
@@ -304,8 +305,8 @@ static int do_tpm_change_auth(cmd_tbl_t *cmdtp, int flag, int argc,
oldpw, oldpw_sz));
}
-static int do_tpm_pcr_setauthpolicy(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_pcr_setauthpolicy(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 index = simple_strtoul(argv[1], NULL, 0);
char *key = argv[2];
@@ -328,8 +329,8 @@ static int do_tpm_pcr_setauthpolicy(cmd_tbl_t *cmdtp, int flag, int argc,
key));
}
-static int do_tpm_pcr_setauthvalue(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_tpm_pcr_setauthvalue(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
u32 index = simple_strtoul(argv[1], NULL, 0);
char *key = argv[2];
@@ -353,7 +354,7 @@ static int do_tpm_pcr_setauthvalue(cmd_tbl_t *cmdtp, int flag,
key, key_sz));
}
-static cmd_tbl_t tpm2_commands[] = {
+static struct cmd_tbl tpm2_commands[] = {
U_BOOT_CMD_MKENT(device, 0, 1, do_tpm_device, "", ""),
U_BOOT_CMD_MKENT(info, 0, 1, do_tpm_info, "", ""),
U_BOOT_CMD_MKENT(init, 0, 1, do_tpm_init, "", ""),
@@ -372,7 +373,7 @@ static cmd_tbl_t tpm2_commands[] = {
do_tpm_pcr_setauthvalue, "", ""),
};
-cmd_tbl_t *get_tpm2_commands(unsigned int *size)
+struct cmd_tbl *get_tpm2_commands(unsigned int *size)
{
*size = ARRAY_SIZE(tpm2_commands);