All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] u-boot: align cache flushes in load_elf_image_shdr to line boundaries
@ 2018-09-19  9:38 Neil Stainton
  2018-09-30 19:25 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Stainton @ 2018-09-19  9:38 UTC (permalink / raw)
  To: u-boot

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>
---

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] u-boot: align cache flushes in load_elf_image_shdr to line boundaries
@ 2018-08-20 15:46 Neil Stainton
  2018-08-24 20:10 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Stainton @ 2018-08-20 15:46 UTC (permalink / raw)
  To: u-boot

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.

---
Currently when using bootelf to load an image on Arm, several warnings such as the following appear in the console:
  CACHE: Misaligned operation at range [87800000, 8783c5e0]
  CACHE: Misaligned operation at range [8783c5e0, 8784b3e0]

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

---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-30 19:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19  9:38 [U-Boot] [PATCH] u-boot: align cache flushes in load_elf_image_shdr to line boundaries Neil Stainton
2018-09-30 19:25 ` [U-Boot] " Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2018-08-20 15:46 [U-Boot] [PATCH] " Neil Stainton
2018-08-24 20:10 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.