Subject: G5 support: Patches to fix a couple of issues (for review)
To: None <port-macppc@netbsd.org>
From: Sanjay Lal <sanjayl@kymasys.com>
List: port-macppc
Date: 08/19/2006 23:22:56
Hi, the following patches address a couple of issues with the G5 port.

(1) The 1st patch to failsafe.c  allows character input from the  
failsafe console device. This is the early console device that is  
used for output before the pmap layer is initialized.

(1) The 2nd patch to locore.S make sure that the size of the  
cacheline for dcbz is set to the default of 128 bytes. It also sets  
up other mode bits on the 970.  This fix allows the G5 to boot into  
full multi user mode using a NFS mounted root file system.

If there aren't any major objections, I'd like to check them into - 
current and have them pulled up into the netbsd-4 branch as well.

Thanks
Sanjay

Index: failsafe.c
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/macppc/failsafe.c,v
retrieving revision 1.1
diff -u -r1.1 failsafe.c
--- failsafe.c	5 Aug 2006 21:26:48 -0000	1.1
+++ failsafe.c	20 Aug 2006 06:05:50 -0000
@@ -128,8 +128,7 @@
failsafe_getc(dev_t dev)
{
      char ch = '\0';
-    if ((RMCI_readb(sccc) & SCC_RXRDY) == 0)
-        return -1;
+    while ((RMCI_readb(sccc) & SCC_RXRDY) == 0);
      ch = RMCI_readb(sccd);
      return ch;
@@ -139,8 +138,7 @@
static void
failsafe_probe(struct consdev *cd)
{
-    cd->cn_dev = makedev(70, 0);
-    cd->cn_pri = CN_INTERNAL;
+    cd->cn_pri = CN_REMOTE;
}
static void
@@ -148,12 +146,18 @@
{
}
+static void
+failsafe_pollc(dev_t dev, int on)
+{
+}
+
+
struct consdev failsafe_cons = {
      failsafe_probe,
      failsafe_init,
      failsafe_getc,
      failsafe_putc,
-    NULL,
+    failsafe_pollc,
      NULL,
};
Index: locore.S
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/macppc/locore.S,v
retrieving revision 1.56
diff -u -r1.56 locore.S
--- locore.S	15 Aug 2006 03:29:55 -0000	1.56
+++ locore.S	20 Aug 2006 06:05:50 -0000
@@ -103,7 +103,7 @@
1:
#endif
-#if defined (PMAC_G5)
+#if defined (PMAC_G5) || defined (MAMBO)
	 /* and clear HID5 DCBZ bits (56/57), need to do this early */
	mfspr	11,SPR_HID5
	rldimi	11,0,6,56