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