]> git.karo-electronics.de Git - karo-tx-uboot.git/blob - arch/arm/lib/cache.c
8105e251104b0fff893a397e37009c2998331308
[karo-tx-uboot.git] / arch / arm / lib / cache.c
1 /*
2  * (C) Copyright 2002
3  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 /* for now: just dummy functions to satisfy the linker */
9
10 #include <common.h>
11
12 void  __flush_cache(unsigned long start, unsigned long size)
13 {
14 #if defined(CONFIG_ARM1136)
15         void arm1136_cache_flush(void);
16
17         arm1136_cache_flush();
18 #endif
19 #ifdef CONFIG_ARM926EJS
20         asm(
21                 /* test and clean, page 2-23 of arm926ejs manual */
22                 "0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n"
23                 /* flush write buffer as well (page 2-22) */
24                 "mcr p15, 0, %0, c7, c10, 4" : : "r"(0) : "memory"
25                 );
26 #endif
27         return;
28 }
29 void  flush_cache(unsigned long start, unsigned long size)
30         __attribute__((weak, alias("__flush_cache")));
31
32 /*
33  * Default implementation:
34  * do a range flush for the entire range
35  */
36 void    __flush_dcache_all(void)
37 {
38         flush_cache(0, ~0);
39 }
40 void    flush_dcache_all(void)
41         __attribute__((weak, alias("__flush_dcache_all")));
42
43
44 /*
45  * Default implementation of enable_caches()
46  * Real implementation should be in platform code
47  */
48 void __enable_caches(void)
49 {
50         puts("WARNING: Caches not enabled\n");
51 }
52 void enable_caches(void)
53         __attribute__((weak, alias("__enable_caches")));