summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig15
-rw-r--r--cmd/bootefi.c4
-rw-r--r--cmd/booti.c1
-rw-r--r--cmd/gpt.c4
-rw-r--r--cmd/part.c4
-rw-r--r--cmd/reiser.c2
-rw-r--r--cmd/tpm.c70
-rw-r--r--cmd/zfs.c2
8 files changed, 90 insertions, 12 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 91bd3fb..4a0d489 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -394,6 +394,14 @@ config CMD_FLASH
erase - FLASH memory
protect - enable or disable FLASH write protection
+config CMD_GPT
+ bool "GPT (GUID Partition Table) command"
+ select PARTITION_UUIDS
+ select EFI_PARTITION
+ help
+ Enable the 'gpt' command to ready and write GPT style partition
+ tables.
+
config CMD_ARMFLASH
#depends on FLASH_CFI_DRIVER
bool "armflash"
@@ -410,6 +418,13 @@ config CMD_NAND
help
NAND support.
+config CMD_PART
+ bool "part"
+ select PARTITION_UUIDS
+ help
+ Read and display information about the partition table on
+ various media.
+
config CMD_SF
bool "sf"
help
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 06943a9..3b77705 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -321,7 +321,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
char devname[32] = { 0 }; /* dp->str is u16[32] long */
char *colon;
-#if defined(CONFIG_BLK) || defined(CONFIG_ISO_PARTITION)
+#if defined(CONFIG_BLK) || CONFIG_IS_ENABLED(ISO_PARTITION)
desc = blk_get_dev(dev, simple_strtol(devnr, NULL, 10));
#endif
@@ -338,7 +338,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
colon = strchr(devname, ':');
-#ifdef CONFIG_ISO_PARTITION
+#if CONFIG_IS_ENABLED(ISO_PARTITION)
/* For ISOs we create partition block devices */
if (desc && (desc->type != DEV_TYPE_UNKNOWN) &&
(desc->part_type == PART_TYPE_ISO)) {
diff --git a/cmd/booti.c b/cmd/booti.c
index 2d879f3..bff87a8 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -131,6 +131,7 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
bootm_disable_interrupts();
images.os.os = IH_OS_LINUX;
+ images.os.arch = IH_ARCH_ARM64;
ret = do_bootm_states(cmdtp, flag, argc, argv,
#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
BOOTM_STATE_RAMDISK |
diff --git a/cmd/gpt.c b/cmd/gpt.c
index 897596a..196f506 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -20,10 +20,6 @@
#include <div64.h>
#include <memalign.h>
-#ifndef CONFIG_PARTITION_UUIDS
-#error CONFIG_PARTITION_UUIDS must be enabled for CONFIG_CMD_GPT to be enabled
-#endif
-
/**
* extract_env(): Expand env name from string format '&{env_name}'
* and return pointer to the env (if the env is set)
diff --git a/cmd/part.c b/cmd/part.c
index 414031e..8ba0598 100644
--- a/cmd/part.c
+++ b/cmd/part.c
@@ -22,10 +22,6 @@
#include <part.h>
#include <vsprintf.h>
-#ifndef CONFIG_PARTITION_UUIDS
-#error CONFIG_PARTITION_UUIDS must be enabled for CONFIG_CMD_PART to be enabled
-#endif
-
static int do_part_uuid(int argc, char * const argv[])
{
int part;
diff --git a/cmd/reiser.c b/cmd/reiser.c
index cbdad36..9c3e9e9 100644
--- a/cmd/reiser.c
+++ b/cmd/reiser.c
@@ -18,7 +18,7 @@
#include <reiserfs.h>
#include <part.h>
-#ifndef CONFIG_DOS_PARTITION
+#if !CONFIG_IS_ENABLED(DOS_PARTITION)
#error DOS partition support must be selected
#endif
diff --git a/cmd/tpm.c b/cmd/tpm.c
index 312503f..625fc43 100644
--- a/cmd/tpm.c
+++ b/cmd/tpm.c
@@ -646,6 +646,64 @@ TPM_COMMAND_NO_ARG(tpm_end_oiap)
#endif /* CONFIG_TPM_AUTH_SESSIONS */
+#ifdef CONFIG_TPM_FLUSH_RESOURCES
+static int do_tpm_flush(cmd_tbl_t *cmdtp, int flag, int argc,
+ char * const argv[])
+{
+ int type = 0;
+
+ if (argc != 2)
+ return CMD_RET_USAGE;
+
+ if (strcasecmp(argv[1], "key"))
+ type = TPM_RT_KEY;
+ else if (strcasecmp(argv[1], "auth"))
+ type = TPM_RT_AUTH;
+ else if (strcasecmp(argv[1], "hash"))
+ type = TPM_RT_HASH;
+ else if (strcasecmp(argv[1], "trans"))
+ type = TPM_RT_TRANS;
+ else if (strcasecmp(argv[1], "context"))
+ type = TPM_RT_CONTEXT;
+ else if (strcasecmp(argv[1], "counter"))
+ type = TPM_RT_COUNTER;
+ else if (strcasecmp(argv[1], "delegate"))
+ type = TPM_RT_DELEGATE;
+ else if (strcasecmp(argv[1], "daa_tpm"))
+ type = TPM_RT_DAA_TPM;
+ else if (strcasecmp(argv[1], "daa_v0"))
+ type = TPM_RT_DAA_V0;
+ else if (strcasecmp(argv[1], "daa_v1"))
+ type = TPM_RT_DAA_V1;
+
+ if (strcasecmp(argv[2], "all")) {
+ uint16_t res_count;
+ uint8_t buf[288];
+ uint8_t *ptr;
+ int err;
+ uint i;
+
+ /* fetch list of already loaded resources in the TPM */
+ err = tpm_get_capability(TPM_CAP_HANDLE, type, buf,
+ sizeof(buf));
+ if (err)
+ return -1;
+ res_count = get_unaligned_be16(buf);
+ ptr = buf + 2;
+ for (i = 0; i < res_count; ++i, ptr += 4)
+ tpm_flush_specific(get_unaligned_be32(ptr), type);
+ } else {
+ uint32_t handle = simple_strtoul(argv[2], NULL, 0);
+
+ if (!handle)
+ return -1;
+ tpm_flush_specific(cpu_to_be32(handle), type);
+ }
+
+ return 0;
+}
+#endif /* CONFIG_TPM_FLUSH_RESOURCES */
+
#define MAKE_TPM_CMD_ENTRY(cmd) \
U_BOOT_CMD_MKENT(cmd, 0, 1, do_tpm_ ## cmd, "", "")
@@ -701,6 +759,10 @@ static cmd_tbl_t tpm_commands[] = {
U_BOOT_CMD_MKENT(get_pub_key_oiap, 0, 1,
do_tpm_get_pub_key_oiap, "", ""),
#endif /* CONFIG_TPM_AUTH_SESSIONS */
+#ifdef CONFIG_TPM_FLUSH_RESOURCES
+ U_BOOT_CMD_MKENT(flush, 0, 1,
+ do_tpm_flush, "", ""),
+#endif /* CONFIG_TPM_FLUSH_RESOURCES */
};
static int do_tpm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
@@ -750,6 +812,14 @@ U_BOOT_CMD(tpm, CONFIG_SYS_MAXARGS, 1, do_tpm,
" get_capability cap_area sub_cap addr count\n"
" - Read <count> bytes of TPM capability indexed by <cap_area> and\n"
" <sub_cap> to memory address <addr>.\n"
+#ifdef CONFIG_TPM_FLUSH_RESOURCES
+"Resource management functions\n"
+" flush resource_type id\n"
+" - flushes a resource of type <resource_type> (may be one of key, auth,\n"
+" hash, trans, context, counter, delegate, daa_tpm, daa_v0, daa_v1),\n"
+" and id <id> from the TPM. Use an <id> of \"all\" to flush all\n"
+" resources of that type.\n"
+#endif /* CONFIG_TPM_FLUSH_RESOURCES */
#ifdef CONFIG_TPM_AUTH_SESSIONS
"Storage functions\n"
" loadkey2_oiap parent_handle key_addr key_len usage_auth\n"
diff --git a/cmd/zfs.c b/cmd/zfs.c
index 93067a9..3ed9912 100644
--- a/cmd/zfs.c
+++ b/cmd/zfs.c
@@ -24,7 +24,7 @@
#include <usb.h>
#endif
-#if !defined(CONFIG_DOS_PARTITION) && !defined(CONFIG_EFI_PARTITION)
+#if !CONFIG_IS_ENABLED(DOS_PARTITION) && !CONFIG_IS_ENABLED(EFI_PARTITION)
#error DOS or EFI partition support must be selected
#endif