diff mbox

[U-Boot] bootcounter_ram: Fix misaligned cache warning

Message ID 20161118162152.28948-2-sr@denx.de
State Accepted
Commit 384b1d507f1057d97e7cd086f9ea649549300a44
Delegated to: Tom Rini
Headers show

Commit Message

Stefan Roese Nov. 18, 2016, 4:21 p.m. UTC
This patch fixes the warning about misaligned cache on Armada XP:

CACHE: Misaligned operation at range [7ffff000, 7fffffac]

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
---
 drivers/bootcount/bootcount_ram.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Tom Rini Nov. 21, 2016, 2:01 p.m. UTC | #1
On Fri, Nov 18, 2016 at 05:21:52PM +0100, Stefan Roese wrote:

> This patch fixes the warning about misaligned cache on Armada XP:
> 
> CACHE: Misaligned operation at range [7ffff000, 7fffffac]
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Valentin Longchamp <valentin.longchamp@keymile.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini Nov. 29, 2016, 1:02 a.m. UTC | #2
On Fri, Nov 18, 2016 at 05:21:52PM +0100, Stefan Roese wrote:

> This patch fixes the warning about misaligned cache on Armada XP:
> 
> CACHE: Misaligned operation at range [7ffff000, 7fffffac]
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/drivers/bootcount/bootcount_ram.c b/drivers/bootcount/bootcount_ram.c
index e0d2669..ad4cc56 100644
--- a/drivers/bootcount/bootcount_ram.c
+++ b/drivers/bootcount/bootcount_ram.c
@@ -37,7 +37,8 @@  void bootcount_store(ulong a)
 
 	/* Make sure the data is written to RAM */
 	flush_dcache_range((ulong)&save_addr[0],
-			   (ulong)&save_addr[REPEAT_PATTERN + OFFS_PATTERN]);
+			   (((ulong)&save_addr[REPEAT_PATTERN + OFFS_PATTERN] &
+			     ~(ARCH_DMA_MINALIGN - 1)) + ARCH_DMA_MINALIGN));
 }
 
 ulong bootcount_load(void)