This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Continuous data transfer form ADC with McSPI\EDMA on AM5728

Hello
Is it possible to organize continuous McSPI data transfer with EDMA (in Linux) without rewriting the McSPI driver?
The main idea is to have two buffers and read data from McSPI to them in ping-pong style with EDMA, and then process one buffer that is just finished receiving the data while other buffer is receiving new data. And then swap buffers in cycle.
This task looks very common to me if you want to interface to some external device that is continuously produces some data. But I can't find any example of such a configuration.
May be linux McSPI driver can be configured somehow to work in such manner? 
  • Hi,

    I will forward this to the software team.
  • Hi,

    AFAIK, the spi-omap2-mcspi.c driver is configure to work with DMA. You may need to reconfigure the edma channels, IF you don't want to use the default dmas set in am57xx dts structure.

    As for 

      

    Sergey Danilov said:
    The main idea is to have two buffers and read data from McSPI to them in ping-pong style with EDMA, and then process one buffer that is just finished receiving the data while other buffer is receiving new data. And then swap buffers in cycle.
     

    You will have to modify the kernel driver to achieve this.

    Another option is to create a user space driver, which should work with dev/spidevX.Y; in it you can allocate the two buffers to read data from spi interface and then process them in the manner you want (process one buffer that is just finished receiving the data while other buffer is receiving new data and then swap buffers in cycle). 

    Hope this helps

    Best Regards, 

    Yordan