ecspi dma mode not working in i.mx8mm evk

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ecspi dma mode not working in i.mx8mm evk

跳至解决方案
1,611 次查看
sreedhar_appala
Contributor IV

Hi,

I am posting the query again, similar query has been posted long back by myself. please find below the previous post details.

https://community.nxp.com/t5/i-MX-Processors/iMX8MM-ECSPI-DMA-Issue/td-p/1166322

we are now making a custom board with i.mx8mm but the linux kernel will be 4.14

so i would like to request is there any test code to perform the ecspi dma mode test on i.mx8mm evk

and 

also please let me know the exact linux kernel version in which ecspi dma mode is perfectly working.

I will try to port it to 4,14 version.

due to the current pandemic situation, i am unable to visit the hw lab for debugging.

please provide your suggestions

Thank you, Sreedhar

0 项奖励
1 解答
1,600 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

New versions all can support DMA mode

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/spi/spi-imx.c?h=imx_5.4.70_2.3.0

 

Main function in spi-imx.c is spi_imx_dma_transfer

 

I didn't find spi dma test

 

BR

Zhiming

 

在原帖中查看解决方案

0 项奖励
5 回复数
1,601 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

New versions all can support DMA mode

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/spi/spi-imx.c?h=imx_5.4.70_2.3.0

 

Main function in spi-imx.c is spi_imx_dma_transfer

 

I didn't find spi dma test

 

BR

Zhiming

 

0 项奖励
1,305 次查看
BiyongSUN
NXP Employee
NXP Employee

 

iMX8MM ECSPI DMA Issue - NXP Community

I am working with i.MX8MM EVK and 4.19.35.1.1.0 Yocto distribution.

We have interfaced a slave to ECSPI2 pins exposed on J1003 of i.MX8MM EVK.

ECSPI2 is configured as Master, CPOL = CPHA = 0, Bits Per Word  = 8

 

The link says slave mode. 

 

It is silicon errata ERR009535, that is why the ecspi driver slave is PIO mode. 

NXP Semiconductors IMX8MM_0N87W
Mask Set Errata Rev. 1, 09/2021
Mask Set Errata for Mask 0N87W

IMX8MM_0N87W.pdf

 

Untitled.png

 

linux-imx/drivers/spi/spi-imx.c”, function “spi_imx_can_dma()”.

 


static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi,
struct spi_transfer *transfer)
{
struct spi_imx_data *spi_imx = spi_master_get_devdata(master);

if (!use_dma || master->fallback)
return false;

if (!master->dma_rx)
return false;

if (spi_imx->slave_mode)
return false;

if (transfer->len < spi_imx->devtype_data->fifo_size)
return false;

spi_imx->dynamic_burst = 0;

return true;
}

 

 

 

 

 

0 项奖励
1,325 次查看
Guangyu
Contributor I

Hi, 

May I ask a question, is this new version valid for ECSPI in master mode to support DMA mode? Can DMA mode be supported while ECSPI works in slave mode? thanks @Zhiming_Liu 

 

B.R.

Guangyu

0 项奖励
1,289 次查看
BiyongSUN
NXP Employee
NXP Employee

Guangyu,

Because of the silicon bug the ecspi could not use dma under slave mode. 

You are very professional. 

0 项奖励
1,580 次查看
sreedhar_appala
Contributor IV

Thank you Zhiming !!

0 项奖励