summaryrefslogtreecommitdiff
path: root/cmd/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/elf.c')
-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;