CVS commit: src/sys/arch/macppc/macppc

2019-10-24 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Oct 24 23:06:25 UTC 2019

Modified Files:
src/sys/arch/macppc/macppc: mainbus.c

Log Message:
if we have a /cpus node, use it to find and attach all CPUs.
Now we find all CPUs on a 4x G5.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/macppc/macppc/mainbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/macppc/macppc/mainbus.c
diff -u src/sys/arch/macppc/macppc/mainbus.c:1.21 src/sys/arch/macppc/macppc/mainbus.c:1.22
--- src/sys/arch/macppc/macppc/mainbus.c:1.21	Sun Jun  5 17:03:16 2011
+++ src/sys/arch/macppc/macppc/mainbus.c	Thu Oct 24 23:06:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:16 matt Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.22 2019/10/24 23:06:25 macallan Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.22 2019/10/24 23:06:25 macallan Exp $");
 
 #include 
 #include 
@@ -67,17 +67,29 @@ mainbus_attach(device_t parent, device_t
 {
 	struct ofbus_attach_args oba;
 	struct confargs ca;
-	int node, i;
+	int node, cpus, i;
 	u_int32_t reg[4];
 	char name[32];
 
 	printf("\n");
 
-	for (i = 0; i < 2; i++) {
-		ca.ca_name = "cpu";
-		ca.ca_reg = reg;
-		reg[0] = i;
-		config_found(self, , NULL);
+	cpus = OF_finddevice("/cpus");
+	if (cpus != 0) {
+		node = OF_child(cpus);
+		while (node != 0) {
+			ca.ca_name = "cpu";
+			ca.ca_reg = reg;
+			ca.ca_nreg = OF_getprop(node, "reg", reg, sizeof(reg));
+			config_found(self, , NULL);
+			node = OF_peer(node);
+		}			
+	} else {
+		for (i = 0; i < 2; i++) {
+			ca.ca_name = "cpu";
+			ca.ca_reg = reg;
+			reg[0] = i;
+			config_found(self, , NULL);
+		}
 	}
 
 	pic_finish_setup();



CVS commit: src/sys/arch/macppc/macppc

2019-10-24 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Oct 24 23:06:25 UTC 2019

Modified Files:
src/sys/arch/macppc/macppc: mainbus.c

Log Message:
if we have a /cpus node, use it to find and attach all CPUs.
Now we find all CPUs on a 4x G5.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/macppc/macppc/mainbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/arch/macppc/macppc

2019-10-11 Thread Sevan Janiyan



On 11/10/2019 22:56, Michael Lorenz wrote:
> first step to address PR2231

PR22316
http://gnats.netbsd.org/22316


Sevan


CVS commit: src/sys/arch/macppc/macppc

2019-10-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Oct 11 21:56:55 UTC 2019

Modified Files:
src/sys/arch/macppc/macppc: locore.S

Log Message:
don't zero the MSR when building with options FIRMWORKSBUGS
with this a FIRMWORKSBUGS kernel boots on my TiBook
first step to address PR2231


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/macppc/macppc/locore.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/macppc/macppc/locore.S
diff -u src/sys/arch/macppc/macppc/locore.S:1.73 src/sys/arch/macppc/macppc/locore.S:1.74
--- src/sys/arch/macppc/macppc/locore.S:1.73	Sun Jul 15 05:16:43 2018
+++ src/sys/arch/macppc/macppc/locore.S	Fri Oct 11 21:56:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.73 2018/07/15 05:16:43 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.74 2019/10/11 21:56:55 macallan Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -87,7 +87,9 @@ __start:
 	bl	_C_LABEL(cpu_model_init)	/* init oeacpufeat */
 
 	li	0,0
+#ifndef FIRMWORKSBUGS
 	mtmsr	0			/* Disable FPU/MMU/exceptions */
+#endif
 #if defined(PMAP_OEA64_BRIDGE)
 	mfmsr	0			/* Clear SF and ISF bits */
 	clrldi	0,0,3



CVS commit: src/sys/arch/macppc/macppc

2019-10-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Oct 11 21:56:55 UTC 2019

Modified Files:
src/sys/arch/macppc/macppc: locore.S

Log Message:
don't zero the MSR when building with options FIRMWORKSBUGS
with this a FIRMWORKSBUGS kernel boots on my TiBook
first step to address PR2231


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/macppc/macppc/locore.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.