summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/bcb.c4
-rw-r--r--cmd/bdinfo.c7
-rw-r--r--cmd/bind.c46
-rw-r--r--cmd/booti.c2
-rw-r--r--cmd/bootz.c2
-rw-r--r--cmd/efi.c2
-rw-r--r--cmd/efi_common.c2
-rw-r--r--cmd/elf.c2
-rw-r--r--cmd/flash.c2
-rw-r--r--cmd/gpt.c2
-rw-r--r--cmd/load.c7
-rw-r--r--cmd/mmc.c27
-rw-r--r--cmd/mvebu/bubt.c4
-rw-r--r--cmd/nvedit_efi.c2
-rw-r--r--cmd/sb.c6
-rw-r--r--cmd/x86/hob.c2
16 files changed, 66 insertions, 53 deletions
diff --git a/cmd/bcb.c b/cmd/bcb.c
index fe6d6cb2c38..97a96c00964 100644
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -172,8 +172,8 @@ static int __bcb_initialize(const char *iface, int devnum, const char *partp)
return CMD_RET_SUCCESS;
err_read_fail:
- printf("Error: %d %d:%s read failed (%d)\n", block->uclass_id,
- block->devnum, partition->name, ret);
+ printf("Error: %s %d:%s read failed (%d)\n", iface, devnum,
+ partition->name, ret);
__bcb_reset();
return CMD_RET_FAILURE;
}
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 437ac4e8630..f6e534dd5bb 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -154,18 +154,13 @@ static int bdinfo_print_all(struct bd_info *bd)
if (IS_ENABLED(CONFIG_CMD_NET))
print_eth();
bdinfo_print_num_l("fdt_blob", (ulong)map_to_sysmem(gd->fdt_blob));
- bdinfo_print_num_l("new_fdt", (ulong)map_to_sysmem(gd->new_fdt));
- bdinfo_print_num_l("fdt_size", (ulong)gd->fdt_size);
if (IS_ENABLED(CONFIG_VIDEO))
show_video_info();
#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
bdinfo_print_num_l("multi_dtb_fit", (ulong)gd->multi_dtb_fit);
#endif
if (IS_ENABLED(CONFIG_LMB) && gd->fdt_blob) {
- struct lmb lmb;
-
- lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
- lmb_dump_all_force(&lmb);
+ lmb_dump_all_force();
if (IS_ENABLED(CONFIG_OF_REAL))
printf("devicetree = %s\n", fdtdec_get_srcname());
}
diff --git a/cmd/bind.c b/cmd/bind.c
index 3a59eefd5c5..c0d31f5eb16 100644
--- a/cmd/bind.c
+++ b/cmd/bind.c
@@ -10,8 +10,8 @@
#include <dm/root.h>
#include <dm/uclass-internal.h>
-static int bind_by_class_index(const char *uclass, int index,
- const char *drv_name)
+static int bind_by_class_seq(const char *uclass, int seq,
+ const char *drv_name)
{
static enum uclass_id uclass_id;
struct udevice *dev;
@@ -31,9 +31,9 @@ static int bind_by_class_index(const char *uclass, int index,
return -EINVAL;
}
- ret = uclass_find_device(uclass_id, index, &parent);
+ ret = uclass_find_device_by_seq(uclass_id, seq, &parent);
if (!parent || ret) {
- printf("Cannot find device %d of class %s\n", index, uclass);
+ printf("Cannot find device %d of class %s\n", seq, uclass);
return ret;
}
@@ -47,7 +47,7 @@ static int bind_by_class_index(const char *uclass, int index,
return 0;
}
-static int find_dev(const char *uclass, int index, struct udevice **devp)
+static int find_dev(const char *uclass, int seq, struct udevice **devp)
{
static enum uclass_id uclass_id;
int rc;
@@ -58,21 +58,21 @@ static int find_dev(const char *uclass, int index, struct udevice **devp)
return -EINVAL;
}
- rc = uclass_find_device(uclass_id, index, devp);
+ rc = uclass_find_device_by_seq(uclass_id, seq, devp);
if (!*devp || rc) {
- printf("Cannot find device %d of class %s\n", index, uclass);
+ printf("Cannot find device %d of class %s\n", seq, uclass);
return rc;
}
return 0;
}
-static int unbind_by_class_index(const char *uclass, int index)
+static int unbind_by_class_seq(const char *uclass, int seq)
{
int ret;
struct udevice *dev;
- ret = find_dev(uclass, index, &dev);
+ ret = find_dev(uclass, seq, &dev);
if (ret)
return ret;
@@ -91,8 +91,8 @@ static int unbind_by_class_index(const char *uclass, int index)
return 0;
}
-static int unbind_child_by_class_index(const char *uclass, int index,
- const char *drv_name)
+static int unbind_child_by_class_seq(const char *uclass, int seq,
+ const char *drv_name)
{
struct udevice *parent;
int ret;
@@ -104,7 +104,7 @@ static int unbind_child_by_class_index(const char *uclass, int index,
return -ENOENT;
}
- ret = find_dev(uclass, index, &parent);
+ ret = find_dev(uclass, seq, &parent);
if (ret)
return ret;
@@ -217,19 +217,19 @@ static int do_bind_unbind(struct cmd_tbl *cmdtp, int flag, int argc,
return CMD_RET_USAGE;
ret = unbind_by_node_path(argv[1]);
} else if (!by_node && bind) {
- int index = (argc > 2) ? dectoul(argv[2], NULL) : 0;
+ int seq = (argc > 2) ? dectoul(argv[2], NULL) : 0;
if (argc != 4)
return CMD_RET_USAGE;
- ret = bind_by_class_index(argv[1], index, argv[3]);
+ ret = bind_by_class_seq(argv[1], seq, argv[3]);
} else if (!by_node && !bind) {
- int index = (argc > 2) ? dectoul(argv[2], NULL) : 0;
+ int seq = (argc > 2) ? dectoul(argv[2], NULL) : 0;
if (argc == 3)
- ret = unbind_by_class_index(argv[1], index);
+ ret = unbind_by_class_seq(argv[1], seq);
else if (argc == 4)
- ret = unbind_child_by_class_index(argv[1], index,
- argv[3]);
+ ret = unbind_child_by_class_seq(argv[1], seq,
+ argv[3]);
else
return CMD_RET_USAGE;
}
@@ -244,17 +244,17 @@ U_BOOT_CMD(
bind, 4, 0, do_bind_unbind,
"Bind a device to a driver",
"<node path> <driver>\n"
- "bind <class> <index> <driver>\n"
+ "bind <class> <seq> <driver>\n"
"Use 'dm tree' to list all devices registered in the driver model,\n"
- "their path, class, index and current driver.\n"
+ "their path, class, sequence and current driver.\n"
);
U_BOOT_CMD(
unbind, 4, 0, do_bind_unbind,
"Unbind a device from a driver",
"<node path>\n"
- "unbind <class> <index>\n"
- "unbind <class> <index> <driver>\n"
+ "unbind <class> <seq>\n"
+ "unbind <class> <seq> <driver>\n"
"Use 'dm tree' to list all devices registered in the driver model,\n"
- "their path, class, index and current driver.\n"
+ "their path, class, sequence and current driver.\n"
);
diff --git a/cmd/booti.c b/cmd/booti.c
index 62b19e83436..6018cbacf0a 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -87,7 +87,7 @@ static int booti_start(struct bootm_info *bmi)
images->os.start = relocated_addr;
images->os.end = relocated_addr + image_size;
- lmb_reserve(&images->lmb, images->ep, le32_to_cpu(image_size));
+ lmb_reserve(images->ep, le32_to_cpu(image_size));
/*
* Handle the BOOTM_STATE_FINDOTHER state ourselves as we do not
diff --git a/cmd/bootz.c b/cmd/bootz.c
index 55837a7599b..787203f5bd7 100644
--- a/cmd/bootz.c
+++ b/cmd/bootz.c
@@ -56,7 +56,7 @@ static int bootz_start(struct cmd_tbl *cmdtp, int flag, int argc,
if (ret != 0)
return 1;
- lmb_reserve(&images->lmb, images->ep, zi_end - zi_start);
+ lmb_reserve(images->ep, zi_end - zi_start);
/*
* Handle the BOOTM_STATE_FINDOTHER state ourselves as we do not
diff --git a/cmd/efi.c b/cmd/efi.c
index 6bed2d743ba..687ccb52042 100644
--- a/cmd/efi.c
+++ b/cmd/efi.c
@@ -11,7 +11,7 @@
#include <log.h>
#include <malloc.h>
#include <sort.h>
-#include <uuid.h>
+#include <u-boot/uuid.h>
#include <asm/global_data.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/cmd/efi_common.c b/cmd/efi_common.c
index c46764e6eea..d2f2b59e9e3 100644
--- a/cmd/efi_common.c
+++ b/cmd/efi_common.c
@@ -8,7 +8,7 @@
#include <efi.h>
#include <efi_api.h>
-#include <uuid.h>
+#include <u-boot/uuid.h>
void efi_show_tables(struct efi_system_table *systab)
{
diff --git a/cmd/elf.c b/cmd/elf.c
index 673c6c30511..f07e344a596 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -70,7 +70,7 @@ int do_bootelf(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
fdt_set_totalsize((void *)fdt_addr,
fdt_totalsize(fdt_addr) + CONFIG_SYS_FDT_PAD);
- if (image_setup_libfdt(&img, (void *)fdt_addr, NULL))
+ if (image_setup_libfdt(&img, (void *)fdt_addr, false))
return 1;
}
#endif
diff --git a/cmd/flash.c b/cmd/flash.c
index de0e04f09cf..fd660ec477c 100644
--- a/cmd/flash.c
+++ b/cmd/flash.c
@@ -10,7 +10,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
-#include <uuid.h>
+#include <u-boot/uuid.h>
#if defined(CONFIG_CMD_MTDPARTS)
#include <jffs2/jffs2.h>
diff --git a/cmd/gpt.c b/cmd/gpt.c
index 86b7701886a..27aea2df197 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -19,7 +19,7 @@
#include <part_efi.h>
#include <part.h>
#include <exports.h>
-#include <uuid.h>
+#include <u-boot/uuid.h>
#include <linux/ctype.h>
#include <div64.h>
#include <memalign.h>
diff --git a/cmd/load.c b/cmd/load.c
index d773a25d70c..20d802502ae 100644
--- a/cmd/load.c
+++ b/cmd/load.c
@@ -141,7 +141,6 @@ static int do_load_serial(struct cmd_tbl *cmdtp, int flag, int argc,
static ulong load_serial(long offset)
{
- struct lmb lmb;
char record[SREC_MAXRECLEN + 1]; /* buffer for one S-Record */
char binbuf[SREC_MAXBINLEN]; /* buffer for binary data */
int binlen; /* no. of data bytes in S-Rec. */
@@ -154,8 +153,6 @@ static ulong load_serial(long offset)
int line_count = 0;
long ret;
- lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
-
while (read_record(record, SREC_MAXRECLEN + 1) >= 0) {
type = srec_decode(record, &binlen, &addr, binbuf);
@@ -182,7 +179,7 @@ static ulong load_serial(long offset)
{
void *dst;
- ret = lmb_reserve(&lmb, store_addr, binlen);
+ ret = lmb_reserve(store_addr, binlen);
if (ret) {
printf("\nCannot overwrite reserved area (%08lx..%08lx)\n",
store_addr, store_addr + binlen);
@@ -191,7 +188,7 @@ static ulong load_serial(long offset)
dst = map_sysmem(store_addr, binlen);
memcpy(dst, binbuf, binlen);
unmap_sysmem(dst);
- lmb_free(&lmb, store_addr, binlen);
+ lmb_free(store_addr, binlen);
}
if ((store_addr) < start_addr)
start_addr = store_addr;
diff --git a/cmd/mmc.c b/cmd/mmc.c
index ff7b8e555ba..9a841c25d3d 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -14,6 +14,7 @@
#include <sparse_format.h>
#include <image-sparse.h>
#include <vsprintf.h>
+#include <linux/ctype.h>
static int curr_device = -1;
@@ -918,8 +919,9 @@ static int mmc_partconf_print(struct mmc *mmc, const char *varname)
printf("EXT_CSD[179], PARTITION_CONFIG:\n"
"BOOT_ACK: 0x%x\n"
- "BOOT_PARTITION_ENABLE: 0x%x\n"
- "PARTITION_ACCESS: 0x%x\n", ack, part, access);
+ "BOOT_PARTITION_ENABLE: 0x%x (%s)\n"
+ "PARTITION_ACCESS: 0x%x (%s)\n", ack, part, emmc_boot_part_names[part],
+ access, emmc_hwpart_names[access]);
return CMD_RET_SUCCESS;
}
@@ -948,9 +950,26 @@ static int do_mmc_partconf(struct cmd_tbl *cmdtp, int flag,
if (argc == 2 || argc == 3)
return mmc_partconf_print(mmc, cmd_arg2(argc, argv));
+ /* BOOT_ACK */
ack = dectoul(argv[2], NULL);
- part_num = dectoul(argv[3], NULL);
- access = dectoul(argv[4], NULL);
+ /* BOOT_PARTITION_ENABLE */
+ if (!isdigit(*argv[3])) {
+ for (part_num = ARRAY_SIZE(emmc_boot_part_names) - 1; part_num > 0; part_num--) {
+ if (!strcmp(argv[3], emmc_boot_part_names[part_num]))
+ break;
+ }
+ } else {
+ part_num = dectoul(argv[3], NULL);
+ }
+ /* PARTITION_ACCESS */
+ if (!isdigit(*argv[4])) {
+ for (access = ARRAY_SIZE(emmc_hwpart_names) - 1; access > 0; access--) {
+ if (!strcmp(argv[4], emmc_hwpart_names[access]))
+ break;
+ }
+ } else {
+ access = dectoul(argv[4], NULL);
+ }
/* acknowledge to be sent during boot operation */
ret = mmc_set_part_conf(mmc, ack, part_num, access);
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index e3f21dd0d81..5e4ffc40d72 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -223,8 +223,8 @@ static int mmc_burn_image(size_t image_size)
#endif
part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
- if (part == 7)
- part = 0;
+ if (part == EMMC_BOOT_PART_USER)
+ part = EMMC_HWPART_DEFAULT;
#ifdef CONFIG_BLK
err = blk_dselect_hwpart(blk_desc, part);
diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c
index 64ae2ad2ce2..32b7d049074 100644
--- a/cmd/nvedit_efi.c
+++ b/cmd/nvedit_efi.c
@@ -15,7 +15,7 @@
#include <malloc.h>
#include <mapmem.h>
#include <rtc.h>
-#include <uuid.h>
+#include <u-boot/uuid.h>
#include <linux/kernel.h>
/*
diff --git a/cmd/sb.c b/cmd/sb.c
index 1aa5921f03e..db485fddfca 100644
--- a/cmd/sb.c
+++ b/cmd/sb.c
@@ -14,8 +14,10 @@ static int do_sb_handoff(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
#if CONFIG_IS_ENABLED(HANDOFF)
- if (gd->spl_handoff)
- printf("SPL handoff magic %lx\n", gd->spl_handoff->arch.magic);
+ struct spl_handoff *handoff = handoff_get();
+
+ if (handoff)
+ printf("SPL handoff magic %lx\n", handoff->arch.magic);
else
printf("SPL handoff info not received\n");
diff --git a/cmd/x86/hob.c b/cmd/x86/hob.c
index 2dd30808bd1..d3713cef331 100644
--- a/cmd/x86/hob.c
+++ b/cmd/x86/hob.c
@@ -5,7 +5,7 @@
#include <command.h>
#include <efi.h>
-#include <uuid.h>
+#include <u-boot/uuid.h>
#include <asm/global_data.h>
#include <asm/hob.h>
#include <asm/fsp/fsp_hob.h>