Unable to make ecspi2 work on SCM-i.MX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to make ecspi2 work on SCM-i.MX6

889 Views
marcooman
Contributor II

I am working with the QWKS-SCMIMX6DQ board and trying to test, at least partially ecspi2. So I have modified the device tree this way:

I have added an entry for this SPI (file imx6dqscm-qwks-rev2.dtsi)

&ecspi2 {
    fsl,spi-num-chipselects = <1>;
    cs-gpios = <&gpio5 12 0>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_ecspi2>;
    status = "okay";
    spidev0: spidev@0 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "rohm,dh2228fv";
        spi-max-frequency = <200000>;
        reg = <0>;
    };
};

and removed i2c1/pinctrl_i2c1 which uses the same pads  (CSI0_DAT8/CSI0_DAT9).

Then I added also pinctrl_ecspi2

        pinctrl_ecspi2: ecspi2grp {
            fsl,pins = <
                MX6QDL_PAD_DISP0_DAT17__ECSPI2_MISO 0x80000000
                MX6QDL_PAD_CSI0_DAT9__ECSPI2_MOSI 0x100b1
                MX6QDL_PAD_CSI0_DAT8__ECSPI2_SCLK 0x100b1
                MX6QDL_PAD_DISP0_DAT18__ECSPI2_SS0 0x100b1
            >;
        };

I can see in /dev that i2c-0 disappears and that I have a new device spidev1.0. So far so good.

The problem is that if I issue a command like

echo 123 >/dev/spidev1.0

then I do not see (with the probe) any activity on pins J11.10/J11.12 of the board.

I tried a different Device tree that makes use of ecspi1 and verified that echoing something gets the expected result on J2.12/10/8/6.

So my question is: there is something wrong with my Device Tree or is not possible to (ab)use the board this way?

(For example I see on the schematic that there is a 4.7k pull-up on J11.10, which is OK for a I2C but unsuited for a SPI, anyway I would expect to see some activity with the probe...)

Labels (2)
0 Kudos
2 Replies

530 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Marco,

have you seen this post? How to check if SPI is working? 

I think your pins are set incorrectly in the iomux you may check using the memtool

/unit_tests/memtool -32 IOMUXC.*


Regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

530 Views
marcooman
Contributor II

Thanks for the reply Carlos,

I double-checked the available pins and discovered that I could see ECSPI2_SS0 and ECSPI2_SCLK on the connector

So currently I have the following dts (just relevant secions):

&ecspi2 {
    fsl,spi-num-chipselects = <1>;
    cs-gpios = <&gpio5 12 0>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_ecspi2>;
    status = "okay";
    spidev0: spidev@0 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "rohm,dh2228fv";
        spi-max-frequency = <20000000>;
        reg = <0>;
    };
};

...

        pinctrl_ecspi2: ecspi2grp {
            fsl,pins = <
                MX6QDL_PAD_DISP0_DAT17__ECSPI2_MISO 0x100b1
                MX6QDL_PAD_DISP0_DAT16__ECSPI2_MOSI 0x100b1
                MX6QDL_PAD_DISP0_DAT19__ECSPI2_SCLK 0x100b1
            >;
        };

I can correctly see DISP0_DAT19 on the oscilloscope and GPIO5-12 (chip select) but not the other two, since they are no pads on the board for them.

0 Kudos