Kernel devicetree overlay delete or clear a property

Snippet from a linux kernel main.dts device tree file built as main.dtb

&usb0 {
	status = "okay";
	dr_mode = "peripheral";
	interrupts-extended = <&intc 19 &tps 0>;
	interrupt-names = "mc", "vbus";
};

&usb1 {
	status = "okay";
	dr_mode = "host";
};

Here is the swap_usb.dts overlay built as swap_usb.dtbo

/dts-v1/;
/plugin/;

&usb0 {
	status = "okay";
	dr_mode = "host";
};

&usb1 {
	status = "okay";
	dr_mode = "peripheral";
	interrupts-extended = <&intc 19 &tps 0>;
	interrupt-names = "mc", "vbus";
};

Then the overlay is applied to the main DT.
dr_mode was updated.
The problem is that &usb0 node still has the ‘interrupts-extended’ and ‘interrupt-names’ properties.

When applying an overlay, how do you delete a property from the target node?
If you can’t delete the property, then can you clear or set the property to nothing, something like this?

interrupts-extended = < blank >
interrupt-names = < blank >

Thank you,

I would try:

/dts-v1/;
/plugin/;

&usb0 {
	status = "okay";
	dr_mode = "host";
	/delete-property/ interrupts-extended;
	/delete-property/ interrupt-names;
};

&usb1 {
	status = "okay";
	dr_mode = "peripheral";
	interrupts-extended = <&intc 19 &tps 0>;
	interrupt-names = "mc", "vbus";
};

Regards,

RCN,
kernel 6.1.132.
/delete-properties/ did not work as expected.

# usb1 is @1800
# the mode was changed from peripheral to host
cat /sys/firmware/devicetree/base/ocp/target-module@47400000/usb@1800/dr_mode
host
# but interrupt-names and interrupts-extended properties were not removed and contain the previous values
ls /sys/firmware/devicetree/base/ocp/target-module@47400000/usb@1800/
compatible  interrupt-names      mentor,num-eps   phandle    status
dma-names   interrupts           mentor,power     phys
dmas        interrupts-extended  mentor,ram-bits  reg
dr_mode     mentor,multipoint    name             reg-names
cat /sys/firmware/devicetree/base/ocp/target-module@47400000/usb@1800/interrupt-names 
mcvbus

Maybe I am missing a patch that added /delete-properties/?
Maybe I am missing passing a parameter during build. Here is my build command line.

time DTC_FLAGS=-@ make ARCH=arm CROSS_COMPILE=${CC} KBUILD_OUTPUT=./my_kernel

Thank you

I was a afraid of that… i thought it might atleast blank it out..

You’ll need to just create your own device-tree and drop using overlays for the usb0/usb1 switch..

Regards,

RCN,
It was a good try. I can understand why deleting a node/property could be difficult to implement because of trying to ‘roll back’ dependent node/properties.
Having a separate DT for the different board makes more sense.

BTW, I did find this old post referencing /delete-node’/, /delete-property/

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

I had an ‘ah ha’ day today. I have a my-main.dts which includes a my-common.dtsi. The word ‘common’ came from the BBB world of device trees but didn’t undertand the true meaning until today. Today I moved the &usb0 and &usb1 nodes out of my-common.dtsi into seperate my1-usb.dtsi and my2-usb.dtsi. I created a second my2-main.dts which included my-common.dtsi and the newly created my2-usb.dtsi. I edited my-main.dts to include my1-usb.dtsi. I can now build DT’s for both boards with an easy understanding of what is different. I know that is nothing new for experienced users, but it was new for me today.

Kindly,