[Cbe-oss-dev] [PATCH] allow linux to map Cell regs on legacy SLOF tree.

Jean-Christophe Dubois jdubois at mc.com
Tue Jun 26 22:59:32 EST 2007


The platforms missing the "cpus" property in the "be" node are mono-Cell platforms such as CAB or Getaway.

Therefore it is possible to assume that if there is no "cpus" properties under the "be" node then we can safely
return the "device node" without more checking. This is a bit hacky but ... it allows it to work on these 
platforms.

Signed-off-by: Jean-Christophe DUBOIS <jcd at tribudubois.net>

Index: linux-2.6.22-rc4/arch/powerpc/platforms/cell/cbe_regs.c
===================================================================
--- linux-2.6.22-rc4.orig/arch/powerpc/platforms/cell/cbe_regs.c
+++ linux-2.6.22-rc4/arch/powerpc/platforms/cell/cbe_regs.c
@@ -174,9 +174,13 @@ static struct device_node *cbe_get_be_no
 
 		cpu_handle = of_get_property(np, "cpus", &len);
 
+		/*
+		 * the CAB SLOF tree is non compliant, so we just assume
+		 * there is only one node
+		 */
 		if (!cpu_handle) {
 			WARN_ON_ONCE(!cpu_handle);
-			continue;
+			return np;
 		}
 
 		for (i=0; i<len; i++)



More information about the cbe-oss-dev mailing list