patch-2.1.53 linux/arch/sparc/kernel/devices.c

Next file: linux/arch/sparc/kernel/head.S
Previous file: linux/arch/sparc/config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.52/linux/arch/sparc/kernel/devices.c linux/arch/sparc/kernel/devices.c
@@ -53,8 +53,33 @@
 			}
 		};
 		if(cpu_ctr == 0) {
+			if (sparc_cpu_model == sun4d) {
+				scan = prom_getchild(prom_root_node);
+				for (scan = prom_searchsiblings(scan, "cpu-unit"); scan;
+				     scan = prom_searchsiblings(prom_getsibling(scan), "cpu-unit")) {
+					int node = prom_getchild(scan);
+					
+					prom_getstring(node, "device_type", node_str, sizeof(node_str));
+					if (strcmp(node_str, "cpu") == 0) {
+						prom_getproperty(node, "cpu-id", (char *) &thismid, sizeof(thismid));
+						if (cpu_ctr < NCPUS) {
+							cpu_nds[cpu_ctr] = node;
+							linux_cpus[cpu_ctr].prom_node = node;
+							linux_cpus[cpu_ctr].mid = thismid;
+						}
+						prom_printf("Found CPU %d <node=%08lx,mid=%d>\n",
+							    cpu_ctr, (unsigned long) node,
+							    thismid);
+						cpu_ctr++;
+					}
+				}
+			}
+			if (cpu_ctr > NCPUS)
+				cpu_ctr = NCPUS;
+		}
+		if(cpu_ctr == 0) {
 			printk("No CPU nodes found, cannot continue.\n");
-			/* Probably a sun4d or sun4e, Sun is trying to trick us ;-) */
+			/* Probably a sun4e, Sun is trying to trick us ;-) */
 			halt();
 		}
 		printk("Found %d CPU prom device tree node(s).\n", cpu_ctr);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov