xref: /OK3568_Linux_fs/u-boot/arch/arm/mach-at91/arm926ejs/cache.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * (C) Copyright 2016
3  * Heiko Schocher, DENX Software Engineering, hs@denx.de.
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 #include <linux/types.h>
8 #include <common.h>
9 
enable_caches(void)10 void enable_caches(void)
11 {
12 #ifndef CONFIG_SYS_ICACHE_OFF
13 	icache_enable();
14 #endif
15 }
16 
17 #ifndef CONFIG_SYS_ICACHE_OFF
18 /* Invalidate entire I-cache and branch predictor array */
invalidate_icache_all(void)19 void invalidate_icache_all(void)
20 {
21 	unsigned long i = 0;
22 
23 	asm ("mcr p15, 0, %0, c7, c5, 0" : : "r" (i));
24 }
25 #else
invalidate_icache_all(void)26 void invalidate_icache_all(void)
27 {
28 }
29 #endif
30