AnsweredAssumed Answered

i.MX6ul ECSPI 32bit DMA transfer timeout

Question asked by Bob Lu on Apr 14, 2020
Latest reply on Apr 16, 2020 by Bob Lu

We are using rel_imx_4.1.15_2.1.0_ga version kernel.

And enable ecspi3/4 with spidev.

 

&ecspi3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi3>;
cs-gpios = <&gpio1 20 GPIO_ACTIVE_HIGH>;
status = "okay";
fsl,spi-num-chipselects = <1>;

spi_dev0: spi@0 {
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
status = "okay";
};
};

 

&ecspi4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi4>;
cs-gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
status = "okay";
fsl,spi-num-chipselects = <1>;

spi_dev1: spi@0 {
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
status = "okay";
};
};

 

Then tested with latest spidev_test linux/spidev_test.c at master · torvalds/linux · GitHub 

with following command line


./spidev_test -D /dev/spidev2.0 -b 32 -s 20000000 -S 1000 -I 3000

 

 which is 32bit transfers, 20MHz clk, 1000 size, and repeat 3000 times.

and lead to error like this:

 

root@phyboard-segin-imx6ul-2:~# ./spidev_test -D /dev/spidev2.0 -b 32 -s 20000000 -S 1000 -I 3000
root@phyboard-segin-imx6ul-2:~# spi mode: 0x0
bits per word: 32
max speed: 20000000 Hz (20000 KHz)
[ 186.453425] spi_master spi2: I/O Error in DMA RX:3e8
can't send spi message: Connectio[ 186.459584] spi_master spi2: failed to transfer one message from queue
n timed out

root@phyboard-segin-imx6ul-2:~#

 

but with

./spidev_test -D /dev/spidev2.0 -b 8 -s 20000000 -S 1000 -I 3000

 

it works:

root@phyboard-segin-imx6ul-2:~# ./spidev_test -D /dev/spidev2.0 -b 8 -s 20000000 -S 1000 -I 3000
root@phyboard-segin-imx6ul-2:~# spi mode: 0x0
bits per word: 8
max speed: 20000000 Hz (20000 KHz)
rate: tx 6702.4kbps, rx 6702.4kbps
rate: tx 7076.8kbps, rx 7076.8kbps
rate: tx 7075.2kbps, rx 7075.2kbps
rate: tx 7076.8kbps, rx 7076.8kbps
total: tx 19531.2KB, rx 19531.2KB

 

So 32bit transfer is not supported? Or it is spi dma which have trouble to support 32bit DMA? 

 

thanks.

Outcomes