Delete &weim from device-tree with /delete-node/

Colibri iMX6DL
Colibri Eval Board

Because ECSPI1 and some GPIOs for my Rotary Encoder are on the Pins per default defined EIM_DATA01 to EIM_DATA15, I wanted to disable &weim in my device-tree.

/dts-v1/;

#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "imx6dl.dtsi"
#include "imx6qdl-colibri.dtsi"    // <<<< here in &iomuxc is &weim defined

/delete-node/ &weim;

&ecspi1 {
        fsl,spi-num-chipselects = <1>;
        cs-gpios = <&gpio5 25 0>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs1>;
        status = "okay";

        spidev1: spidev@1 {
                compatible = "spidev";
                reg = <0>;
                spi-max-frequency = <23000000>;
                status = "okay";
        };
};
&ecspi4 {
        status = "okay";

        fsl,spi-num-chipselects = <2>;
        cs-gpios = <&gpio5 2 0>,<&gpio1 2 0>;

        mcp251x0: mcp251x@1 {
                compatible = "microchip,mcp2515";
                reg = <0>;
                clocks = <&clk16m>;
                interrupt-parent = <&gpio3>;
                interrupts = <27 0x2>;
                spi-max-frequency = <10000000>;
                status = "disabled";
        };

        spidev0: spidev@1 {
                compatible = "spidev";
                reg = <0>;
                spi-max-frequency = <23000000>;
                status = "okay";
        };
};

&iomuxc {
        pinctrl-names = "default";
        pinctrl-0 = <
                &pinctrl_ecspi1
                &pinctrl_ecspi1_cs1
        >;

        ecspi1 {
                pinctrl_ecspi1: ecspi1grp {
                        fsl,pins = <
                                MX6QDL_PAD_CSI0_DAT4__ECSPI1_SCLK       PAD_CTRL_HYS_PU 
                                MX6QDL_PAD_CSI0_DAT5__ECSPI1_MOSI       PAD_CTRL_HYS_PU
                                MX6QDL_PAD_CSI0_DAT6__ECSPI1_MISO       PAD_CTRL_HYS_PU 
                        >;
                };
                pinctrl_ecspi1_cs1: ecspi_cs1 {
                        fsl,pins = <
                                MX6QDL_PAD_CSI0_DAT7__ECSPI1_SS0          PAD_CTRL_HYS_PU
                        >;
                };
        };

pinmuxing for ecspi4 is not needed, already default.

When inspecting the decompiled device-tree

dtc -I dtb -O dts -o decompiled_weim_test.dts ~/oe-core/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex/4.9-2.3.x+gitAUTOINC+57229263ff-r0/build/arch/arm/boot/dts/my_device_tree.dtb

&weim is still present.

...
...
...
                                weim {
                                        weim_cs0grp {
                                                fsl,pins = <0x13c 0x50c 0x0 0x0 0x0 0xb0b1>;
                                                linux,phandle = <0x46>;
                                                phandle = <0x46>;
                                        };
                                        weim_cs1grp {
                                                fsl,pins = <0x140 0x510 0x0 0x0 0x0 0xb0b1>;
                                                linux,phandle = <0x47>;
                                                phandle = <0x47>;
                                        };
...
...
...

So I tried removing the &weim by adding this to the device-tree

/dts-v1/;

#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "imx6dl.dtsi"
#include "imx6qdl-colibri.dtsi"

/delete-node/ &pinctrl_weim_cs0;
/delete-node/ &pinctrl_weim_cs1;
/delete-node/ &pinctrl_weim_cs2;
/delete-node/ &pinctrl_weim_sram_1;
/delete-node/ &pinctrl_weim_rdnwr_1;
/delete-node/ &pinctrl_weim_npwe_1;
/delete-node/ &pinctrl_weim_gpio_1;
/delete-node/ &pinctrl_weim_gpio_2;
/delete-node/ &pinctrl_weim_gpio_3;
/delete-node/ &pinctrl_weim_gpio_4;
/delete-node/ &pinctrl_weim_gpio_5;
/delete-node/ &pinctrl_weim_gpio_6;
/delete-node/ &weim;

now the decompiled devicetree file looks like this

...
...
      };

      weim {
      };

      ecspi1 {
...
...

weim is still there but all the pins are gone.
And the SPI on these pins is not working

[    1.151679] imx6dl-pinctrl 20e0000.iomuxc: pin MX6DL_PAD_CSI0_DAT4 already requested by 20e0000.iomuxc; cannot claim for 2008000.ecspi
[    1.163849] imx6dl-pinctrl 20e0000.iomuxc: pin-29 (2008000.ecspi) status -22
[    1.170930] imx6dl-pinctrl 20e0000.iomuxc: could not request pin 29 (MX6DL_PAD_CSI0_DAT4) from group ecspi1grp  on device 20e0000.iomuxc
[    1.183239] spi_imx 2008000.ecspi: Error applying setting, reverse things back
[    1.190508] spi_imx: probe of 2008000.ecspi failed with error -22

Hi @codeshredder726b !

This question seems quite similar to your other question, right? Please avoid creating more than one post per issue.

Thank you for your comprehension :slight_smile:

Best regards,