[OpenBIOS] [commit] r936 - trunk/openbios-devel/arch/ppc/qemu

repository service svn at openbios.org
Sun Oct 31 11:21:51 CET 2010


Author: afaerber
Date: Sun Oct 31 11:21:50 2010
New Revision: 936
URL: http://tracker.coreboot.org/trac/openbios/changeset/936

Log:
ppc: Don't set up RTAS for OldWorld Macs

According to historical device trees, pre-iMac Macs do not seem to
have the /rtas node.

Make /rtas conditional to NewWorld Macs for now, while allowing to
extend this to future CHRP machines.

This means that the ppc-softmmu would by default not have it,
except when using -M mac99. ppc64-softmmu would get it by default.

Signed-off-by: Andreas Färber <andreas.faerber at web.de>

Modified:
   trunk/openbios-devel/arch/ppc/qemu/init.c
   trunk/openbios-devel/arch/ppc/qemu/methods.c

Modified: trunk/openbios-devel/arch/ppc/qemu/init.c
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/init.c	Sun Oct 31 10:59:12 2010	(r935)
+++ trunk/openbios-devel/arch/ppc/qemu/init.c	Sun Oct 31 11:21:50 2010	(r936)
@@ -753,13 +753,19 @@
 	node_methods_init(buf);
 
 #ifdef CONFIG_RTAS
-	if( !(ph=find_dev("/rtas")) )
-		printk("Warning: No /rtas node\n");
-	else {
-		unsigned long size = 0x1000;
-		while( size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start )
-			size *= 2;
-		set_property( ph, "rtas-size", (char*)&size, sizeof(size) );
+	/* OldWorld Macs don't have an /rtas node. */
+	switch (machine_id) {
+	case ARCH_MAC99:
+	case ARCH_MAC99_U3:
+		if (!(ph = find_dev("/rtas"))) {
+			printk("Warning: No /rtas node\n");
+		} else {
+			unsigned long size = 0x1000;
+			while (size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start)
+				size *= 2;
+			set_property(ph, "rtas-size", (char*)&size, sizeof(size));
+		}
+		break;
 	}
 #endif
 

Modified: trunk/openbios-devel/arch/ppc/qemu/methods.c
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/methods.c	Sun Oct 31 10:59:12 2010	(r935)
+++ trunk/openbios-devel/arch/ppc/qemu/methods.c	Sun Oct 31 11:21:50 2010	(r936)
@@ -304,7 +304,9 @@
 {
 	phandle_t chosen, ph;
 #ifdef CONFIG_RTAS
-	REGISTER_NODE( rtas );
+	if (is_newworld()) {
+		REGISTER_NODE( rtas );
+	}
 #endif
 	REGISTER_NODE( ciface );
 	REGISTER_NODE( memory );



More information about the OpenBIOS mailing list