ecspi dma mode not working in i.mx8mm evk

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

ecspi dma mode not working in i.mx8mm evk

Jump to solution
2,117 Views
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 Kudos
Reply
1 Solution
2,106 Views
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

 

View solution in original post

0 Kudos
Reply
5 Replies
2,107 Views
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 Kudos
Reply
1,811 Views
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 Kudos
Reply
1,831 Views
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 Kudos
Reply
1,795 Views
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 Kudos
Reply
2,086 Views
sreedhar_appala
Contributor IV

Thank you Zhiming !!

0 Kudos
Reply