blob: e6a7f6827fc2541fa6756f90191203e427ba1d94 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Chris Zankel1387dab2016-08-10 18:36:44 +03002/*
3 * (C) Copyright 2008 - 2013 Tensilica Inc.
4 * (C) Copyright 2014 - 2016 Cadence Design Systems Inc.
Chris Zankel1387dab2016-08-10 18:36:44 +03005 */
6
Simon Glass1d91ba72019-11-14 12:57:37 -07007#include <cpu_func.h>
Chris Zankel1387dab2016-08-10 18:36:44 +03008#include <asm/cache.h>
9
10/*
11 * We currently run always with caches enabled when running from memory.
12 * Xtensa version D or later will support changing cache behavior, so
13 * we could implement it if necessary.
14 */
15
16int dcache_status(void)
17{
18 return 1;
19}
20
21void dcache_enable(void)
22{
23}
24
25void dcache_disable(void)
26{
27}
28
29void flush_cache(ulong start_addr, ulong size)
30{
31 __flush_invalidate_dcache_range(start_addr, size);
32 __invalidate_icache_range(start_addr, size);
33}
34
35void flush_dcache_all(void)
36{
37 __flush_dcache_all();
38 __invalidate_icache_all();
39}
40
41void flush_dcache_range(ulong start_addr, ulong end_addr)
42{
43 __flush_invalidate_dcache_range(start_addr, end_addr - start_addr);
44}
45
46void invalidate_dcache_range(ulong start, ulong stop)
47{
48 __invalidate_dcache_range(start, stop - start);
49}
50
51void invalidate_dcache_all(void)
52{
53 __invalidate_dcache_all();
54}
55
56void invalidate_icache_all(void)
57{
58 __invalidate_icache_all();
59}