2018-08-14 14:51:00

by Zhang Bo

[permalink] [raw]
Subject: How delete node or property in overlayd dts?

/delete-node/ /delete-prop/ could be used in dtsi files without device
tree overlay.

but with device tree overlay, /delete-node/ and /delete-prop/ are not work.
How to delete property and node in overlay dts?

for example,
in basel.dts have following node
node1 {
property1;
property3;
node2 {
property2;
}
}

in overlay.dts as following
node1 {
/delete-property/ property1;
/delete-node/ node2;
}

after overlay, property1 and node2 is not deleted.


2018-08-15 01:27:32

by Frank Rowand

[permalink] [raw]
Subject: Re: How delete node or property in overlayd dts?

On 08/14/18 07:46, 张波 wrote:
> /delete-node/ /delete-prop/ could be used in dtsi files without device
> tree overlay.
>
> but with device tree overlay, /delete-node/ and /delete-prop/ are not work.
> How to delete property and node in overlay dts?
>
> for example,
> in basel.dts have following node
> node1 {
> property1;
> property3;
> node2 {
> property2;
> }
> }
>
> in overlay.dts as following
> node1 {
> /delete-property/ property1;
> /delete-node/ node2;
> }
>
> after overlay, property1 and node2 is not deleted.
>

The /delete-node/ and /delete-prop/ directives are only used by the
dtc compiler within a single compilation.

There is nothing in the format of a devicetree blob to represent the
notion of deleting a property or a node.

You can not delete a property or a node in an overlay dtb.

2018-08-17 17:49:20

by Rob Herring

[permalink] [raw]
Subject: Re: How delete node or property in overlayd dts?

On Tue, Aug 14, 2018 at 7:26 PM Frank Rowand <[email protected]> wrote:
>
> On 08/14/18 07:46, 张波 wrote:
> > /delete-node/ /delete-prop/ could be used in dtsi files without device
> > tree overlay.
> >
> > but with device tree overlay, /delete-node/ and /delete-prop/ are not work.
> > How to delete property and node in overlay dts?
> >
> > for example,
> > in basel.dts have following node
> > node1 {
> > property1;
> > property3;
> > node2 {
> > property2;
> > }
> > }
> >
> > in overlay.dts as following
> > node1 {
> > /delete-property/ property1;
> > /delete-node/ node2;
> > }
> >
> > after overlay, property1 and node2 is not deleted.
> >
>
> The /delete-node/ and /delete-prop/ directives are only used by the
> dtc compiler within a single compilation.
>
> There is nothing in the format of a devicetree blob to represent the
> notion of deleting a property or a node.
>
> You can not delete a property or a node in an overlay dtb.

Though you can add/override 'status' with 'status = "disabled";' which
should be treated very similar to a node not being present. I say
similar because it's a source of bugs for the OS to fail to pay
attention to status property.

Rob

2018-08-18 10:40:14

by Zhang Bo

[permalink] [raw]
Subject: Re: How delete node or property in overlayd dts?


在 2018/8/18 1:47, Rob Herring 写道:
> On Tue, Aug 14, 2018 at 7:26 PM Frank Rowand <[email protected]> wrote:
>> On 08/14/18 07:46, 张波 wrote:
>>> /delete-node/ /delete-prop/ could be used in dtsi files without device
>>> tree overlay.
>>>
>>> but with device tree overlay, /delete-node/ and /delete-prop/ are not work.
>>> How to delete property and node in overlay dts?
>>>
>>> for example,
>>> in basel.dts have following node
>>> node1 {
>>> property1;
>>> property3;
>>> node2 {
>>> property2;
>>> }
>>> }
>>>
>>> in overlay.dts as following
>>> node1 {
>>> /delete-property/ property1;
>>> /delete-node/ node2;
>>> }
>>>
>>> after overlay, property1 and node2 is not deleted.
>>>
>> The /delete-node/ and /delete-prop/ directives are only used by the
>> dtc compiler within a single compilation.
>>
>> There is nothing in the format of a devicetree blob to represent the
>> notion of deleting a property or a node.
>>
>> You can not delete a property or a node in an overlay dtb.
> Though you can add/override 'status' with 'status = "disabled";' which
> should be treated very similar to a node not being present. I say
> similar because it's a source of bugs for the OS to fail to pay
> attention to status property.

there is document in
https://android.googlesource.com/kernel/msm/+/android-7.0.0_r0.11/Documentation/devicetree/overlay-notes.txt,

In above document, remove node or property by adding - operator before
node or property. but I didn't find it in released kernel source code,
Is there any update plan about this problem?

{

    property-a;       /* add property-a to the target */

    -proptery-b;     /* remove property-b from the target */

    -node-b {          /* remove an exiting node-b */

        ...

    }

}


2018-08-19 06:14:16

by Frank Rowand

[permalink] [raw]
Subject: Re: How delete node or property in overlayd dts?

On 08/18/18 03:38, Zhang Bo wrote:
>
> 在 2018/8/18 1:47, Rob Herring 写道:
>> On Tue, Aug 14, 2018 at 7:26 PM Frank Rowand <[email protected]> wrote:
>>> On 08/14/18 07:46, 张波 wrote:
>>>> /delete-node/ /delete-prop/ could be used in dtsi files without device
>>>> tree overlay.
>>>>
>>>> but with device tree overlay,  /delete-node/ and  /delete-prop/ are not work.
>>>> How to delete property and node in overlay dts?
>>>>
>>>> for example,
>>>> in basel.dts have following node
>>>> node1 {
>>>>      property1;
>>>>      property3;
>>>>      node2 {
>>>>          property2;
>>>>      }
>>>> }
>>>>
>>>> in overlay.dts as following
>>>>   node1 {
>>>>      /delete-property/ property1;
>>>>      /delete-node/ node2;
>>>> }
>>>>
>>>> after overlay, property1 and node2 is not deleted.
>>>>
>>> The /delete-node/ and /delete-prop/ directives are only used by the
>>> dtc compiler within a single compilation.
>>>
>>> There is nothing in the format of a devicetree blob to represent the
>>> notion of deleting a property or a node.
>>>
>>> You can not delete a property or a node in an overlay dtb.
>> Though you can add/override 'status' with 'status = "disabled";' which
>> should be treated very similar to a node not being present. I say
>> similar because it's a source of bugs for the OS to fail to pay
>> attention to status property.
>
> there is document in https://android.googlesource.com/kernel/msm/+/android-7.0.0_r0.11/Documentation/devicetree/overlay-notes.txt>
> In above document, remove node or property by adding - operator before node or property. but I didn't find it in released kernel source code, Is there any update plan about this problem?
>
> {
>
>     property-a;       /* add property-a to the target */
>
>     -proptery-b;     /* remove property-b from the target */
>
>     -node-b {          /* remove an exiting node-b */
>
>         ...
>
>     }
>
> }
>
>

As far as I can tell, this version of overlay-notes.txt has never been
in the mainline kernel source.

There is no plan to support such a syntax.

-Frank