Prevent cache warning messages when using the 'bootelf' command on an
Arm target. Round down each section start address and round up the
respective section end to the nearest cache line.

Signed-off-by: Neil Stainton <nstain...@asl-control.co.uk>
---

This is a repeat of commit 8744d6c5 as this file changed significantly between patch submission and the patch being applied.

---
 cmd/elf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmd/elf.c b/cmd/elf.c
index eafea38..1199e5d 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -141,7 +141,9 @@ static unsigned long load_elf_image_shdr(unsigned long addr)
                        memcpy((void *)(uintptr_t)shdr->sh_addr,
                               (const void *)image, shdr->sh_size);
                }
-               flush_cache(shdr->sh_addr, shdr->sh_size);
+               flush_cache(rounddown(shdr->sh_addr, ARCH_DMA_MINALIGN),
+ roundup((shdr->sh_addr + shdr->sh_size), ARCH_DMA_MINALIGN) - + rounddown(shdr->sh_addr, ARCH_DMA_MINALIGN));
        }

        return ehdr->e_entry;
--
2.7.4
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to