162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
362306a36Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
462306a36Sopenharmony_ci * for more details.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright (C) 1995 - 1999 Ralf Baechle
762306a36Sopenharmony_ci * Copyright (C) 1999 Silicon Graphics, Inc.
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci * Cache error handler
1062306a36Sopenharmony_ci */
1162306a36Sopenharmony_ci#include <asm/asm.h>
1262306a36Sopenharmony_ci#include <asm/regdef.h>
1362306a36Sopenharmony_ci#include <asm/mipsregs.h>
1462306a36Sopenharmony_ci#include <asm/stackframe.h>
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci/*
1762306a36Sopenharmony_ci * Game over.  Go to the button.  Press gently.	 Swear where allowed by
1862306a36Sopenharmony_ci * legislation.
1962306a36Sopenharmony_ci */
2062306a36Sopenharmony_ci	LEAF(except_vec2_generic)
2162306a36Sopenharmony_ci	.set	noreorder
2262306a36Sopenharmony_ci	.set	noat
2362306a36Sopenharmony_ci	.set	mips0
2462306a36Sopenharmony_ci	/*
2562306a36Sopenharmony_ci	 * This is a very bad place to be.  Our cache error
2662306a36Sopenharmony_ci	 * detection has triggered.  If we have write-back data
2762306a36Sopenharmony_ci	 * in the cache, we may not be able to recover.	 As a
2862306a36Sopenharmony_ci	 * first-order desperate measure, turn off KSEG0 cacheing.
2962306a36Sopenharmony_ci	 */
3062306a36Sopenharmony_ci	mfc0	k0,CP0_CONFIG
3162306a36Sopenharmony_ci	li	k1,~CONF_CM_CMASK
3262306a36Sopenharmony_ci	and	k0,k0,k1
3362306a36Sopenharmony_ci	ori	k0,k0,CONF_CM_UNCACHED
3462306a36Sopenharmony_ci	mtc0	k0,CP0_CONFIG
3562306a36Sopenharmony_ci	/* Give it a few cycles to sink in... */
3662306a36Sopenharmony_ci	nop
3762306a36Sopenharmony_ci	nop
3862306a36Sopenharmony_ci	nop
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci	j	cache_parity_error
4162306a36Sopenharmony_ci	nop
4262306a36Sopenharmony_ci	END(except_vec2_generic)
43