xref: /openbmc/u-boot/arch/arm/cpu/arm926ejs/cache.c (revision bfacf466)
1 /*
2  * (C) Copyright 2011
3  * Ilya Yanok, EmCraft Systems
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc.
21  */
22 #include <linux/types.h>
23 #include <common.h>
24 
25 #ifndef CONFIG_SYS_DCACHE_OFF
26 static inline void dcache_noop(void)
27 {
28 	if (dcache_status()) {
29 		puts("WARNING: cache operations are not implemented!\n"
30 		     "WARNING: disabling D-Cache now, you can re-enable it"
31 		     "later with 'dcache on' command\n");
32 		dcache_disable();
33 	}
34 }
35 
36 void invalidate_dcache_all(void)
37 {
38 	dcache_noop();
39 }
40 
41 void invalidate_dcache_range(unsigned long start, unsigned long stop)
42 {
43 	dcache_noop();
44 }
45 
46 void flush_dcache_range(unsigned long start, unsigned long stop)
47 {
48 	dcache_noop();
49 }
50 #else /* #ifndef CONFIG_SYS_DCACHE_OFF */
51 void invalidate_dcache_all(void)
52 {
53 }
54 
55 void flush_dcache_all(void)
56 {
57 }
58 
59 void invalidate_dcache_range(unsigned long start, unsigned long stop)
60 {
61 }
62 
63 void flush_dcache_range(unsigned long start, unsigned long stop)
64 {
65 }
66 
67 void  flush_cache(unsigned long start, unsigned long size)
68 {
69 }
70 #endif /* #ifndef CONFIG_SYS_DCACHE_OFF */
71 
72 /*
73  * Stub implementations for l2 cache operations
74  */
75 void __l2_cache_disable(void)
76 {
77 }
78 void l2_cache_disable(void)
79         __attribute__((weak, alias("__l2_cache_disable")));
80