From 957f51e86367e14be9e40cfe5cc3a494fc17abcf Mon Sep 17 00:00:00 2001 From: Kurban Mallachiev Date: Thu, 7 Feb 2019 14:19:45 +0300 Subject: elf: fix cache flushing in 'bootelf -p' command Currently there are two problems in 'bootelf -p' (load elf by segments) command: - bss section is not flushed, so booted elf can have non zero values in bss; - at least on ARM there are 'CACHE: Misaligned operation at range...' warnings Use p_memsz instead of p_filesz during cache flushing for elf segment. p_filesz doesn't include zero initialized memory (e.g. bss section), which also should be flushed. Align these cache flushes to line boundaries. Signed-off-by: Kurban Mallachiev --- cmd/elf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/elf.c b/cmd/elf.c index 7bad1f80d42..d883be41931 100644 --- a/cmd/elf.c +++ b/cmd/elf.c @@ -53,7 +53,8 @@ static unsigned long load_elf64_image_phdr(unsigned long addr) if (phdr->p_filesz != phdr->p_memsz) memset(dst + phdr->p_filesz, 0x00, phdr->p_memsz - phdr->p_filesz); - flush_cache((unsigned long)dst, phdr->p_filesz); + flush_cache(rounddown((unsigned long)dst, ARCH_DMA_MINALIGN), + roundup(phdr->p_memsz, ARCH_DMA_MINALIGN)); ++phdr; } @@ -167,7 +168,8 @@ static unsigned long load_elf_image_phdr(unsigned long addr) if (phdr->p_filesz != phdr->p_memsz) memset(dst + phdr->p_filesz, 0x00, phdr->p_memsz - phdr->p_filesz); - flush_cache((unsigned long)dst, phdr->p_filesz); + flush_cache(rounddown((unsigned long)dst, ARCH_DMA_MINALIGN), + roundup(phdr->p_memsz, ARCH_DMA_MINALIGN)); ++phdr; } -- cgit v1.2.3 From 44ac80e7e90ff1c6630b64b3babe03cc6bdef46a Mon Sep 17 00:00:00 2001 From: Roman Kapl Date: Fri, 8 Feb 2019 10:01:02 +0100 Subject: cmd: date: Do not overwrite arguments Arguments are const and belong to the caller. Calling date in a hush loop will yield different results from the second invocation. Signed-off-by: Roman Kapl --- cmd/date.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd') diff --git a/cmd/date.c b/cmd/date.c index 1115b6c8d67..7fa950a9026 100644 --- a/cmd/date.c +++ b/cmd/date.c @@ -159,18 +159,18 @@ int mk_date (const char *datestr, struct rtc_time *tmp) int len, val; char *ptr; - ptr = strchr (datestr,'.'); - len = strlen (datestr); + ptr = strchr(datestr, '.'); + len = strlen(datestr); /* Set seconds */ if (ptr) { int sec; - *ptr++ = '\0'; + ptr++; if ((len - (ptr - datestr)) != 2) return (-1); - len = strlen (datestr); + len -= 3; if (cnvrt2 (ptr, &sec)) return (-1); -- cgit v1.2.3 From 84c7a1398f73d88e8e96dfee137e45e0c85a5d7a Mon Sep 17 00:00:00 2001 From: "Gervais, Francois" Date: Sat, 16 Feb 2019 21:10:32 +0000 Subject: cmd/fs: fix build if CMD_BOOTEFI is not set Fixes: cmd/fs.c:29: undefined reference to `efi_set_bootdev' Signed-off-by: Francois Gervais --- cmd/fs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd') diff --git a/cmd/fs.c b/cmd/fs.c index 8064a1c84df..94467671be8 100644 --- a/cmd/fs.c +++ b/cmd/fs.c @@ -26,8 +26,10 @@ U_BOOT_CMD( static int do_load_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { +#ifdef CONFIG_CMD_BOOTEFI efi_set_bootdev(argv[1], (argc > 2) ? argv[2] : "", (argc > 4) ? argv[4] : ""); +#endif return do_load(cmdtp, flag, argc, argv, FS_TYPE_ANY); } -- cgit v1.2.3 From 2d3beff2d297d278b3944289be285a59fa7904e0 Mon Sep 17 00:00:00 2001 From: Ismael Luceno Cortes Date: Mon, 18 Feb 2019 09:17:04 +0000 Subject: cmd: pcmcia: Build only if CONFIG_CMD_PCMCIA=y Signed-off-by: Ismael Luceno --- cmd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/Makefile b/cmd/Makefile index 15ae4d250f5..a127a995394 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -104,7 +104,7 @@ obj-$(CONFIG_CMD_PART) += part.o ifdef CONFIG_PCI obj-$(CONFIG_CMD_PCI) += pci.o endif -obj-y += pcmcia.o +obj-$(CONFIG_CMD_PCMCIA) += pcmcia.o obj-$(CONFIG_CMD_PINMUX) += pinmux.o obj-$(CONFIG_CMD_PXE) += pxe.o obj-$(CONFIG_CMD_WOL) += wol.o -- cgit v1.2.3