summaryrefslogtreecommitdiff
path: root/drivers/bootcount
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2016-04-06 11:02:22 +0200
committerTom Rini <trini@konsulko.com>2016-04-11 20:48:25 -0400
commit20adda4cf8980a9df1d966bd7bec918ac3e4e5d6 (patch)
tree056c13df1fc936ef62b39c1fab6dc3ca77404b48 /drivers/bootcount
parentd9b2678e0a5e5781b37487ccb943ddcbf0623bb0 (diff)
bootcounter_ram: Flush dcache after data is written into SDRAM
This patch adds a call to flush_dcache_range() to bootcount_store() to make sure, that the bootcounter data (including the patterns) is written to memory. Without this, platforms with dcache enabled may not have the bootcounter updated upon reset. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Diffstat (limited to 'drivers/bootcount')
-rw-r--r--drivers/bootcount/bootcount_ram.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/bootcount/bootcount_ram.c b/drivers/bootcount/bootcount_ram.c
index 5bdabcd5620..e0d2669b71d 100644
--- a/drivers/bootcount/bootcount_ram.c
+++ b/drivers/bootcount/bootcount_ram.c
@@ -35,6 +35,9 @@ 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]);
}
ulong bootcount_load(void)