Ilya Yanok | c850069 | 2011-11-28 06:37:32 +0000 | [diff] [blame] | 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 flush_dcache_all(void) |
| 42 | { |
| 43 | dcache_noop(); |
| 44 | } |
| 45 | |
| 46 | void invalidate_dcache_range(unsigned long start, unsigned long stop) |
| 47 | { |
| 48 | dcache_noop(); |
| 49 | } |
| 50 | |
| 51 | void flush_dcache_range(unsigned long start, unsigned long stop) |
| 52 | { |
| 53 | dcache_noop(); |
| 54 | } |
| 55 | #else /* #ifndef CONFIG_SYS_DCACHE_OFF */ |
| 56 | void invalidate_dcache_all(void) |
| 57 | { |
| 58 | } |
| 59 | |
| 60 | void flush_dcache_all(void) |
| 61 | { |
| 62 | } |
| 63 | |
| 64 | void invalidate_dcache_range(unsigned long start, unsigned long stop) |
| 65 | { |
| 66 | } |
| 67 | |
| 68 | void flush_dcache_range(unsigned long start, unsigned long stop) |
| 69 | { |
| 70 | } |
| 71 | |
| 72 | void flush_cache(unsigned long start, unsigned long size) |
| 73 | { |
| 74 | } |
| 75 | #endif /* #ifndef CONFIG_SYS_DCACHE_OFF */ |