bootcounter_ram: Fix misaligned cache warning
authorStefan Roese <sr@denx.de>
Fri, 18 Nov 2016 16:21:52 +0000 (17:21 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 28 Nov 2016 20:10:34 +0000 (15:10 -0500)
This patch fixes the warning about misaligned cache on Armada XP:

CACHE: Misaligned operation at range [7ffff0007fffffac]

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
drivers/bootcount/bootcount_ram.c

index e0d2669..ad4cc56 100644 (file)
@@ -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)