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