93751c311ad00f01bda30e09cb376fd3f64f74fc
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.
21 #define cache_op(op,addr) \
22 __asm__ __volatile__( \
24 " .set noreorder \n" \
25 " .set mips3\n\t \n" \
29 : "i" (op), "R" (*(unsigned char *)(addr)))
31 void flush_cache(unsigned long start_addr
, unsigned long size
)
33 unsigned long lsize
= CONFIG_CACHELINE_SIZE
;
34 unsigned long addr
= start_addr
& ~(lsize
- 1);
35 unsigned long aend
= (start_addr
+ size
+ (lsize
- 1)) & ~(lsize
- 1);
37 printf("blasting from 0x%08x to 0x%08x (0x%08x - 0x%08x)\n", start_addr
, size
, addr
, aend
);
40 cache_op(Hit_Writeback_Inv_D
, addr
);
41 cache_op(Hit_Invalidate_I
, addr
);