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

Yoder Stuart-B08248 B08248 at freescale.com
Tue Feb 23 03:13:40 EST 2010


> > 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.

   delete-prop   <stringlist>   The value identifies one or more names of
                                properties that should be deleted from the
                                node.

   delete-node   <stringlist>   The value identifies one or more names of
                                nodes that should be deleted. The node and
                                all descendants will be deleted.

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. 

                                    "prop-name1," "prop-value1,"
                                         "prop-name2," "propvalue2,"

                                    Each name/value pair consists of two
                                    strings-the first is the name of the
                                    property, the second is a string
                                    to prepend to the property. If the
                                    property does not already exist it will
                                    be created.

Examples

   / {
        parent {
                child1 {
                        new-property = "stuff";
                        delete-prop = "foo", "bar";
                };
        };
   };

   / {
        parent {
                child1 {
                        delete-node = "childA", "childB";
                };
        };
   };

   / {
        parent {
                child1 {
                        prepend-stringlist = "compatible", "fsl,foo-bar";
                };
        };
   };

Regards,
Stuart


More information about the devicetree-discuss mailing list