[PATCH 8/9 V3] Add documentation for the new DTS language.

Scott Wood scottwood at freescale.com
Sat Oct 4 01:27:01 EST 2008


On Fri, Oct 03, 2008 at 12:24:24PM +1000, David Gibson wrote:
> > And if you want the number of somethings to be easily tweakable, you may  
> > need to do #include/#ifdef recursion.
> 
> Yes, we'd certainly need some sort of iteration operator in the
> expressions for this sort of thing.

OK, but now we're talking about something more complex than running it
through CPP with some character conversion.

A more powerful macro language is certainly an option, though I have a
personal preference for the semantic approach.

> >> If anything I think it's more powerful, because the macro
> >> boundaries can be anywhere, not only at the edges of particular
> >> semantic constructs.
> >
> > Is that useful outside the International Obfuscated DTC Contest?
> 
> Maybe.  I can see uses for both this style:
> 	mynodename at 12345 NODE_CONTENTS_MACRO(x,y,z);
> and this style:
> 	NODE_MACRO(p,q,r);
> where the macro generates the name as well.
> 
> Both are trivially possible with macros, but would need different
> types of definition with a runtime system, which increases complexity.

You can do this in the proposed language by either defining a function
that takes the node name/unit address as a parameter, or by defining a
function that returns a set of properties.

-Scott



More information about the devicetree-discuss mailing list