1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2007 Michal Simek
5 * Michal SIMEK <monstr@monstr.eu>
11 int dcache_status (void)
15 __asm__ __volatile__ ("mfs %0,rmsr"::"r" (i):"memory");
17 __asm__ __volatile__ ("and %0,%0,%1"::"r" (i), "r" (mask):"memory");
21 int icache_status (void)
25 __asm__ __volatile__ ("mfs %0,rmsr"::"r" (i):"memory");
27 __asm__ __volatile__ ("and %0,%0,%1"::"r" (i), "r" (mask):"memory");
31 void icache_enable (void) {
35 void icache_disable(void) {
36 /* we are not generate ICACHE size -> flush whole cache */
37 flush_cache(0, 32768);
41 void dcache_enable (void) {
45 void dcache_disable(void) {
46 #ifdef XILINX_USE_DCACHE
47 flush_cache(0, XILINX_DCACHE_BYTE_SIZE);
52 void flush_cache (ulong addr, ulong size)
55 for (i = 0; i < size; i += 4)