SPI don't work on iMX6 - Linux

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SPI don't work on iMX6 - Linux

2,628件の閲覧回数
marco_padovani
Contributor II

Hi,

i have a problem with SPI on iMX6. I'm using a Congatec Module. The module mount a iMX6 Solo.

I want to configure ECSPI1 as a "spidev" device.

Initially the congatec dtsi was:

&ecspi1 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;
dma-names = "rx", "tx";
status = "okay";

flash: m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "st,sst25vf032b";
spi-max-frequency = <20000000>;
reg = <0>;

partition@0 {
label = "bootloader";
reg = <0x0000000 0x100000>;
};

partition@100000 {
label = "user";
reg = <0x0100000 0x2fc000>;
};

partition@3fc000 {
label = "reserved";
reg = <0x03fc000 0x4000>;
read-only;
};
};
};

And into  &iomuxc:

...

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
>;
};

I CHANGED THE DTSI SETTINGS:

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

spidev@0x00 {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "rohm,dh2228fv";
    spi-max-frequency = <20000000>;
    reg = <0>;

    };
};

and i changed also &iomuxc:

...

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

MX6QDL_PAD_EIM_D19__GPIO3_IO19  0X80000000
>;
};

I have verified the pin conflicts and was ok.

I have enabled the SPI support and i see spidev0.0 in linux.

For test the SPI port i used echo "hello" > /dev/spidev0.0 and spidevtest -v, and in both example not function.

The MISO, MOSI, CLK and CS was always at logic level 1. No signal change detected.

Anyone have an advice?

Thanks,

Marco

ラベル(2)
タグ(2)
0 件の賞賛
返信
3 返答(返信)

2,398件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Marco

for spidev description one can look at

VAR-SOM-MX6 SPI - Variscite Wiki 

Enabling SPI on DART-MX6 [SOLVED] - Variscite Forums 

Also one can try to remove sdma and check if ecspi1 clock is

enabled in CCM_CCGR1 register.

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

0 件の賞賛
返信

2,398件の閲覧回数
marco_padovani
Contributor II

Hi Igor, 

thanks for your support.

I can't use this configuration:

pinctrl_ecspi1_1: ecspi1grp {  fsl,pins = <   MX6QDL_PAD_KEY_COL1__ECSPI1_MISO 0x100b1   MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI 0x100b1   MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK 0x100b1   MX6QDL_PAD_KEY_ROW1__GPIO4_IO09      0x80000000  >; };

Because i have a conflicts with a uart5 for Row1 and Col1:

pinctrl_ecspi1_1: ecspi1grp {  fsl,pins = <   MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA 0x1b0b1   MX6QDL_PAD_KEY_COL1__UART5_TX_DATA 0x1b0b1  >; };

I removed sdma from ecspi. But, how can i check CCM_CCGR1 register? 

The congatec board using iMx6 Solo, but the pins name is "MX6QDL" (Stand for Dual Lite and Quad?).

For the Solo iMX6 processor is the same as Dual Lite and Quad? 

The others peripherals function correctly.

Thanks,

Marco

0 件の賞賛
返信

2,398件の閲覧回数
marco_padovani
Contributor II

I wrote a wrong pinctrl for Uart in previous message, this is correct:

pinctrl_uart5: uart5grp{      fsl,pins = < MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA     0x1b0b1           
                                           MX6QDL_PAD_KEY_COL1__UART5_TX_DATA     0x1b0b1      
>; };

Marco

0 件の賞賛
返信