diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | arch/arm/include/asm/linkage.h | 4 | ||||
-rw-r--r-- | cmd/fdt.c | 2 | ||||
-rw-r--r-- | cmd/fs.c | 2 | ||||
-rw-r--r-- | cmd/legacy-mtd-utils.c | 5 | ||||
-rw-r--r-- | cmd/sf.c | 5 | ||||
-rw-r--r-- | cmd/version.c | 2 | ||||
-rw-r--r-- | common/cli_hush.c | 2 | ||||
-rw-r--r-- | common/spl/spl.c | 2 | ||||
-rw-r--r-- | drivers/dfu/dfu.c | 2 | ||||
-rw-r--r-- | drivers/fastboot/fb_common.c | 2 | ||||
-rw-r--r-- | drivers/mmc/mmc.c | 2 | ||||
-rw-r--r-- | fs/semihostingfs.c | 4 | ||||
-rw-r--r-- | include/version_string.h | 2 | ||||
-rw-r--r-- | lib/acpi/acpi_table.c | 15 | ||||
-rw-r--r-- | lib/efi_loader/Makefile | 3 | ||||
-rw-r--r-- | scripts/Makefile.lib | 2 | ||||
-rw-r--r-- | test/dm/acpi.c | 16 |
18 files changed, 48 insertions, 28 deletions
@@ -1812,7 +1812,7 @@ quiet_cmd_gen_envp = ENVP $@ rm -f $@; \ touch $@ ; \ fi -include/generated/env.in: include/generated/env.txt FORCE +include/generated/env.in: include/generated/env.txt $(call cmd,gen_envp) # Regenerate the environment if it changes @@ -1830,7 +1830,7 @@ quiet_cmd_envc = ENVC $@ touch $@ ; \ fi -include/generated/env.txt: $(wildcard $(ENV_FILE)) FORCE +include/generated/env.txt: $(wildcard $(ENV_FILE)) $(call cmd,envc) # Write out the resulting environment, converted to a C string diff --git a/arch/arm/include/asm/linkage.h b/arch/arm/include/asm/linkage.h index dbe4b4e31a5..73bf25ba4e1 100644 --- a/arch/arm/include/asm/linkage.h +++ b/arch/arm/include/asm/linkage.h @@ -1,7 +1,7 @@ #ifndef __ASM_LINKAGE_H #define __ASM_LINKAGE_H -#define __ALIGN .align 0 -#define __ALIGN_STR ".align 0" +#define __ALIGN .p2align 2 +#define __ALIGN_STR ".p2align 2" #endif 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; @@ -20,7 +20,7 @@ U_BOOT_CMD( "determine a file's size", "<interface> <dev[:part]> <filename>\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, 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) @@ -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", 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[]) diff --git a/common/cli_hush.c b/common/cli_hush.c index 171069f5f49..cee87249bc2 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c @@ -324,7 +324,7 @@ typedef struct { /* I can almost use ordinary FILE *. Is open_memstream() universally * available? Where is it documented? */ struct in_str { - const char *p; + const unsigned char *p; #ifndef __U_BOOT__ char peek_buf[2]; #endif diff --git a/common/spl/spl.c b/common/spl/spl.c index 72078a8ebc8..801c4b507ca 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -331,7 +331,7 @@ static int spl_load_fit_image(struct spl_image_info *spl_image, conf_noffset = fit_conf_get_node((const void *)header, fit_uname_config); - if (conf_noffset <= 0) + if (conf_noffset < 0) return 0; for (idx = 0; diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index 516dda61796..b2ee5f1ede6 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -135,6 +135,7 @@ int dfu_config_interfaces(char *env) a = s; do { part = strsep(&a, ";"); + part = skip_spaces(part); ret = dfu_alt_add(dfu, i, d, part); if (ret) return ret; @@ -629,6 +630,7 @@ int dfu_config_entities(char *env, char *interface, char *devstr) for (i = 0; i < dfu_alt_num; i++) { s = strsep(&env, ";"); + s = skip_spaces(s); ret = dfu_alt_add(dfu, interface, devstr, s); if (ret) { /* We will free "dfu" in dfu_free_entities() */ diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c index 621146bc6b0..4e9d9b719c6 100644 --- a/drivers/fastboot/fb_common.c +++ b/drivers/fastboot/fb_common.c @@ -135,7 +135,7 @@ void fastboot_boot(void) s = env_get("fastboot_bootcmd"); if (s) { run_command(s, CMD_FLAG_ENV); - } else { + } else if (IS_ENABLED(CONFIG_CMD_BOOTM)) { static char boot_addr_start[20]; static char *const bootm_args[] = { "bootm", boot_addr_start, NULL diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 1af6af82e6b..72c1076c56d 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2262,7 +2262,7 @@ static int mmc_startup_v4(struct mmc *mmc) return 0; if (!mmc->ext_csd) - memset(ext_csd_bkup, 0, sizeof(ext_csd_bkup)); + memset(ext_csd_bkup, 0, MMC_MAX_BLOCK_LEN); err = mmc_send_ext_csd(mmc, ext_csd); if (err) diff --git a/fs/semihostingfs.c b/fs/semihostingfs.c index 96eb3349a2f..3592338a686 100644 --- a/fs/semihostingfs.c +++ b/fs/semihostingfs.c @@ -57,8 +57,12 @@ static int smh_fs_write_at(const char *filename, loff_t pos, void *buffer, { long fd, size, ret; + /* Try to open existing file */ fd = smh_open(filename, MODE_READ | MODE_BINARY | MODE_PLUS); if (fd < 0) + /* Create new file */ + fd = smh_open(filename, MODE_WRITE | MODE_BINARY); + if (fd < 0) return fd; ret = smh_seek(fd, pos); if (ret < 0) { diff --git a/include/version_string.h b/include/version_string.h index a89a6e43705..a7d07e4cc7c 100644 --- a/include/version_string.h +++ b/include/version_string.h @@ -4,5 +4,7 @@ #define __VERSION_STRING_H__ extern const char version_string[]; +extern const unsigned short version_num; +extern const unsigned char version_num_patch; #endif /* __VERSION_STRING_H__ */ diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c index 7c4189e2434..a8d4b470001 100644 --- a/lib/acpi/acpi_table.c +++ b/lib/acpi/acpi_table.c @@ -11,8 +11,7 @@ #include <log.h> #include <mapmem.h> #include <tables_csum.h> -#include <timestamp.h> -#include <version.h> +#include <version_string.h> #include <acpi/acpi_table.h> #include <asm/global_data.h> #include <dm/acpi.h> @@ -25,12 +24,12 @@ * to have valid date. So for U-Boot version 2021.04 OEM_REVISION is set to * value 0x20210401. */ -#define OEM_REVISION ((((U_BOOT_VERSION_NUM / 1000) % 10) << 28) | \ - (((U_BOOT_VERSION_NUM / 100) % 10) << 24) | \ - (((U_BOOT_VERSION_NUM / 10) % 10) << 20) | \ - ((U_BOOT_VERSION_NUM % 10) << 16) | \ - (((U_BOOT_VERSION_NUM_PATCH / 10) % 10) << 12) | \ - ((U_BOOT_VERSION_NUM_PATCH % 10) << 8) | \ +#define OEM_REVISION ((((version_num / 1000) % 10) << 28) | \ + (((version_num / 100) % 10) << 24) | \ + (((version_num / 10) % 10) << 20) | \ + ((version_num % 10) << 16) | \ + (((version_num_patch / 10) % 10) << 12) | \ + ((version_num_patch % 10) << 8) | \ 0x01) int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags) diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index 13a35eae6c0..1a8c8d7cab5 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -23,6 +23,7 @@ CFLAGS_REMOVE_initrddump.o := $(CFLAGS_NON_EFI) ifdef CONFIG_RISCV always += boothart.efi +targets += boothart.o endif ifneq ($(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),) @@ -32,10 +33,12 @@ endif ifeq ($(CONFIG_GENERATE_ACPI_TABLE),) always += dtbdump.efi +targets += dtbdump.o endif ifdef CONFIG_EFI_LOAD_FILE2_INITRD always += initrddump.efi +targets += initrddump.o endif obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 7362a392ada..f5ab7af0f45 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -186,7 +186,7 @@ u_boot_dtsi = $(strip $(u_boot_dtsi_options_debug) \ # Modified for U-Boot dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ $(UBOOTINCLUDE) \ - -I$(srctree)/arch/$(ARCH)/dts \ + -I$(dir $<) \ -I$(srctree)/arch/$(ARCH)/dts/include \ -I$(srctree)/include \ -D__ASSEMBLY__ \ diff --git a/test/dm/acpi.c b/test/dm/acpi.c index 9634fc2e900..818f71572c7 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -11,10 +11,8 @@ #include <dm.h> #include <malloc.h> #include <mapmem.h> -#include <timestamp.h> -#include <version.h> #include <tables_csum.h> -#include <version.h> +#include <version_string.h> #include <acpi/acpigen.h> #include <acpi/acpi_device.h> #include <acpi/acpi_table.h> @@ -26,12 +24,12 @@ #define BUF_SIZE 4096 -#define OEM_REVISION ((((U_BOOT_VERSION_NUM / 1000) % 10) << 28) | \ - (((U_BOOT_VERSION_NUM / 100) % 10) << 24) | \ - (((U_BOOT_VERSION_NUM / 10) % 10) << 20) | \ - ((U_BOOT_VERSION_NUM % 10) << 16) | \ - (((U_BOOT_VERSION_NUM_PATCH / 10) % 10) << 12) | \ - ((U_BOOT_VERSION_NUM_PATCH % 10) << 8) | \ +#define OEM_REVISION ((((version_num / 1000) % 10) << 28) | \ + (((version_num / 100) % 10) << 24) | \ + (((version_num / 10) % 10) << 20) | \ + ((version_num % 10) << 16) | \ + (((version_num_patch / 10) % 10) << 12) | \ + ((version_num_patch % 10) << 8) | \ 0x01) /** |