1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2d4a67d9dSGabor Juhos /*
3d4a67d9dSGabor Juhos  *  Atheros AR71XX/AR724X/AR913X specific kernel entry setup
4d4a67d9dSGabor Juhos  *
5d4a67d9dSGabor Juhos  *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
6d4a67d9dSGabor Juhos  */
7d4a67d9dSGabor Juhos #ifndef __ASM_MACH_ATH79_KERNEL_ENTRY_H
8d4a67d9dSGabor Juhos #define __ASM_MACH_ATH79_KERNEL_ENTRY_H
9d4a67d9dSGabor Juhos 
10d4a67d9dSGabor Juhos 	/*
11d4a67d9dSGabor Juhos 	 * Some bootloaders set the 'Kseg0 coherency algorithm' to
12d4a67d9dSGabor Juhos 	 * 'Cacheable, noncoherent, write-through, no write allocate'
13d4a67d9dSGabor Juhos 	 * and this cause performance issues. Let's go and change it to
14d4a67d9dSGabor Juhos 	 * 'Cacheable, noncoherent, write-back, write allocate'
15d4a67d9dSGabor Juhos 	 */
16d4a67d9dSGabor Juhos 	.macro	kernel_entry_setup
17d4a67d9dSGabor Juhos 	mfc0	t0, CP0_CONFIG
18d4a67d9dSGabor Juhos 	li	t1, ~CONF_CM_CMASK
19d4a67d9dSGabor Juhos 	and	t0, t1
20d4a67d9dSGabor Juhos 	ori	t0, CONF_CM_CACHABLE_NONCOHERENT
21d4a67d9dSGabor Juhos 	mtc0	t0, CP0_CONFIG
22d4a67d9dSGabor Juhos 	nop
23d4a67d9dSGabor Juhos 	.endm
24d4a67d9dSGabor Juhos 
25d4a67d9dSGabor Juhos 	.macro	smp_slave_setup
26d4a67d9dSGabor Juhos 	.endm
27d4a67d9dSGabor Juhos 
28d4a67d9dSGabor Juhos #endif /* __ASM_MACH_ATH79_KERNEL_ENTRY_H */
29