1d4a67d9dSGabor Juhos /*
2d4a67d9dSGabor Juhos  *  Atheros AR71XX/AR724X/AR913X specific kernel entry setup
3d4a67d9dSGabor Juhos  *
4d4a67d9dSGabor Juhos  *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
5d4a67d9dSGabor Juhos  *
6d4a67d9dSGabor Juhos  *  This program is free software; you can redistribute it and/or modify it
7d4a67d9dSGabor Juhos  *  under the terms of the GNU General Public License version 2 as published
8d4a67d9dSGabor Juhos  *  by the Free Software Foundation.
9d4a67d9dSGabor Juhos  *
10d4a67d9dSGabor Juhos  */
11d4a67d9dSGabor Juhos #ifndef __ASM_MACH_ATH79_KERNEL_ENTRY_H
12d4a67d9dSGabor Juhos #define __ASM_MACH_ATH79_KERNEL_ENTRY_H
13d4a67d9dSGabor Juhos 
14d4a67d9dSGabor Juhos 	/*
15d4a67d9dSGabor Juhos 	 * Some bootloaders set the 'Kseg0 coherency algorithm' to
16d4a67d9dSGabor Juhos 	 * 'Cacheable, noncoherent, write-through, no write allocate'
17d4a67d9dSGabor Juhos 	 * and this cause performance issues. Let's go and change it to
18d4a67d9dSGabor Juhos 	 * 'Cacheable, noncoherent, write-back, write allocate'
19d4a67d9dSGabor Juhos 	 */
20d4a67d9dSGabor Juhos 	.macro	kernel_entry_setup
21d4a67d9dSGabor Juhos 	mfc0	t0, CP0_CONFIG
22d4a67d9dSGabor Juhos 	li	t1, ~CONF_CM_CMASK
23d4a67d9dSGabor Juhos 	and	t0, t1
24d4a67d9dSGabor Juhos 	ori	t0, CONF_CM_CACHABLE_NONCOHERENT
25d4a67d9dSGabor Juhos 	mtc0	t0, CP0_CONFIG
26d4a67d9dSGabor Juhos 	nop
27d4a67d9dSGabor Juhos 	.endm
28d4a67d9dSGabor Juhos 
29d4a67d9dSGabor Juhos 	.macro	smp_slave_setup
30d4a67d9dSGabor Juhos 	.endm
31d4a67d9dSGabor Juhos 
32d4a67d9dSGabor Juhos #endif /* __ASM_MACH_ATH79_KERNEL_ENTRY_H */
33