Commit 95cbbcaa authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: support for ibm,phandle OF property, from Dave Engebretsen:

From: Anton Blanchard <anton@samba.org>

Upcoming partition firmware requires the use of the ibm,phandle property for
matching device nodes.  Add a new field in device_node to contain this data.
parent b9811b0a
...@@ -1444,6 +1444,23 @@ inspect_node(phandle node, struct device_node *dad, ...@@ -1444,6 +1444,23 @@ inspect_node(phandle node, struct device_node *dad,
*prev_propp = PTRUNRELOC(pp); *prev_propp = PTRUNRELOC(pp);
prev_propp = &pp->next; prev_propp = &pp->next;
} }
/* Add a "linux_phandle" value */
if (np->node) {
u32 ibm_phandle = 0;
int len;
/* First see if "ibm,phandle" exists and use its value */
len = (int)
call_prom(RELOC("getprop"), 4, 1, node, RELOC("ibm,phandle"),
&ibm_phandle, sizeof(ibm_phandle));
if (len < 0) {
np->linux_phandle = np->node;
} else {
np->linux_phandle = ibm_phandle;
}
}
*prev_propp = 0; *prev_propp = 0;
/* get the node's full name */ /* get the node's full name */
...@@ -1992,7 +2009,7 @@ find_phandle(phandle ph) ...@@ -1992,7 +2009,7 @@ find_phandle(phandle ph)
struct device_node *np; struct device_node *np;
for (np = allnodes; np != 0; np = np->allnext) for (np = allnodes; np != 0; np = np->allnext)
if (np->node == ph) if (np->linux_phandle == ph)
return np; return np;
return NULL; return NULL;
} }
......
...@@ -120,6 +120,7 @@ struct device_node { ...@@ -120,6 +120,7 @@ struct device_node {
char *name; char *name;
char *type; char *type;
phandle node; phandle node;
phandle linux_phandle;
int n_addrs; int n_addrs;
struct address_range *addrs; struct address_range *addrs;
int n_intrs; int n_intrs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment