patch-2.3.30 linux/arch/ppc/kernel/head.S

Next file: linux/arch/ppc/kernel/head_4xx.S
Previous file: linux/arch/ppc/kernel/gemini_setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.29/linux/arch/ppc/kernel/head.S linux/arch/ppc/kernel/head.S
@@ -137,7 +137,7 @@
 #endif	
 /*
  * We have to do any OF calls before we map ourselves to KERNELBASE,
- * because OF may have I/O devices mapped in in that area
+ * because OF may have I/O devices mapped into that area
  * (particularly on CHRP).
  */
 	mr	r31,r3			/* save parameters */
@@ -444,7 +444,9 @@
 	STD_EXCEPTION(0xd00, SingleStep, SingleStepException)
 
 	STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
+#ifdef CONFIG_ALTIVEC	
 	STD_EXCEPTION(0xf20, AltiVec, AltiVecUnavailable)
+#endif /* CONFIG_ALTIVEC */
 
 /*
  * Handle TLB miss for instruction on 603/603e.
@@ -1166,7 +1168,6 @@
 	mtspr	SRR0,r3
 	mtspr	SRR1,r4
 	rfi
-
 #endif /* CONFIG_SMP */
 
 /*
@@ -1351,6 +1352,42 @@
 	SYNC
 	blr
 
+/* 
+ * An undocumented "feature" of 604e requires that the v bit
+ * be cleared before changing BAT values.
+ *
+ * Also, newer IBM firmware does not clear bat3 and 4 so
+ * this makes sure it's done.
+ *  -- Cort 
+ */
+clear_bats:
+#if !defined(CONFIG_GEMINI)
+	li	r20,0
+	mfspr	r9,PVR
+	rlwinm	r9,r9,16,16,31		/* r9 = 1 for 601, 4 for 604 */
+	cmpwi	r9, 1
+	beq	1f
+	
+	mtspr	DBAT0U,r20
+	mtspr	DBAT0L,r20	
+	mtspr	DBAT1U,r20
+	mtspr	DBAT1L,r20
+	mtspr	DBAT2U,r20
+	mtspr	DBAT2L,r20	
+	mtspr	DBAT3U,r20
+	mtspr	DBAT3L,r20
+1:	
+	mtspr	IBAT0U,r20
+	mtspr	IBAT0L,r20
+	mtspr	IBAT1U,r20
+	mtspr	IBAT1L,r20
+	mtspr	IBAT2U,r20
+	mtspr	IBAT2L,r20
+	mtspr	IBAT3U,r20
+	mtspr	IBAT3L,r20
+#endif /* !defined(CONFIG_GEMINI) */
+	blr
+
 /*
  * We put a few things here that have to be page-aligned.
  * This stuff goes at the beginning of the data segment,
@@ -1374,45 +1411,3 @@
 	.globl	cmd_line
 cmd_line:
 	.space	512
-	
-/* 
- * An undocumented "feature" of 604e requires that the v bit
- * be cleared before changing BAT values.
- *
- * Also, newer IBM firmware does not clear bat3 and 4 so
- * this makes sure it's done.
- *  -- Cort 
- */
-clear_bats:
-	mfmsr	r20
-	andi.	r19,r20,MSR_DR
-	beqlr
-	
-	li	r20,0
-	
-	mtspr	DBAT0U,r20
-	mtspr	DBAT0L,r20
-	mtspr	IBAT0U,r20
-	mtspr	IBAT0L,r20
-	sync
-	isync
-	
-	mtspr	DBAT1U,r20
-	mtspr	DBAT1L,r20
-	mtspr	IBAT1U,r20
-	mtspr	IBAT1L,r20
-	sync
-	isync	
-
-	mtspr	DBAT2U,r20
-	mtspr	DBAT2L,r20
-	mtspr	IBAT2U,r20
-	mtspr	IBAT2L,r20
-	
-	mtspr	DBAT3U,r20
-	mtspr	DBAT3L,r20
-	mtspr	IBAT3U,r20
-	mtspr	IBAT3L,r20
-	
-	blr
-

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