AnsweredAssumed Answered

Can't use ECSPI DMA function

Question asked by AL ee on Jan 9, 2019
Latest reply on Jan 13, 2019 by AL ee

Hi,

    I want to use the ECSPI DMA function to transfer large amounts of data ,But i tesed in linux V3.14.52,it's used PIO function to transfer data,cause the CPU usage over 30%.Then I find the the driver spi-imx.c in /driver/spi directory,Only one transfer data size bigger than spi FIFO size(64 Bytes) will use the DMA function to transfer.

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 (spi_imx->dma_is_inited && (transfer->len > spi_imx_get_fifosize(spi_imx)))
      return true;
 return false;
}

Yeah, I used the spi_write to transfer one times  the data size less than 64Bytes(the size limited by our hardware).but I will transfer a lot of times,then my question is How to solve this contradiction.

our board is Imx6D7C and used the linux kernel is 3.14.52. 
could you give me some help !

best regards
Alee

Outcomes