xref: /OK3568_Linux_fs/kernel/arch/mips/mm/cex-gen.S (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun/*
2*4882a593Smuzhiyun * This file is subject to the terms and conditions of the GNU General Public
3*4882a593Smuzhiyun * License.  See the file "COPYING" in the main directory of this archive
4*4882a593Smuzhiyun * for more details.
5*4882a593Smuzhiyun *
6*4882a593Smuzhiyun * Copyright (C) 1995 - 1999 Ralf Baechle
7*4882a593Smuzhiyun * Copyright (C) 1999 Silicon Graphics, Inc.
8*4882a593Smuzhiyun *
9*4882a593Smuzhiyun * Cache error handler
10*4882a593Smuzhiyun */
11*4882a593Smuzhiyun#include <asm/asm.h>
12*4882a593Smuzhiyun#include <asm/regdef.h>
13*4882a593Smuzhiyun#include <asm/mipsregs.h>
14*4882a593Smuzhiyun#include <asm/stackframe.h>
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun/*
17*4882a593Smuzhiyun * Game over.  Go to the button.  Press gently.	 Swear where allowed by
18*4882a593Smuzhiyun * legislation.
19*4882a593Smuzhiyun */
20*4882a593Smuzhiyun	LEAF(except_vec2_generic)
21*4882a593Smuzhiyun	.set	noreorder
22*4882a593Smuzhiyun	.set	noat
23*4882a593Smuzhiyun	.set	mips0
24*4882a593Smuzhiyun	/*
25*4882a593Smuzhiyun	 * This is a very bad place to be.  Our cache error
26*4882a593Smuzhiyun	 * detection has triggered.  If we have write-back data
27*4882a593Smuzhiyun	 * in the cache, we may not be able to recover.	 As a
28*4882a593Smuzhiyun	 * first-order desperate measure, turn off KSEG0 cacheing.
29*4882a593Smuzhiyun	 */
30*4882a593Smuzhiyun	mfc0	k0,CP0_CONFIG
31*4882a593Smuzhiyun	li	k1,~CONF_CM_CMASK
32*4882a593Smuzhiyun	and	k0,k0,k1
33*4882a593Smuzhiyun	ori	k0,k0,CONF_CM_UNCACHED
34*4882a593Smuzhiyun	mtc0	k0,CP0_CONFIG
35*4882a593Smuzhiyun	/* Give it a few cycles to sink in... */
36*4882a593Smuzhiyun	nop
37*4882a593Smuzhiyun	nop
38*4882a593Smuzhiyun	nop
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun	j	cache_parity_error
41*4882a593Smuzhiyun	nop
42*4882a593Smuzhiyun	END(except_vec2_generic)
43