Proposal: new device-tree syntax and semantics for extendinginformation from included dts files

Stephen Neuendorffer stephen.neuendorffer at xilinx.com
Thu Oct 14 10:41:59 EST 2010


> /remove-node/?
> 
> >
> > 	This directive provides a simple clear method for removing nodes
that
> > 	were previously defined.
> >
> > 	Exmaple:
> > 		/ {
> > 			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>;
> > 				};
> >
> >
> > 				serial at 2600 /remove/ { };
// PSC4
> >
> > 				serial at 2800 /remove/ { };
// PSC5
> > 		};
> 
> Ditto on fixing example.
> 
> 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
 		};

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)?
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?)

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.

Steve




This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.




More information about the devicetree-discuss mailing list