]> git.sur5r.net Git - u-boot/blobdiff - drivers/bootcount/bootcount_ram.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / drivers / bootcount / bootcount_ram.c
index 5bdabcd562090bcee93e05abcef48c971144177d..e514a57286b94c6abd04777bb800024872ca807c 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2010
  * Heiko Schocher, DENX Software Engineering, hs@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -35,6 +34,10 @@ void bootcount_store(ulong a)
                writel(patterns[i % NBR_OF_PATTERNS],
                        &save_addr[i + OFFS_PATTERN]);
 
+       /* Make sure the data is written to RAM */
+       flush_dcache_range((ulong)&save_addr[0],
+                          (((ulong)&save_addr[REPEAT_PATTERN + OFFS_PATTERN] &
+                            ~(ARCH_DMA_MINALIGN - 1)) + ARCH_DMA_MINALIGN));
 }
 
 ulong bootcount_load(void)