AnsweredAssumed Answered

How to add new SPI device to the device tree and compile it?

Question asked by lmhdoms on Apr 22, 2014
Latest reply on Jul 3, 2014 by Yixing Kong

Hello,

 

On the Wandboard Quad we have added an ENC28J60 SPI device to ESCPI3, SS0. I am using the kernel 3.10.17 and now I try to modify the dts in order for the kernel to detect and load the correct kernel module.

 

Here is the new entry in the imx6qdl-wandboard.dtsi:

&ecspi3 {

    fsl,spi-num-chipselects = <1>;

    cs-gpios = <0>;    /* <&gpio4 24 0>; */

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_ecspi3_1>;

    status = "okay";

 

    ethernet: enc28j60@0 {

        #address-cells = <1>;

        #size-cells = <1>;

        compatible = "microchip,enc28j60";

        spi-max-frequency = <20000000>;

        reg = <0>;

    };

}

 

And in the &iomuxc section added the SS pin function (MISO, MOSI, CLK already configured in imx6qdl.dtsi) :

 

ecspi3 {
   pinctrl_ecspi3_1: ecspi3grp-1 {
   fsl,pins = <
MX6QDL_PAD_DISP0_DAT3__ECSPI3_SS0    0x100b1   /* SS ENC28J60 */
   >;
   };

    };

 

When loading the kernel it correctly probes ECSPI3 and the enc28j60 driver is loaded. But probing the device fails:

enc28j60 spi32765.0: enc28j60 Ethernet driver 1.01 loaded

enc28j60 spi32765.0: enc28j60 chip not found

enc28j60: probe of spi32765.0 failed with error -5

 

Am I missing something in the dts? what does error -5 indicate?

 

In order to recompile the dtb I do "bitbake linux-wandboard -c install -f", but it takes time... so I tried "make imx6q-wandboard.dtb" but it initiates a kernel configuration prompt... what is the quickest way to recompile the dtb?

 

Thanks and regards,

Lars

Outcomes