patch-2.3.99-pre7 linux/arch/ppc/kernel/prom.c

Next file: linux/arch/ppc/kernel/qspan_pci.c
Previous file: linux/arch/ppc/kernel/process.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre6/linux/arch/ppc/kernel/prom.c linux/arch/ppc/kernel/prom.c
@@ -106,7 +106,10 @@
 unsigned int rtas_size = 0;
 unsigned int old_rtas = 0;
 
+/* Set for a newworld machine */
 int use_of_interrupt_tree = 0;
+int pmac_newworld = 0;
+
 static struct device_node *allnodes = 0;
 
 #ifdef CONFIG_BOOTX_TEXT
@@ -802,7 +805,6 @@
 static void
 setup_disp_fake_bi(ihandle dp)
 {
-	unsigned int len;
 	int width = 640, height = 480, depth = 8, pitch;
 	unsigned address;
 	boot_infos_t* bi;
@@ -982,15 +984,17 @@
 finish_device_tree(void)
 {
 	unsigned long mem = (unsigned long) klimit;
-	char* model;
-	
-	/* Here, we decide if we'll use the interrupt-tree (new Core99 code) or not.
-	 * This code was only tested with Core99 machines so far, but should be easily
-	 * adapted to older newworld machines (iMac, B&W G3, Lombard).
-	 */
-	model = get_property(allnodes, "model", 0);
-	if ((boot_infos == 0) && model && (strcmp(model, "PowerBook2,1") == 0
-	    || strcmp(model, "PowerMac2,1") == 0 || strcmp(model, "PowerMac3,1") == 0))
+
+	/* All newworld machines now use the interrupt tree */
+	struct device_node *np = allnodes;
+	while(np) {
+		if (get_property(np, "interrupt-parent", 0)) {
+			pmac_newworld = 1;
+			break;
+		}
+		np = np->allnext;
+	}
+	if (boot_infos == 0 && pmac_newworld)
 		use_of_interrupt_tree = 1;
 
 	mem = finish_node(allnodes, mem, NULL);
@@ -1827,7 +1831,8 @@
 #ifdef CONFIG_XMON
 	xmon(NULL);
 #endif
-	prom_exit();
+	for (;;)
+		prom_exit();
 }
 
 #ifdef CONFIG_BOOTX_TEXT

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