diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/Kconfig | 29 | ||||
-rw-r--r-- | cmd/adc.c | 4 | ||||
-rw-r--r-- | cmd/arm/exception.c | 5 | ||||
-rw-r--r-- | cmd/arm/exception64.c | 5 | ||||
-rw-r--r-- | cmd/blob.c | 4 | ||||
-rw-r--r-- | cmd/cache.c | 18 | ||||
-rw-r--r-- | cmd/cli.c | 9 | ||||
-rw-r--r-- | cmd/fwu_mdata.c | 1 | ||||
-rw-r--r-- | cmd/gpt.c | 3 | ||||
-rw-r--r-- | cmd/kaslrseed.c | 51 | ||||
-rw-r--r-- | cmd/riscv/exception.c | 5 | ||||
-rw-r--r-- | cmd/scmi.c | 5 | ||||
-rw-r--r-- | cmd/sound.c | 2 | ||||
-rw-r--r-- | cmd/ubi.c | 21 | ||||
-rw-r--r-- | cmd/unlz4.c | 4 | ||||
-rw-r--r-- | cmd/usb.c | 3 | ||||
-rw-r--r-- | cmd/x86/exception.c | 5 | ||||
-rw-r--r-- | cmd/x86/zboot.c | 23 |
18 files changed, 82 insertions, 115 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index a2dee346891..0cf0d8ad8ab 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -271,7 +271,7 @@ config CMD_BOOTM_PRE_LOAD depends on CMD_BOOTM depends on IMAGE_PRE_LOAD help - Enable support of stage pre-load for the bootm command. + Enable support of stage pre-load for the bootm command. This stage allow to check or modify the image provided to the bootm command. @@ -321,6 +321,13 @@ config BOOTM_EFI help Support booting UEFI FIT images via the bootm command. +config BOOTM_ELF + bool "Support booting ELF images" + depends on CMD_BOOTM && LIB_ELF + default n + help + Support booting ELF images via the bootm command. + config CMD_BOOTZ bool "bootz" help @@ -622,7 +629,7 @@ config CMD_ZBOOT Consider using FIT in preference to this since it supports directly booting both 32- and 64-bit kernels, as well as secure boot. - Documentation is available in doc/uImage.FIT/x86-fit-boot.txt + Documentation is available in doc/usage/fit/x86-fit-boot.rst. endmenu @@ -905,9 +912,9 @@ config CMD_MX_CYCLIC bool "Enable cyclic md/mw commands" depends on CMD_MEMORY help - Add the "mdc" and "mwc" memory commands. These are cyclic - "md/mw" commands. - Examples: + Add the "mdc" and "mwc" memory commands. These are cyclic + "md/mw" commands. + Examples: => mdc.b 10 4 500 This command will print 4 bytes (10,11,12,13) each 500 ms. @@ -2161,12 +2168,12 @@ config CMD_BLKMAP Example use-cases: - Treat a region of RAM as a block device, i.e. a RAM disk. This let's - you extract files from filesystem images stored in RAM (perhaps as a - result of a TFTP transfer). + you extract files from filesystem images stored in RAM (perhaps as a + result of a TFTP transfer). - Create a virtual partition on an existing device. This let's you - access filesystems that aren't stored at an exact partition - boundary. A common example is a filesystem image embedded in an FIT - image. + access filesystems that aren't stored at an exact partition + boundary. A common example is a filesystem image embedded in an FIT + image. config CMD_BUTTON bool "button" @@ -2945,7 +2952,7 @@ config CMD_UBI_RENAME bool "Enable rename" depends on CMD_UBI help - Enable a "ubi" command to rename ubi volume: + Enable a "ubi" command to rename ubi volume: ubi rename <oldname> <newname> config CMD_UBIFS diff --git a/cmd/adc.c b/cmd/adc.c index f87f9785a11..4d3b5b61f6f 100644 --- a/cmd/adc.c +++ b/cmd/adc.c @@ -152,11 +152,11 @@ static int do_adc_scan(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } -static char adc_help_text[] = +U_BOOT_LONGHELP(adc, "list - list ADC devices\n" "adc info <name> - Get ADC device info\n" "adc single <name> <channel> [varname] - Get Single data of ADC device channel\n" - "adc scan <name> [channel mask] - Scan all [or masked] ADC channels"; + "adc scan <name> [channel mask] - Scan all [or masked] ADC channels\n"); U_BOOT_CMD_WITH_SUBCMDS(adc, "ADC sub-system", adc_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_adc_list), diff --git a/cmd/arm/exception.c b/cmd/arm/exception.c index 98a9795b68c..8857f121604 100644 --- a/cmd/arm/exception.c +++ b/cmd/arm/exception.c @@ -49,12 +49,11 @@ static struct cmd_tbl cmd_sub[] = { "", ""), }; -static char exception_help_text[] = +U_BOOT_LONGHELP(exception, "<ex>\n" " The following exceptions are available:\n" " breakpoint - prefetch abort\n" " unaligned - data abort\n" - " undefined - undefined instruction\n" - ; + " undefined - undefined instruction\n"); #include <exception.h> diff --git a/cmd/arm/exception64.c b/cmd/arm/exception64.c index 73d6c20ccac..4c5b953168c 100644 --- a/cmd/arm/exception64.c +++ b/cmd/arm/exception64.c @@ -77,12 +77,11 @@ static struct cmd_tbl cmd_sub[] = { "", ""), }; -static char exception_help_text[] = +U_BOOT_LONGHELP(exception, "<ex>\n" " The following exceptions are available:\n" " breakpoint - breakpoint instruction exception\n" " unaligned - unaligned LDAR data abort\n" - " undefined - undefined instruction exception\n" - ; + " undefined - undefined instruction exception\n"); #include <exception.h> diff --git a/cmd/blob.c b/cmd/blob.c index a3c1dc49224..b1c72e3f440 100644 --- a/cmd/blob.c +++ b/cmd/blob.c @@ -99,7 +99,7 @@ static int do_blob(struct cmd_tbl *cmdtp, int flag, int argc, } /***************************************************/ -static char blob_help_text[] = +U_BOOT_LONGHELP(blob, "enc src dst len km - Encapsulate and create blob of data\n" " $len bytes long at address $src and\n" " store the result at address $dst.\n" @@ -115,7 +115,7 @@ static char blob_help_text[] = " modifier is stored.\n" " The modifier is required for generation\n" " /use as key for cryptographic operation.\n" - " Key modifier should be 16 byte long.\n"; + " Key modifier should be 16 byte long.\n"); U_BOOT_CMD( blob, 6, 1, do_blob, diff --git a/cmd/cache.c b/cmd/cache.c index 0254ff17f9b..7a2068296ef 100644 --- a/cmd/cache.c +++ b/cmd/cache.c @@ -13,16 +13,6 @@ static int parse_argv(const char *); -void __weak invalidate_icache_all(void) -{ - /* please define arch specific invalidate_icache_all */ - puts("No arch specific invalidate_icache_all available!\n"); -} - -__weak void noncached_set_region(void) -{ -} - static int do_icache(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -52,12 +42,6 @@ static int do_icache(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -void __weak flush_dcache_all(void) -{ - puts("No arch specific flush_dcache_all available!\n"); - /* please define arch specific flush_dcache_all */ -} - static int do_dcache(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -69,7 +53,9 @@ static int do_dcache(struct cmd_tbl *cmdtp, int flag, int argc, break; case 1: dcache_enable(); +#ifdef CONFIG_SYS_NONCACHED_MEMORY noncached_set_region(); +#endif break; case 2: flush_dcache_all(); diff --git a/cmd/cli.c b/cmd/cli.c index be3bf7dfe20..e0ddd0a43d0 100644 --- a/cmd/cli.c +++ b/cmd/cli.c @@ -118,16 +118,11 @@ static int do_cli(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; } -#if CONFIG_IS_ENABLED(SYS_LONGHELP) -static char cli_help_text[] = +U_BOOT_LONGHELP(cli, "get - print current cli\n" - "set - set the current cli, possible value are: old, modern" - ; -#endif + "set - set the current cli, possible value are: old, modern\n"); U_BOOT_CMD(cli, 3, 1, do_cli, "cli", -#if CONFIG_IS_ENABLED(SYS_LONGHELP) cli_help_text -#endif ); diff --git a/cmd/fwu_mdata.c b/cmd/fwu_mdata.c index 3c8be576ac7..9c048d69a13 100644 --- a/cmd/fwu_mdata.c +++ b/cmd/fwu_mdata.c @@ -22,6 +22,7 @@ static void print_mdata(struct fwu_data *data) printf("\tFWU Metadata\n"); printf("crc32: %#x\n", data->crc32); printf("version: %#x\n", data->version); + printf("size: %#x\n", data->metadata_size); printf("active_index: %#x\n", data->active_index); printf("previous_active_index: %#x\n", data->previous_active_index); diff --git a/cmd/gpt.c b/cmd/gpt.c index 36b112d5978..aeabd19dd76 100644 --- a/cmd/gpt.c +++ b/cmd/gpt.c @@ -682,7 +682,8 @@ static int gpt_verify(struct blk_desc *blk_dev_desc, const char *str_part) free(str_disk_guid); free(partitions); out: - free(gpt_pte); + if (!ret) + free(gpt_pte); return ret; } diff --git a/cmd/kaslrseed.c b/cmd/kaslrseed.c index e0d3c7fe748..2ad983a11f9 100644 --- a/cmd/kaslrseed.c +++ b/cmd/kaslrseed.c @@ -15,60 +15,25 @@ static int do_kaslr_seed(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - size_t n = 0x8; - struct udevice *dev; - u64 *buf; - int nodeoffset; - int ret = CMD_RET_SUCCESS; + int err = CMD_RET_SUCCESS; - if (uclass_get_device(UCLASS_RNG, 0, &dev) || !dev) { - printf("No RNG device\n"); - return CMD_RET_FAILURE; - } - - buf = malloc(n); - if (!buf) { - printf("Out of memory\n"); - return CMD_RET_FAILURE; - } - - if (dm_rng_read(dev, buf, n)) { - printf("Reading RNG failed\n"); - return CMD_RET_FAILURE; - } + printf("Notice: a /chosen/kaslr-seed is automatically added to the device-tree when booted via booti/bootm/bootz therefore using this command is likely no longer needed\n"); if (!working_fdt) { printf("No FDT memory address configured. Please configure\n" "the FDT address via \"fdt addr <address>\" command.\n" "Aborting!\n"); - return CMD_RET_FAILURE; - } - - ret = fdt_check_header(working_fdt); - if (ret < 0) { - printf("fdt_chosen: %s\n", fdt_strerror(ret)); - return CMD_RET_FAILURE; - } - - nodeoffset = fdt_find_or_add_subnode(working_fdt, 0, "chosen"); - if (nodeoffset < 0) { - printf("Reading chosen node failed\n"); - return CMD_RET_FAILURE; + err = CMD_RET_FAILURE; + } else { + if (fdt_kaslrseed(working_fdt, true) < 0) + err = CMD_RET_FAILURE; } - ret = fdt_setprop(working_fdt, nodeoffset, "kaslr-seed", buf, sizeof(buf)); - if (ret < 0) { - printf("Unable to set kaslr-seed on chosen node: %s\n", fdt_strerror(ret)); - return CMD_RET_FAILURE; - } - - free(buf); - - return ret; + return cmd_process_error(cmdtp, err); } U_BOOT_LONGHELP(kaslrseed, - "[n]\n" + "\n" " - append random bytes to chosen kaslr-seed node\n"); U_BOOT_CMD( diff --git a/cmd/riscv/exception.c b/cmd/riscv/exception.c index 14ad6c440a5..2b58b1c449c 100644 --- a/cmd/riscv/exception.c +++ b/cmd/riscv/exception.c @@ -68,14 +68,13 @@ static struct cmd_tbl cmd_sub[] = { "", ""), }; -static char exception_help_text[] = +U_BOOT_LONGHELP(exception, "<ex>\n" " The following exceptions are available:\n" " compressed - compressed instruction\n" " ebreak - breakpoint\n" " ialign16 - 16 bit aligned instruction\n" " undefined - illegal instruction\n" - " unaligned - load address misaligned\n" - ; + " unaligned - load address misaligned\n"); #include <exception.h> diff --git a/cmd/scmi.c b/cmd/scmi.c index 664062c4eff..cfbca63e164 100644 --- a/cmd/scmi.c +++ b/cmd/scmi.c @@ -369,7 +369,7 @@ static int do_scmi(struct cmd_tbl *cmdtp, int flag, return cp->cmd(cmdtp, flag, argc, argv); } -static char scmi_help_text[] = +U_BOOT_LONGHELP(scmi, " - SCMI utility\n" " info - get the info of SCMI services\n" " perm_dev <agent-id in hex> <device-id in hex> <flags in hex>\n" @@ -377,8 +377,7 @@ static char scmi_help_text[] = " perm_proto <agent-id in hex> <device-id in hex> <protocol-id in hex> <flags in hex>\n" " - set protocol permission to device\n" " reset <agent-id in hex> <flags in hex>\n" - " - reset platform resource settings\n" - ""; + " - reset platform resource settings\n"); U_BOOT_CMD(scmi, CONFIG_SYS_MAXARGS, 0, do_scmi, "SCMI utility", scmi_help_text); diff --git a/cmd/sound.c b/cmd/sound.c index 08bf74112f1..8f67cbd96e1 100644 --- a/cmd/sound.c +++ b/cmd/sound.c @@ -98,7 +98,7 @@ U_BOOT_CMD( sound, INT_MAX, 1, do_sound, "sound sub-system", "init - initialise the sound driver\n" - "sound play [[[-q|-s] len [freq]] ...] - play sounds\n" + "sound play [len [freq [len [freq ...]]]] - play sounds\n" " len - duration in ms\n" " freq - frequency in Hz\n" ); diff --git a/cmd/ubi.c b/cmd/ubi.c index 8c1b5df0572..92998af2b02 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -248,7 +248,7 @@ static int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id, static struct ubi_volume *ubi_find_volume(char *volume) { - struct ubi_volume *vol = NULL; + struct ubi_volume *vol; int i; for (i = 0; i < ubi->vtbl_slots; i++) { @@ -355,13 +355,18 @@ static int ubi_rename_vol(char *oldname, char *newname) static int ubi_volume_continue_write(char *volume, void *buf, size_t size) { - int err = 1; + int err; struct ubi_volume *vol; vol = ubi_find_volume(volume); if (vol == NULL) return ENODEV; + if (!vol->updating) { + printf("UBI volume update was not initiated\n"); + return EINVAL; + } + err = ubi_more_update_data(ubi, vol, buf, size); if (err < 0) { printf("Couldnt or partially wrote data\n"); @@ -391,8 +396,8 @@ static int ubi_volume_continue_write(char *volume, void *buf, size_t size) int ubi_volume_begin_write(char *volume, void *buf, size_t size, size_t full_size) { - int err = 1; - int rsvd_bytes = 0; + int err; + int rsvd_bytes; struct ubi_volume *vol; vol = ubi_find_volume(volume); @@ -411,6 +416,10 @@ int ubi_volume_begin_write(char *volume, void *buf, size_t size, return -err; } + /* The volume is just wiped out */ + if (!full_size) + return 0; + return ubi_volume_continue_write(volume, buf, size); } @@ -573,7 +582,7 @@ static int ubi_detach(void) int ubi_part(char *part_name, const char *vid_header_offset) { struct mtd_info *mtd; - int err = 0; + int err; if (ubi && ubi->mtd && !strcmp(ubi->mtd->name, part_name)) { printf("UBI partition '%s' already selected\n", part_name); @@ -604,7 +613,7 @@ int ubi_part(char *part_name, const char *vid_header_offset) static int do_ubi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - int64_t size = 0; + int64_t size; ulong addr = 0; bool skipcheck = false; diff --git a/cmd/unlz4.c b/cmd/unlz4.c index fc5200117ad..2eadc753e6c 100644 --- a/cmd/unlz4.c +++ b/cmd/unlz4.c @@ -6,6 +6,7 @@ #include <command.h> #include <env.h> +#include <mapmem.h> #include <vsprintf.h> #include <u-boot/lz4.h> @@ -26,7 +27,8 @@ static int do_unlz4(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; } - ret = ulz4fn((void *)src, src_len, (void *)dst, &dst_len); + ret = ulz4fn(map_sysmem(src, 0), src_len, map_sysmem(dst, dst_len), + &dst_len); if (ret) { printf("Uncompressed err :%d\n", ret); return 1; diff --git a/cmd/usb.c b/cmd/usb.c index 3a3764a5b86..225d9291765 100644 --- a/cmd/usb.c +++ b/cmd/usb.c @@ -25,9 +25,6 @@ #ifdef CONFIG_USB_STORAGE static int usb_stor_curr_dev = -1; /* current device */ #endif -#if defined(CONFIG_USB_HOST_ETHER) && !defined(CONFIG_DM_ETH) -static int __maybe_unused usb_ether_curr_dev = -1; /* current ethernet device */ -#endif /* some display routines (info command) */ static char *usb_get_class_desc(unsigned char dclass) diff --git a/cmd/x86/exception.c b/cmd/x86/exception.c index 14b6bd6f493..02735494a3c 100644 --- a/cmd/x86/exception.c +++ b/cmd/x86/exception.c @@ -19,10 +19,9 @@ static struct cmd_tbl cmd_sub[] = { "", ""), }; -static char exception_help_text[] = +U_BOOT_LONGHELP(exception, "<ex>\n" " The following exceptions are available:\n" - " undefined - undefined instruction\n" - ; + " undefined - undefined instruction\n"); #include <exception.h> diff --git a/cmd/x86/zboot.c b/cmd/x86/zboot.c index addf28cb4aa..94e602b8a5b 100644 --- a/cmd/x86/zboot.c +++ b/cmd/x86/zboot.c @@ -5,6 +5,8 @@ * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se> */ +#define LOG_CATEGORY LOGC_BOOT + #include <command.h> #include <mapmem.h> #include <vsprintf.h> @@ -14,8 +16,14 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { ulong bzimage_addr = 0, bzimage_size, initrd_addr, initrd_size; - ulong base_addr; const char *s, *cmdline; + ulong base_addr; + int i; + + log_debug("argc %d:", argc); + for (i = 0; i < argc; i++) + log_debug(" %s", argv[i]); + log_debug("\n"); /* argv[1] holds the address of the bzImage */ s = cmd_arg1(argc, argv) ? : env_get("fileaddr"); @@ -114,17 +122,18 @@ U_BOOT_SUBCMDS(zboot, int do_zboot_states(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[], int state_mask) { - int ret; + int ret = 0; - if (flag & ZBOOT_STATE_START) + log_debug("state_mask %x\n", state_mask); + if (state_mask & ZBOOT_STATE_START) ret = do_zboot_start(cmdtp, flag, argc, argv); - if (!ret && (flag & ZBOOT_STATE_LOAD)) + if (!ret && (state_mask & ZBOOT_STATE_LOAD)) ret = do_zboot_load(cmdtp, flag, argc, argv); - if (!ret && (flag & ZBOOT_STATE_SETUP)) + if (!ret && (state_mask & ZBOOT_STATE_SETUP)) ret = do_zboot_setup(cmdtp, flag, argc, argv); - if (!ret && (flag & ZBOOT_STATE_INFO)) + if (!ret && (state_mask & ZBOOT_STATE_INFO)) ret = do_zboot_info(cmdtp, flag, argc, argv); - if (!ret && (flag & ZBOOT_STATE_GO)) + if (!ret && (state_mask & ZBOOT_STATE_GO)) ret = do_zboot_go(cmdtp, flag, argc, argv); if (ret) return ret; |