X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fbootcount%2Fbootcount_ram.c;h=e514a57286b94c6abd04777bb800024872ca807c;hb=83d290c56fab2d38cd1ab4c4cc7099559c1d5046;hp=5bdabcd562090bcee93e05abcef48c971144177d;hpb=1a4596601fd395f3afb8f82f3f840c5e00bdd57a;p=u-boot diff --git a/drivers/bootcount/bootcount_ram.c b/drivers/bootcount/bootcount_ram.c index 5bdabcd562..e514a57286 100644 --- a/drivers/bootcount/bootcount_ram.c +++ b/drivers/bootcount/bootcount_ram.c @@ -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 @@ -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)