From 1e4d965b592fb2f790948eed2db8010bda674fc5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 29 Apr 2023 19:21:46 -0600 Subject: acpi: Put the version numbers in a central place At present two acpi files are built every time since they use a version number from version.h This is not necessary. Make use of the same technique as for the version string, so that they are build only when they change. Signed-off-by: Simon Glass --- cmd/version.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd') diff --git a/cmd/version.c b/cmd/version.c index 190ef6a9061..87e1fa4159c 100644 --- a/cmd/version.c +++ b/cmd/version.c @@ -19,6 +19,8 @@ U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING const char version_string[] = U_BOOT_VERSION_STRING; +const unsigned short version_num = U_BOOT_VERSION_NUM; +const unsigned char version_num_patch = U_BOOT_VERSION_NUM_PATCH; static int do_version(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -- cgit v1.3.1 From 33c63cea5ee13da6cc7c62443b1f953f74828302 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Mon, 1 May 2023 11:35:25 +0800 Subject: cmd: fdt: Correct checking of configuration node fit_conf_get_node() returns a negative value on error. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- cmd/fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/fdt.c b/cmd/fdt.c index aae3278526c..2401ea8b44c 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -733,7 +733,7 @@ static int do_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) gd->fdt_blob = blob; cfg_noffset = fit_conf_get_node(working_fdt, NULL); - if (!cfg_noffset) { + if (cfg_noffset < 0) { printf("Could not find configuration node: %s\n", fdt_strerror(cfg_noffset)); return CMD_RET_FAILURE; -- cgit v1.3.1 From d20481ee3c8a95ce713f595b5ee84969b1c9fa01 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Sun, 7 May 2023 13:48:06 +0300 Subject: cmd: fs: document where 'size' stores its result Make it a little bit easier for the user to utilize the 'size' command. Signed-off-by: Baruch Siach Reviewed-by: Simon Glass --- cmd/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/fs.c b/cmd/fs.c index 5ad11647c2d..6044f73af5b 100644 --- a/cmd/fs.c +++ b/cmd/fs.c @@ -20,7 +20,7 @@ U_BOOT_CMD( "determine a file's size", " \n" " - Find file 'filename' from 'dev' on 'interface'\n" - " and determine its size." + " determine its size, and store in the 'filesize' variable." ); static int do_load_wrapper(struct cmd_tbl *cmdtp, int flag, int argc, -- cgit v1.3.1 From 899fb5aa8becc159b1eb086d8828c4e8eb28f121 Mon Sep 17 00:00:00 2001 From: Ashok Reddy Soma Date: Tue, 16 May 2023 05:52:36 -0600 Subject: cmd: sf/nand: Print and return failure when 0 length is passed For sf commands, when '0' length is passed for erase, update, write or read, there might be undesired results. Ideally '0' length means nothing to do. So print 'ERROR: Invalid size 0' and return cmd failure when length '0' is passed to sf commands. Same thing applies for nand commands also. Example: ZynqMP> sf erase 0 0 ERROR: Invalid size 0 ZynqMP> sf write 10000 0 0 ERROR: Invalid size 0 ZynqMP> sf read 10000 0 0 ERROR: Invalid size 0 ZynqMP> sf update 1000 10000 0 ERROR: Invalid size 0 ZynqMP> Signed-off-by: Ashok Reddy Soma --- cmd/legacy-mtd-utils.c | 5 +++++ cmd/sf.c | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'cmd') diff --git a/cmd/legacy-mtd-utils.c b/cmd/legacy-mtd-utils.c index ac7139f84d6..5903a90fe53 100644 --- a/cmd/legacy-mtd-utils.c +++ b/cmd/legacy-mtd-utils.c @@ -88,6 +88,11 @@ int mtd_arg_off_size(int argc, char *const argv[], int *idx, loff_t *off, return -1; } + if (*size == 0) { + debug("ERROR: Invalid size 0\n"); + return -1; + } + print: printf("device %d ", *idx); if (*size == chipsize) diff --git a/cmd/sf.c b/cmd/sf.c index 11b9c25896a..55bef2f7699 100644 --- a/cmd/sf.c +++ b/cmd/sf.c @@ -353,6 +353,11 @@ static int do_spi_flash_erase(int argc, char *const argv[]) if (ret != 1) return CMD_RET_USAGE; + if (size == 0) { + debug("ERROR: Invalid size 0\n"); + return CMD_RET_FAILURE; + } + /* Consistency checking */ if (offset + size > flash->size) { printf("ERROR: attempting %s past flash size (%#x)\n", -- cgit v1.3.1