Hi ,
I use imx6 ,linux kenerl version 4.1.15, I have patched "imx_add_spi_slave_mode.path" and I have two boards(one work in spi master, the other work in spi slave). when I use spidev_test the spi slave function, MOSI,CS and CLK have correct signal, but MISO line is no signal,why?
My configures are as follow:
1.Connect both boards SPI buses directly :
cs->cs
clk->clk
miso->miso
mosi->mosi
2.devicetree;
1) spi slave board
&ecspi1 {
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
spi-slave;
slave@0{
compatible = "rohm,dh2228fv";
spi-max-frequency = <20000000>;
reg = <0>;
};
};
imx6qdl-sabresd {
pinctrl_ecspi1: 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__ECSPI1_SS0 0x100b1
>;
};
2) spi master board:
&ecspi1 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 9 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
spidev:spidev@0{
compatible = "rohm,dh2228fv";
spi-max-frequency = <20000000>;
reg = <0>;
};
};
pinctrl_ecspi1: 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 0x1b0b0
>;
};
3. I run the spidev_test application on the slave board firstly:(at this momnet,all spi buses are no signals )
spidev_test -D /dev/spidev0.0 -p "SLAVE_HELLO_TO_MASTER" -v
and then run the spidev_test on the master board :(CS, CLK and MOSI have correct signals, but MISO's line no any signal)
spidev_test -D /dev/spidev0.0 -p "MASTER_HELLO_TO_SLAVE" -v
Can any one give me suggestion? thanks.
and I add the patch file to the attachment.