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