AnsweredAssumed Answered

new SPI module interface to imx6DL board

Question asked by Srinivasa Rao Poram on Sep 3, 2015
Latest reply on Nov 23, 2015 by Le Tan

Hi,

We have ported Ubuntu to Wandboard Dual board  (IMX6DL)

 

While compiling we have enabled SPI support in the kernel. Also we have enabled ecspi in device before creating Device Tree Blob (dtb).

 

When we are issueing command from terminal

 

$zgrep SPI /proc/config.gz | grep -v SPIN | grep -v '^#'

 

It is giving output that SPI is enabled.

 

But when we are issueing another command from terminal like

 

$ dmesg | grep spi

 

then output is :

 

[10.886933] spi_imx : probe of 200c000.ecspi failed with error -22

[10.886987] spi_imx : probe of 2010000.ecspi failed with error -22

[10.887046] spi_imx : probe of 2014000.ecspi failed with error -22

 

and also when we checking in /dev we dont have any spidev0.0 or spidev1.0 etc.

 

I have added an entry for the spi device module in wandboard dtsi as follows(in imx6qdl.dtsi):

 

ecspi1: ecspi@02008000 {

#address-cells = <1>;

#size-cells = <0>;

compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";

reg = <0x02008000 0x4000>;

//interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;

clocks = <&clks IMX6QDL_CLK_ECSPI1>,

<&clks IMX6QDL_CLK_ECSPI1>;

 

  cs-gpios = <&gpio2 30 0>;

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

clock-names = "ipg", "per";

dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;

dma-names = "rx", "tx";

status = "okay";

 

  mpu9250@0 {

compatible = "invensense,mpu9250";

reg = <0>;

#address-cells = <1>;

#size-cells = <0>;

spi-max-frequency = <20000000>;

};

 

 

};

I tried change to mpu9250 to spidev and compatible="spidev" and also spi-max-frequency to 25000000, 24000000 also.

 

In IOMUX section i have included :

 

pinctrl_ecspi1: ecspi1grp {

fsl,pins = <

MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1

MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1

MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1

//ECSPI1_SS0 0x000b1MX6QDL_PAD_EIM_EB2__GPIO2_IO30 0x100b1 /* CS0 */

MX6QDL_PAD_EIM_EB2__GPIO2_IO30 0x100b1 /* CS0 */

 

>;

};

 

also

 

&ecspi1 {

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_ecspi1>;

cs-gpios = <&gpio2 30 0>;

status = "okay";

};

 

then generated dtb file and copied it to sd card. When booting to Ubuntu and checking in /dev, then no spidev0.0 . also how to confirm that our device tree file is correct only and there is problem with the hardware. is there any way to confirm that device tree is correct.

 

When we are issueing command to check spi as below:

 

$ dmesg | grep spi

 

then output is :

 

[10.886933] spi_imx : probe of 200c000.ecspi failed with error -22

[10.886987] spi_imx : probe of 2010000.ecspi failed with error -22

[10.887046] spi_imx : probe of 2014000.ecspi failed with error -22

 

and also when we checking in /dev we dont have any spidev0.0 or spidev1.0 etc.. what is error. how to resolve this

 

but is not showing anything about

 

spi_imx : probe of 2008000.ecspi

Outcomes