2 * LZMA compressed kernel loader for Atheros AR7XXX/AR9XXX based boards
4 * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
6 * The cache manipulation routine has been taken from the U-Boot project.
8 * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License version 2 as published
12 * by the Free Software Foundation.
20 #define cache_op(op,addr) \
21 __asm__ __volatile__( \
23 " .set noreorder \n" \
24 " .set mips3\n\t \n" \
28 : "i" (op), "R" (*(unsigned char *)(addr)))
30 void flush_cache(unsigned long start_addr, unsigned long size)
32 unsigned long lsize = CONFIG_CACHELINE_SIZE;
33 unsigned long addr = start_addr & ~(lsize - 1);
34 unsigned long aend = (start_addr + size - 1) & ~(lsize - 1);
37 cache_op(Hit_Writeback_Inv_D, addr);
38 cache_op(Hit_Invalidate_I, addr);