Proposal: new device-tree syntax and semantics for extendinginformation from included dts files
David Gibson
david at gibson.dropbear.id.au
Thu Oct 14 11:45:50 EST 2010
On Wed, Oct 13, 2010 at 04:41:59PM -0700, Stephen Neuendorffer wrote:
[snip]
> > I'm not thrilled with the example because it still shows the empty
> > braces which could be construed as the node still being present. How
> > about this syntax instead:
> > serial at 2800 /remove-node/;
> >
> > I also wonder if it would be better to have the directives before the
> > node name. ie:
> > /extend/ node1 { ... };
> > /replace/ node1 { ... };
> > /remove/ node1;
>
> Or better yet, outside of the braces?
>
> / {
> soc: soc5200 at f0000000 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "fsl,mpc5200b-immr";
> ...
>
> serial at 2600 { // PSC4
> compatible =
> "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
> reg = <0x2600 0x100>;
> interrupts = <2 11 0>;
> };
>
> serial at 2800 { // PSC5
> compatible =
> "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
> reg = <0x2800 0x100>;
> interrupts = <2 12 0>;
> };
> };
> /remove/ {
> serial at 2600 { }; // PSC4
>
> serial at 2800 { }; // PSC5
> };
Um.. no. That makes even less sense in the conceptual framework of a
stack of overlays.
> I agree the empty braces are wierd.... And perhaps ambiguous (does this
> mean remove the node, or remove the empty set of properties from the
> node)?
Yes.
> When I've done this in the past, it seemed to make the most sense if
> remove always applied to a specific, named node (and sub-children) or
> property.
> Is removing an entire node even interesting? (is there an interesting
> ambiguity in .dts between
> an empty node and a non-existent one?)
Well, the difference is well defined in both dts and the output dtb
format. Whether device tree users are likely to care is another
question, but I think the answer is still yes, at least in some cases.
> Personally, I hope to avoid replace and remove, since it is difficult to
> tell if
> assumptions about which nodes may be present in an included file if
> parts of the tree
> start getting removed.
Hrm, that's a point. We may want to make a distinction between the
operations "delete and give an error if it wasn't there before" and
"delete if present".
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
More information about the devicetree-discuss
mailing list