summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Stainton <nstainton@asl-control.co.uk>2018-09-19 10:38:07 +0100
committerTom Rini <trini@konsulko.com>2018-09-30 13:00:34 -0400
commit18f201ea207a28aa79d7a485a2dc7b643ec36a31 (patch)
treedc621dc8a62b3cb60300c8378f92191d71819c4e
parent0c544115379ed77c1843a194e26960e5b8f3d369 (diff)
u-boot: align cache flushes in load_elf_image_shdr to line boundaries
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 <nstainton@asl-control.co.uk> [trini: Manually apply, rework whitespace] Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--cmd/elf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/elf.c b/cmd/elf.c
index c8e6e7424c..7bad1f80d4 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -219,7 +219,10 @@ 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;