blob: ee90ab71958792f5257a304d6db5be589f21d510 [file] [log] [blame]
Ilya Yanok2f3427c2011-11-28 06:37:32 +00001/*
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
26static 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
36void invalidate_dcache_all(void)
37{
38 dcache_noop();
39}
40
Ilya Yanok2f3427c2011-11-28 06:37:32 +000041void invalidate_dcache_range(unsigned long start, unsigned long stop)
42{
43 dcache_noop();
44}
45
46void flush_dcache_range(unsigned long start, unsigned long stop)
47{
48 dcache_noop();
49}
50#else /* #ifndef CONFIG_SYS_DCACHE_OFF */
51void invalidate_dcache_all(void)
52{
53}
54
55void flush_dcache_all(void)
56{
57}
58
59void invalidate_dcache_range(unsigned long start, unsigned long stop)
60{
61}
62
63void flush_dcache_range(unsigned long start, unsigned long stop)
64{
65}
66
67void flush_cache(unsigned long start, unsigned long size)
68{
69}
70#endif /* #ifndef CONFIG_SYS_DCACHE_OFF */