patch-2.4.20 linux-2.4.20/arch/mips/sibyte/sb1/cache_err_handler.S

Next file: linux-2.4.20/arch/mips/sibyte/sb1/cache_error.c
Previous file: linux-2.4.20/arch/mips/sibyte/cfe/smp.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/arch/mips/sibyte/sb1/cache_err_handler.S linux-2.4.20/arch/mips/sibyte/sb1/cache_err_handler.S
@@ -10,7 +10,7 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
@@ -20,6 +20,7 @@
 #include <asm/asm.h>
 #include <asm/regdef.h>
 #include <asm/mipsregs.h>
+#include <asm/sibyte/board.h>
 
 	.text
 	/* Special Cache Error handler for SB1 for now */
@@ -36,13 +37,12 @@
 	#.set	mips64
 	.set	mips4
 	.set	reorder
-	# look for signature of spurious CErr
+#ifdef CONFIG_SB1_CERR_IGNORE_RECOVERABLE
 	mfc0	k1, $26				# mfc0	k1, $26, 0
 	# check if error was recoverable
 	# XXXKW - count them
 	bltz	k1, leave_cerr
-	 nop
-
+#endif
 #ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
 	# look for signature of spurious CErr
 	lui	k0, 0x4000
@@ -51,13 +51,32 @@
 	lui	k0, 0xffe0
 	and	k1, k0, k1
 	lui	k0, 0x0200
-	bne	k0, k1, real_cerr
-	 nop
+	beq	k0, k1, leave_cerr
+	# XXXKW - count them
+#endif
+
+real_cerr:
+#ifdef CONFIG_SB1_CERR_SPIN
+        setleds(k0,k1,'C','E','R','R')
+
+1:	b	1b
 #else
-	j	real_cerr
-	 nop
+	mfc0	k0,CP0_CONFIG
+	li	k1,~CONF_CM_CMASK
+	and	k0,k0,k1
+	ori	k0,k0,CONF_CM_UNCACHED
+	mtc0	k0,CP0_CONFIG
+
+	SSNOP
+	SSNOP
+	SSNOP
+	SSNOP
+	bnezl	$0, 1f
+1:
+	j	sb1_cache_error
 #endif
-	# XXXKW - count spurious errors
+
+#if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || defined(CONFIG_SB1_CERR_IGNORE_RECOVERABLE)
 leave_cerr:
 	# clear/unlock the registers
 	mtc0	zero, $26			# mtc0	zero, $26, 0
@@ -65,23 +84,7 @@
 	.word	0x4080d801			# mtc0	zero, $27, 1
 	.word	0x4080d803			# mtc0	zero, $27, 3
 	eret
-
-real_cerr:
-	mfc0	k0, CP0_CONFIG
-	li	k1, ~CONF_CM_CMASK
-	and	k0, k0, k1
-	ori	k0, k0, CONF_CM_UNCACHED
-	mtc0	k0, CP0_CONFIG
-	/* Give it a few cycles to sink in... */
-	sll     zero, zero, 0x1			# ssnop
-	sll     zero, zero, 0x1			# ssnop
-	sll     zero, zero, 0x1			# ssnop
-	sll     zero, zero, 0x1			# ssnop
-	sll     zero, zero, 0x1			# ssnop
-	sll     zero, zero, 0x1			# ssnop
-
-	j	sb1_cache_error
-	 nop
+#endif
 
 	.set	pop
 	END(except_vec2_sb1)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)