Skip to content

Commit

Permalink
[CELL] allow linux to map Cell regs on legacy SLOF tree.
Browse files Browse the repository at this point in the history
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@tribudubois.net>
Acked-by: Christian Krafft <krafft@de.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
  • Loading branch information
Jean-Christophe DUBOIS authored and Arnd Bergmann committed Jul 20, 2007
1 parent 827e364 commit b86ce01
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/powerpc/platforms/cell/cbe_regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ static struct device_node *cbe_get_be_node(int cpu_id)

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 (WARN_ON_ONCE(!cpu_handle))
return np;

for (i=0; i<len; i++)
if (of_find_node_by_phandle(cpu_handle[i]) == of_get_cpu_node(cpu_id, NULL))
return np;
Expand Down

0 comments on commit b86ce01

Please sign in to comment.