aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-09-16 10:29:40 -0400
committerTom Rini <trini@konsulko.com>2021-09-16 10:29:40 -0400
commit6674edaabfd271471608146806f5b6540bc76a1b (patch)
tree574f8b5265002ad046aa1b81725a9483feb48a8d /cmd
parent4f8bf67f9c7fec8c5c1ae57c6ba24d337a19c578 (diff)
parentbb92678ced0b1594b93ab2f10b2c17750c789c96 (diff)
downloadu-boot-6674edaabfd271471608146806f5b6540bc76a1b.zip
u-boot-6674edaabfd271471608146806f5b6540bc76a1b.tar.gz
u-boot-6674edaabfd271471608146806f5b6540bc76a1b.tar.bz2
Merge tag 'v2021.10-rc4' into next
Prepare v2021.10-rc4 Signed-off-by: Tom Rini <trini@konsulko.com> # gpg: Signature made Tue 14 Sep 2021 06:58:32 PM EDT # gpg: using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C # gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate] # Conflicts: # board/Arcturus/ucp1020/spl.c # cmd/mvebu/Kconfig # common/Kconfig.boot # common/image-fit.c # configs/UCP1020_defconfig # configs/sifive_unmatched_defconfig # drivers/pci/Kconfig # include/configs/UCP1020.h # include/configs/sifive-unmatched.h # lib/Makefile # scripts/config_whitelist.txt
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig10
-rw-r--r--cmd/mmc.c52
-rw-r--r--cmd/mvebu/Kconfig1
-rw-r--r--cmd/nvedit_efi.c9
4 files changed, 59 insertions, 13 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index d8fc5a1..5b30b13 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2411,4 +2411,14 @@ config CMD_UBIFS
help
UBIFS is a file system for flash devices which works on top of UBI.
+config MMC_SPEED_MODE_SET
+ bool "set speed mode using mmc command"
+ depends on CMD_MMC
+ default n
+ help
+ Enable setting speed mode using mmc rescan and mmc dev commands.
+ The speed mode is provided as the last argument in these commands
+ and is indicated using the index from enum bus_mode in
+ include/mmc.h. A speed mode can be set only if it has already
+ been enabled in the device tree.
endmenu
diff --git a/cmd/mmc.c b/cmd/mmc.c
index c67ad76..f1e30d0 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -120,7 +120,9 @@ static void print_mmcinfo(struct mmc *mmc)
}
}
}
-static struct mmc *init_mmc_device(int dev, bool force_init)
+
+static struct mmc *__init_mmc_device(int dev, bool force_init,
+ enum bus_mode speed_mode)
{
struct mmc *mmc;
mmc = find_mmc_device(dev);
@@ -134,6 +136,10 @@ static struct mmc *init_mmc_device(int dev, bool force_init)
if (force_init)
mmc->has_init = 0;
+
+ if (IS_ENABLED(CONFIG_MMC_SPEED_MODE_SET))
+ mmc->user_speed_mode = speed_mode;
+
if (mmc_init(mmc))
return NULL;
@@ -145,6 +151,11 @@ static struct mmc *init_mmc_device(int dev, bool force_init)
return mmc;
}
+static struct mmc *init_mmc_device(int dev, bool force_init)
+{
+ return __init_mmc_device(dev, force_init, MMC_MODES_END);
+}
+
static int do_mmcinfo(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
@@ -482,8 +493,17 @@ static int do_mmc_rescan(struct cmd_tbl *cmdtp, int flag,
int argc, char *const argv[])
{
struct mmc *mmc;
+ enum bus_mode speed_mode = MMC_MODES_END;
+
+ if (argc == 1) {
+ mmc = init_mmc_device(curr_device, true);
+ } else if (argc == 2) {
+ speed_mode = (int)dectoul(argv[1], NULL);
+ mmc = __init_mmc_device(curr_device, true, speed_mode);
+ } else {
+ return CMD_RET_USAGE;
+ }
- mmc = init_mmc_device(curr_device, true);
if (!mmc)
return CMD_RET_FAILURE;
@@ -515,11 +535,14 @@ static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag,
{
int dev, part = 0, ret;
struct mmc *mmc;
+ enum bus_mode speed_mode = MMC_MODES_END;
if (argc == 1) {
dev = curr_device;
+ mmc = init_mmc_device(dev, true);
} else if (argc == 2) {
- dev = dectoul(argv[1], NULL);
+ dev = (int)dectoul(argv[1], NULL);
+ mmc = init_mmc_device(dev, true);
} else if (argc == 3) {
dev = (int)dectoul(argv[1], NULL);
part = (int)dectoul(argv[2], NULL);
@@ -528,11 +551,21 @@ static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag,
PART_ACCESS_MASK);
return CMD_RET_FAILURE;
}
+ mmc = init_mmc_device(dev, true);
+ } else if (argc == 4) {
+ dev = (int)dectoul(argv[1], NULL);
+ part = (int)dectoul(argv[2], NULL);
+ if (part > PART_ACCESS_MASK) {
+ printf("#part_num shouldn't be larger than %d\n",
+ PART_ACCESS_MASK);
+ return CMD_RET_FAILURE;
+ }
+ speed_mode = (int)dectoul(argv[3], NULL);
+ mmc = __init_mmc_device(dev, true, speed_mode);
} else {
return CMD_RET_USAGE;
}
- mmc = init_mmc_device(dev, true);
if (!mmc)
return CMD_RET_FAILURE;
@@ -983,9 +1016,9 @@ static struct cmd_tbl cmd_mmc[] = {
#if CONFIG_IS_ENABLED(CMD_MMC_SWRITE)
U_BOOT_CMD_MKENT(swrite, 3, 0, do_mmc_sparse_write, "", ""),
#endif
- U_BOOT_CMD_MKENT(rescan, 1, 1, do_mmc_rescan, "", ""),
+ U_BOOT_CMD_MKENT(rescan, 2, 1, do_mmc_rescan, "", ""),
U_BOOT_CMD_MKENT(part, 1, 1, do_mmc_part, "", ""),
- U_BOOT_CMD_MKENT(dev, 3, 0, do_mmc_dev, "", ""),
+ U_BOOT_CMD_MKENT(dev, 4, 0, do_mmc_dev, "", ""),
U_BOOT_CMD_MKENT(list, 1, 1, do_mmc_list, "", ""),
#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
U_BOOT_CMD_MKENT(hwpartition, 28, 0, do_mmc_hwpartition, "", ""),
@@ -1042,9 +1075,12 @@ U_BOOT_CMD(
"mmc swrite addr blk#\n"
#endif
"mmc erase blk# cnt\n"
- "mmc rescan\n"
+ "mmc rescan [mode]\n"
"mmc part - lists available partition on current mmc device\n"
- "mmc dev [dev] [part] - show or set current mmc device [partition]\n"
+ "mmc dev [dev] [part] [mode] - show or set current mmc device [partition] and set mode\n"
+ " - the required speed mode is passed as the index from the following list\n"
+ " [MMC_LEGACY, MMC_HS, SD_HS, MMC_HS_52, MMC_DDR_52, UHS_SDR12, UHS_SDR25,\n"
+ " UHS_SDR50, UHS_DDR50, UHS_SDR104, MMC_HS_200, MMC_HS_400, MMC_HS_400_ES]\n"
"mmc list - lists available devices\n"
"mmc wp - power on write protect boot partitions\n"
#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
diff --git a/cmd/mvebu/Kconfig b/cmd/mvebu/Kconfig
index 4afe0bf..ac8b0af 100644
--- a/cmd/mvebu/Kconfig
+++ b/cmd/mvebu/Kconfig
@@ -3,6 +3,7 @@ depends on ARCH_MVEBU
config CMD_MVEBU_BUBT
bool "bubt"
+ select SHA256 if ARMADA_3700
help
bubt - Burn a u-boot image to flash
For details about bubt command please see the documentation
diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c
index 676bbda..710d923 100644
--- a/cmd/nvedit_efi.c
+++ b/cmd/nvedit_efi.c
@@ -187,8 +187,8 @@ static int efi_dump_var_all(int argc, char *const argv[],
var_name16[0] = 0;
for (;;) {
size = buf_size;
- ret = EFI_CALL(efi_get_next_variable_name(&size, var_name16,
- &guid));
+ ret = efi_get_next_variable_name_int(&size, var_name16,
+ &guid);
if (ret == EFI_NOT_FOUND)
break;
if (ret == EFI_BUFFER_TOO_SMALL) {
@@ -199,9 +199,8 @@ static int efi_dump_var_all(int argc, char *const argv[],
return CMD_RET_FAILURE;
}
var_name16 = p;
- ret = EFI_CALL(efi_get_next_variable_name(&size,
- var_name16,
- &guid));
+ ret = efi_get_next_variable_name_int(&size, var_name16,
+ &guid);
}
if (ret != EFI_SUCCESS) {
free(var_name16);