Thread (1 message) 1 message, 1 author, 2008-10-27

RE: generating a phandle w/libfdt?

From: Yoder Stuart <hidden>
Date: 2008-10-27 15:14:48

Possibly related (same subject, not in this thread)

 
-----Original Message-----
From: David Gibson [mailto:david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org] 
Sent: Sunday, October 26, 2008 6:41 PM
To: Yoder Stuart-B08248
Cc: Kumar Gala; devicetree-discuss
Subject: Re: generating a phandle w/libfdt?

On Fri, Oct 24, 2008 at 09:29:21AM -0700, Yoder Stuart wrote:
quoted
 
quoted
-----Original Message-----
From: 
devicetree-discuss-bounces+stuart.yoder=freescale.com@ozlabs.o
rg 
[mailto:devicetree-discuss-bounces+stuart.yoder=freescale.com@
ozlabs.org] On Behalf Of Kumar Gala
quoted
Sent: Friday, October 24, 2008 9:19 AM
To: devicetree-discuss
Subject: Re: generating a phandle w/libfdt?


On Oct 24, 2008, at 8:11 AM, Kumar Gala wrote:
quoted
In some work I'm doing I noticed we don't have any APIs to 
generate  
quoted
a phandle via libfdt.

was wondering if anyone had ideas on this.

In first thought it seems we have to scan through the 
whole blob  
quoted
quoted
quoted
looking for the largest phandle id and than +1 it to 
generate the  
quoted
quoted
quoted
next "valid" id.  Any other ideas on how to do this more 
efficiently?

The other question is there a way today to create a 
phandle even if  
quoted
quoted
there isn't a reference to it elsewhere in a .dts?
We had this issue and the 'hack' was to create a phandle property
in the node itself, so it was self-referenced.  That caused DTC
to allocate a phandle.   We then could reference the node from
dynamically generated nodes.
That's nasty.  I should add a way to make dtc generate a phandle for a
node, even if it's not referenced from elsewhere.  Just need to think
of a decent syntax.
We could add a flag to DTC to generate phandles for all 
nodes.

Only downside I can see is an additional 4 bytes per node.

Stuart
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help