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

Grant Likely grant.likely at secretlab.ca
Tue Feb 23 08:59:25 EST 2010


On Mon, Feb 22, 2010 at 9:13 AM, Yoder Stuart-B08248
<B08248 at freescale.com> wrote:
>
>> > That still leaves node and property deletion to cover.  In keeping
>> > with the above approach, I'd like to do that in the form of
>> "negative
>> > redefinitions" of properties or nodes.  A neat syntax for
>> that doesn't
>> > immediately occur to be for that yet, though.
>>
>> hmmm.  I'll think more about it too.  I agree that a negative
>> redefinition sounds like a reasonable approach.  I do want the ability
>> to drop nodes easily.  It would make it easy to handle SoC or FPGA
>> design variants.
>
> We had a similar problem in the Freescale Embedded Hypervisor
> to control the generation of guest device trees.   We defined
> several 'magic' properties that had special meaning in
> the context of a node update.

heh, so the functionality is definitely needed, but boy is that ugly!
:-)  I really do think there needs to be a syntactically distinct
method of deleting nodes and properties.  Magic property names that
look like normal properties worry me.

What about something like this:  Right now nodes are defined by <name>
{ [<property>|<node>]; ... }; and properties are defined by <name>; or
<name> = <value>;  To differentiate a command from either a node or
property definition, perhaps round braces could be used:

so for the definition:
a-node {
        property-1;
        property-2 = "blah";
        child-1 {
                ...
        };
};

you could delete property-2 and node-1 with:
a-node {
        delete-node(child-1);
        delete-property(property-2);
};

> We also had the need to prepend to a <stringlist> so that
> compatible properties could be updated.
>
>   prepend-stringlist  <stringlist> The value is a string list that
>                                    specifies on or more property name/value
>                                    pairs.

This is a bit of a harder problem.  I've go no ideas on how to handle
this in a syntactically elegant way.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.


More information about the devicetree-discuss mailing list