diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/Kconfig | 23 | ||||
-rw-r--r-- | cmd/mtdparts.c | 2 | ||||
-rw-r--r-- | cmd/net.c | 6 | ||||
-rw-r--r-- | cmd/tpm-common.c | 24 | ||||
-rw-r--r-- | cmd/tpm-v1.c | 2 | ||||
-rw-r--r-- | cmd/tpm-v2.c | 4 | ||||
-rw-r--r-- | cmd/ubi.c | 2 |
7 files changed, 46 insertions, 17 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index c5a7a3c334..ef43ed8dda 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -152,8 +152,8 @@ config CMD_BDI config CMD_CONFIG bool "config" - select BUILD_BIN2C default SANDBOX + select BUILD_BIN2C help Print ".config" contents. @@ -429,8 +429,8 @@ config CMD_BINOP config CMD_CRC32 bool "crc32" - select HASH default y + select HASH help Compute CRC32. @@ -640,7 +640,6 @@ config CMD_DFU config CMD_DM bool "dm - Access to driver model information" depends on DM - default y help Provides access to driver model data structures and information, such as a list of devices, list of uclasses and the state of each @@ -737,9 +736,9 @@ config CMD_GPIO config CMD_GPT bool "GPT (GUID Partition Table) command" - select PARTITION_UUIDS select EFI_PARTITION select HAVE_BLOCK_DEVICE + select PARTITION_UUIDS imply RANDOM_UUID help Enable the 'gpt' command to ready and write GPT style partition @@ -899,8 +898,8 @@ config CMD_ONENAND config CMD_PART bool "part" - select PARTITION_UUIDS select HAVE_BLOCK_DEVICE + select PARTITION_UUIDS help Read and display information about the partition table on various media. @@ -1012,11 +1011,12 @@ config CMD_USB_SDP help Enables the command "sdp" which is used to have U-Boot emulating the Serial Download Protocol (SDP) via USB. + config CMD_ROCKUSB bool "rockusb" depends on USB_FUNCTION_ROCKUSB help - Rockusb protocol is widely used by Rockchip SoC based devices. It can + Rockusb protocol is widely used by Rockchip SoC based devices. It can read/write info, image to/from devices. This enable rockusb command support to communication with rockusb device. for more detail about this command, please read doc/README.rockusb. @@ -1489,7 +1489,7 @@ config CMD_BLOB the original data. Sub-commands: - blob enc - encapsulating data as a cryptgraphic blob + blob enc - encapsulating data as a cryptgraphic blob blob dec - decapsulating cryptgraphic blob to get the data Syntax: @@ -1544,6 +1544,7 @@ config CMD_TPM_V1 config CMD_TPM_V2 bool + select CMD_LOG config CMD_TPM bool "Enable the 'tpm' command" @@ -1779,7 +1780,7 @@ config CMD_TRACE config CMD_AVB bool "avb - Android Verified Boot 2.0 operations" - depends on LIBAVB + depends on AVB_VERIFY default n help Enables a "avb" command to perform verification of partitions using @@ -1797,10 +1798,10 @@ endmenu config CMD_UBI tristate "Enable UBI - Unsorted block images commands" + default y if NAND_SUNXI + select CMD_MTDPARTS select CRC32 select MTD_UBI - select CMD_MTDPARTS - default y if NAND_SUNXI help UBI is a software layer above MTD layer which admits use of LVM-like logical volumes on top of MTD devices, hides some complexities of @@ -1812,9 +1813,9 @@ config CMD_UBI config CMD_UBIFS tristate "Enable UBIFS - Unsorted block images filesystem commands" depends on CMD_UBI + default y if CMD_UBI select CRC32 select LZO - default y if CMD_UBI help UBIFS is a file system for flash devices which works on top of UBI. diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index c401009133..0da3afd75f 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -690,7 +690,7 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i part->auto_name = 0; } else { /* auto generated name in form of size@offset */ - sprintf(part->name, "0x%08llx@0x%08llx", size, offset); + snprintf(part->name, name_len, "0x%08llx@0x%08llx", size, offset); part->auto_name = 1; } @@ -192,6 +192,9 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, switch (argc) { case 1: + /* refresh bootfile name from env */ + copy_filename(net_boot_file_name, env_get("bootfile"), + sizeof(net_boot_file_name)); break; case 2: /* @@ -203,6 +206,9 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, addr = simple_strtoul(argv[1], &end, 16); if (end == (argv[1] + strlen(argv[1]))) { load_addr = addr; + /* refresh bootfile name from env */ + copy_filename(net_boot_file_name, env_get("bootfile"), + sizeof(net_boot_file_name)); } else { net_boot_file_name_explicit = true; copy_filename(net_boot_file_name, argv[1], diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c index 6cf9fcc9ac..56443862c2 100644 --- a/cmd/tpm-common.c +++ b/cmd/tpm-common.c @@ -273,12 +273,34 @@ int do_tpm_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int do_tpm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *tpm_commands, *cmd; + struct tpm_chip_priv *priv; + struct udevice *dev; unsigned int size; + int ret; if (argc < 2) return CMD_RET_USAGE; - tpm_commands = get_tpm_commands(&size); + ret = get_tpm(&dev); + if (ret) + return ret; + + priv = dev_get_uclass_priv(dev); + + /* Below getters return NULL if the desired stack is not built */ + switch (priv->version) { + case TPM_V1: + tpm_commands = get_tpm1_commands(&size); + break; + case TPM_V2: + tpm_commands = get_tpm2_commands(&size); + break; + default: + tpm_commands = NULL; + } + + if (!tpm_commands) + return CMD_RET_USAGE; cmd = find_cmd_tbl(argv[1], tpm_commands, size); if (!cmd) diff --git a/cmd/tpm-v1.c b/cmd/tpm-v1.c index 0874c4d7ba..69870002d4 100644 --- a/cmd/tpm-v1.c +++ b/cmd/tpm-v1.c @@ -608,7 +608,7 @@ static cmd_tbl_t tpm1_commands[] = { #endif /* CONFIG_TPM_LIST_RESOURCES */ }; -cmd_tbl_t *get_tpm_commands(unsigned int *size) +cmd_tbl_t *get_tpm1_commands(unsigned int *size) { *size = ARRAY_SIZE(tpm1_commands); diff --git a/cmd/tpm-v2.c b/cmd/tpm-v2.c index 38add4f462..ffbf35a75c 100644 --- a/cmd/tpm-v2.c +++ b/cmd/tpm-v2.c @@ -319,14 +319,14 @@ static cmd_tbl_t tpm2_commands[] = { do_tpm_pcr_setauthvalue, "", ""), }; -cmd_tbl_t *get_tpm_commands(unsigned int *size) +cmd_tbl_t *get_tpm2_commands(unsigned int *size) { *size = ARRAY_SIZE(tpm2_commands); return tpm2_commands; } -U_BOOT_CMD(tpm, CONFIG_SYS_MAXARGS, 1, do_tpm, "Issue a TPMv2.x command", +U_BOOT_CMD(tpm2, CONFIG_SYS_MAXARGS, 1, do_tpm, "Issue a TPMv2.x command", "<command> [<arguments>]\n" "\n" "info\n" @@ -356,7 +356,7 @@ int ubi_volume_read(char *volume, char *buf, size_t size) size = vol->used_bytes; } - printf("Read %u bytes from volume %s to %p\n", size, volume, buf); + printf("Read %zu bytes from volume %s to %p\n", size, volume, buf); if (vol->corrupted) printf("read from corrupted volume %d", vol->vol_id); |