Fwd: Adding circular buffer capability to spi-imx.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
   I work with a IMX8 PLUS EVK and I need to receive a high rate data
flow via SPI from a real-time external microcontroller clocked by an
ADC capture.

My idea was to extend the spi-imx.c driver to add capability to use
dma_prep_cyclic with iMX8 powerful SDMA.

So, in this case Linux will be spi slave (the real time micro is
master) but I wouldn't like to use PIO mode since I can control spi
master to send data 4 bytes aligned to fit DMA alignment requirements.

I am stuck with implementation:
1) to change transfer_one is not the good way because I don't need
pump messages from SPI subsystem, I just need DMA doing the job and to
follow the transfer with a callback triggered by SDMA part every
"period len"

2) to add the transfer function (deprecated) to use spi_async is a
possibility but I don't know how to pass the period len info: if I
consider to pass a message with several transfers I have to check that
every buffer in a transfer has the same size

3) to use transfer function with a spi message and several transfers
(one for each period of a circular buffer) prevents me to use
dma_prep_cyclic that works on a single buffer (then descriptors inside
dma_prep_cyclic will split the buffer in N periods)

Should I go for using setup and cleanup that are now empty ?
In this case I can consider:
A) with setup I can pass into spi_device the information about a
circular buffer allocated by a protocol driver and also I can add a
callback to be triggered by DMA
B) with cleanup I could stop the DMA transfer when needed

Anyway, setup and cleanup shouldn't start or stop the spi transfer and
this is why I am puzzling to get the proper solution.

Thank you in advance

  Andrea Tessadri
  (Italy)




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux