Hi there,
I am trying to use spi3 of this device to send data to a spi slave. When I send date byte less than 64 bytes it is OK. But when I send more than 64 byte I got error:
[ 115.830065] spi_master spi2: I/O Error in DMA RX:400
[ 115.841541] spi_master spi2: failed to transfer one message from queue
cos I need a fast speed I want to send one message(transfer) bigger than 64B. Is there anyway to do this?
other questions:
1. what is the largest number of DMA transfer? is it max_dma_len = 32768?
2. I am using spi3 but I saw the error report spi2. Is there anything related to this failure?
following is the dts I am using.
is there anyone who find the root cause? i have the same question.
we found sdma didn't work but so far we can't find out why.
by the way, I found some sample code use 0x100b1 to configure the spi pins while some use 0x10b1. which one is correct?
MX6UL_PAD_UART2_RTS_B__ECSPI3_MISO 0x100b1 /* MISO*/
MX6UL_PAD_UART2_CTS_B__ECSPI3_MOSI 0x100b1 /* MOSI*/
MX6UL_PAD_UART2_RX_DATA__ECSPI3_SCLK 0x100b1 /* CLK*/
MX6UL_PAD_UART2_TX_DATA__ECSPI3_SS0 0x100b0 /* CS*/
MX6UL_PAD_UART2_RTS_B__ECSPI3_MISO 0x10b1 /* MISO*/
MX6UL_PAD_UART2_CTS_B__ECSPI3_MOSI 0x10b1 /* MOSI*/
MX6UL_PAD_UART2_RX_DATA__ECSPI3_SCLK 0x10b1 /* CLK*/
MX6UL_PAD_UART2_TX_DATA__ECSPI3_SS0 0x10b0 /* CS*/
Perhaps SDMA firmware isn't loaded? Check messages in dmesg.
dmesg | grep -i dma
thanks for the reply.
i checked the demsg
~$:dmesg | grep -i dma
[ 0.000000] Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
[ 0.096339] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.298685] mxs-dma 1804000.dma-apbh: initialized
[ 0.310357] i2c i2c-1: can't use DMA
[ 0.572015] imx-sdma 20ec000.sdma: no event needs to be remapped
[ 0.572242] imx-sdma 20ec000.sdma: loaded firmware 3.3
[ 0.579422] imx-sdma 20ec000.sdma: initialized
[ 1.404321] spi_imx_sdma_init
[ 1.416760] spi max_dma_len = 32768
[ 3.112471] mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA
[ 3.191040] mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
It seems like the firmware 3.3 is loaded.
Is there anything need to be checked?
thanks.
Latest one is 3.5, I think
I updated the firmware to 3.5 but it doesn't help.
[root@AURE-IMX6ULL]:~$:dmesg | grep -i dma
[ 0.000000] Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
[ 0.096402] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.298754] mxs-dma 1804000.dma-apbh: initialized
[ 0.310518] i2c i2c-1: can't use DMA
[ 0.572450] imx-sdma 20ec000.sdma: no event needs to be remapped
[ 0.572697] imx-sdma 20ec000.sdma: loaded firmware 3.5
[ 0.579867] imx-sdma 20ec000.sdma: initialized
[ 60.948886] spi write
[ 63.950077] spi_master spi2: I/O Error in DMA RX:400
[ 63.955148] spi_master spi2: failed to transfer one message from queue
Well, it's weird. Aren't you using some outdated kernel? Perhaps there's mismatch between SDMA FW and eCSPI driver. SDMA FW version should be supported by eCSPI driver in your kernel. There's default FW in chip ROM, but it as well won't work with all eCSPI driver versions, certainly not with recent ones.
I am using 4.1.15. is it too old? Thanks.
[root@AURE-IMX6ULL]:~$:cat /proc/version
Linux version 4.1.15-gf03399f-dirty (liping@liping-VirtualBox) (gcc version 4.9.4 (Linaro GCC 4.9-2017.01) ) #71 SMP PREEMPT Wed Jun 15 20:01:44 CST 2022
I don't know. What I know is that there could be mismatch between eCSPI driver in your kernel and SDMA FW. Your rootfs (including SDMA FW) and kernel should be from the same BSP
is there any possibility to set the spi3 to tx only. in fact i don't need rx.
thanks.