Wed Jul 27 22:04:23 2011 UTC ()
move clearing PSL_IP in ofwmsr back where it was - if we do it too early my
PowerBook 3400c hangs on startup.


(macallan)
diff -r1.9 -r1.10 src/sys/arch/powerpc/oea/ofw_subr.S
diff -r1.24 -r1.25 src/sys/arch/powerpc/oea/ofwoea_machdep.c

cvs diff -r1.9 -r1.10 src/sys/arch/powerpc/oea/ofw_subr.S (expand / switch to context diff)
--- src/sys/arch/powerpc/oea/ofw_subr.S 2011/06/12 16:35:10 1.9
+++ src/sys/arch/powerpc/oea/ofw_subr.S 2011/07/27 22:04:23 1.10
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_subr.S,v 1.9 2011/06/12 16:35:10 matt Exp $	*/
+/*	$NetBSD: ofw_subr.S,v 1.10 2011/07/27 22:04:23 macallan Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -34,6 +34,7 @@
 
 	.local	firmstk
 	.globl	openfirmware_entry
+	.globl	ofwmsr
 	.local	ofwsrsave
 	.local	OF_buffer
 
@@ -41,7 +42,7 @@
 	.lcomm	OF_buffer,NBPG,4
 	.comm	openfirmware_entry,4,4	/* openfirmware entry point */
 	.lcomm	ofwsrsave,64,4		/* openfirmware SR savearea */
-	.lcomm	ofwmsr,20,4		/* msr & sprg[0-3] used in OF */
+	.comm	ofwmsr,20,4		/* msr & sprg[0-3] used in OF */
 	.comm	ofwreal_incharge,4,4
 
 /*
@@ -67,8 +68,14 @@
 	stw	%r5,openfirmware_entry@l(%r8) /* save client interface handler*/
 
 	mfmsr	%r0
-	li	%r8,PSL_IP
-	andc	%r0,%r0,%r8			/* make sure PSL_IP is off */
+/*
+ * XXX
+ * doing this here instead of later on in ofwoea_initppc() after setting
+ * up the console and such makes my PowerBook 3400c hang.
+ * Probably just another OF 2.0 weirdness
+ */
+	/*li	%r8,PSL_IP*/
+	/*andc	%r0,%r0,%r8*/			/* make sure PSL_IP is off */
 	lis	%r9,ofwmsr@ha
 	stwu	%r0,ofwmsr@l(%r9)		/* save initial MSR value */
 

cvs diff -r1.24 -r1.25 src/sys/arch/powerpc/oea/ofwoea_machdep.c (expand / switch to context diff)
--- src/sys/arch/powerpc/oea/ofwoea_machdep.c 2011/07/17 23:23:54 1.24
+++ src/sys/arch/powerpc/oea/ofwoea_machdep.c 2011/07/27 22:04:23 1.25
@@ -1,4 +1,4 @@
-/* $NetBSD: ofwoea_machdep.c,v 1.24 2011/07/17 23:23:54 dyoung Exp $ */
+/* $NetBSD: ofwoea_machdep.c,v 1.25 2011/07/27 22:04:23 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.24 2011/07/17 23:23:54 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.25 2011/07/27 22:04:23 macallan Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_compat_netbsd.h"
@@ -119,6 +119,7 @@
 u_int timebase_freq = 0;
 #endif
 
+extern int ofwmsr;
 extern int chosen;
 extern uint32_t ticks_per_sec;
 extern uint32_t ns_per_tick;
@@ -200,6 +201,13 @@
 	ofmaplen = save_ofmap(NULL, 0);
 	if (ofmaplen > 0)
 		save_ofmap(ofmap, ofmaplen);
+
+/*
+ * XXX
+ * we need to do this here instead of earlier on in ofwinit() for some reason
+ * At least some versions of Apple OF 2.0.1 hang if we do this earlier
+ */ 
+	ofwmsr &= ~PSL_IP;
 
 	/* Parse the args string */
 	if (args) {