i.MX6ul ECSPI 32bit DMA transfer timeout

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

i.MX6ul ECSPI 32bit DMA transfer timeout

Jump to solution
1,365 Views
boblu
Contributor I

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.

Labels (1)
Tags (3)
0 Kudos
1 Solution
1,238 Views
igorpadykov
NXP Employee
NXP Employee

Hi Bob

L4.1.15_2.1.0 is old kernel, since then more improvements were added

for spi-imx, for example in next L4.9.11 commits:

linux-imx - i.MX Linux kernel 

linux-imx - i.MX Linux kernel 

linux-imx - i.MX Linux kernel 

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

View solution in original post

0 Kudos
2 Replies
1,239 Views
igorpadykov
NXP Employee
NXP Employee

Hi Bob

L4.1.15_2.1.0 is old kernel, since then more improvements were added

for spi-imx, for example in next L4.9.11 commits:

linux-imx - i.MX Linux kernel 

linux-imx - i.MX Linux kernel 

linux-imx - i.MX Linux kernel 

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

0 Kudos
1,238 Views
boblu
Contributor I

Igor:

I tried imx_4.14.98_2.3.0 branch, it works, thanks.

linux-imx - i.MX Linux kernel 

0 Kudos