From: Lukas Auer Date: Fri, 4 Jan 2019 00:37:30 +0000 (+0100) Subject: riscv: use invalidate/flush_*cache_range functions in cache.c X-Git-Tag: v2019.04-rc1~43^2~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f74c416e622cec35be95066fb7fcf4c27ac146e9;p=oweals%2Fu-boot.git riscv: use invalidate/flush_*cache_range functions in cache.c The flush_cache() function in lib/cache.c ignores its arguments and flushes the complete data and instruction caches. Use the invalidate/flush_*cache_range() functions instead to only flush the requested memory region. This patch does not change the current behavior of U-Boot, since the implementation of the invalidate/flush_*cache_range() functions flush the complete data and instruction caches. It is in preparation for CPUs with the necessary functionality for flushing a selectable memory range. Signed-off-by: Lukas Auer Reviewed-by: Bin Meng --- diff --git a/arch/riscv/lib/cache.c b/arch/riscv/lib/cache.c index 78b19da2c5..5437a122a1 100644 --- a/arch/riscv/lib/cache.c +++ b/arch/riscv/lib/cache.c @@ -40,8 +40,8 @@ void cache_flush(void) void flush_cache(unsigned long addr, unsigned long size) { - invalidate_icache_all(); - flush_dcache_all(); + invalidate_icache_range(addr, addr + size); + flush_dcache_range(addr, addr + size); } __weak void icache_enable(void)