blob: 4f6b9f01cb55587bc00483693be903a7750a1a9c [file] [log] [blame]
wdenkedc48b62002-09-08 17:56:50 +00001/*
2 * (C) Copyright 2002
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenkedc48b62002-09-08 17:56:50 +00006 */
7
8/* for now: just dummy functions to satisfy the linker */
9
wdenkf8062712005-01-09 23:16:25 +000010#include <common.h>
11
Aneesh V0286aaf2011-06-16 23:30:46 +000012void __flush_cache(unsigned long start, unsigned long size)
wdenkedc48b62002-09-08 17:56:50 +000013{
Tom Rini96a25482013-06-04 12:02:06 +000014#if defined(CONFIG_ARM1136)
wdenkf8062712005-01-09 23:16:25 +000015
Albert ARIBAUD7a6fd042014-04-15 16:13:47 +020016#if !defined(CONFIG_SYS_ICACHE_OFF)
17 asm("mcr p15, 0, r1, c7, c5, 0"); /* invalidate I cache */
wdenkf8062712005-01-09 23:16:25 +000018#endif
Albert ARIBAUD7a6fd042014-04-15 16:13:47 +020019
20#if !defined(CONFIG_SYS_DCACHE_OFF)
21 asm("mcr p15, 0, r1, c7, c14, 0"); /* Clean+invalidate D cache */
22#endif
23
24#endif /* CONFIG_ARM1136 */
25
Heiko Schocher54433092010-09-17 13:10:30 +020026#ifdef CONFIG_ARM926EJS
27 /* test and clean, page 2-23 of arm926ejs manual */
28 asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
29 /* disable write buffer as well (page 2-22) */
30 asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
Albert ARIBAUD7a6fd042014-04-15 16:13:47 +020031#endif /* CONFIG_ARM926EJS */
wdenkedc48b62002-09-08 17:56:50 +000032 return;
33}
Aneesh V0286aaf2011-06-16 23:30:46 +000034void flush_cache(unsigned long start, unsigned long size)
35 __attribute__((weak, alias("__flush_cache")));
Aneesh V3bda3772011-06-16 23:30:50 +000036
37/*
38 * Default implementation:
39 * do a range flush for the entire range
40 */
41void __flush_dcache_all(void)
42{
43 flush_cache(0, ~0);
44}
45void flush_dcache_all(void)
46 __attribute__((weak, alias("__flush_dcache_all")));
Aneesh Vfffbb972011-08-16 04:33:05 +000047
48
49/*
50 * Default implementation of enable_caches()
51 * Real implementation should be in platform code
52 */
53void __enable_caches(void)
54{
55 puts("WARNING: Caches not enabled\n");
56}
57void enable_caches(void)
58 __attribute__((weak, alias("__enable_caches")));