Re: DMA to SPI with descriptors (PXA27x)

Tech-Archive recommends: Fix windows errors by optimizing your registry



Haven't seen any issues with the Memory<->SSP DMA on PXA.
It is not very clear what you are trying to do. May be
will be better if instead of "how" you will tell "what"
exactly are you trying to accomplish?


Fredrik Jansson wrote:
Hi!

I have a working DMA-SPI implementation on a Mainstone III BSP.

I want to rewrite it to get zero-copies and have the following:

I run SDIO over SPI which means I send a command 53 "around" the data, the data size is also limited to 512 bytes per SDIO command 53.

In my working implementaion I build a buffer as follows for the receieve path
cmd53|dummy data 0|cmd53 post|cmd 53|dummy data 1|...

After that I set up one TX DMA and one RX DMA (one DMA descriptor each) working on that large buffer against SPI and it works well (using SPI flow control).

The result is:
cmd53|real data 0|cmd53 post|cmd 53|real data 1|...

The problem is that I have to manually copy the resulting data into a contineous buffer at the end.

The copying is what I want to get rid of.

Therefore I create three DMA descriptor for RX and three for TX and I set them up as follows:

rx_desc_0->trash_buffer (I'm not interested in the SDIO result)
rx_desc_1->data_buffer
rx_desc_2->trash_buffer
tx_desc_0->cmd_53_buffer
tx_desc_1->dummy data buffer
tx_desc_2->cmd_53 post buffer

I run the very same DMA function with the exception I have three linked descriptors in each direction.

All of a sudden I get SPI RX FIFO overruns and other undefined behaviour.

I both cases I pad the data to get a total size that's an even multiple of the SPI RX threshold (8 in my case).

Are there any special precautions that have to be taken when using linked descriptor with SPI flow control?


.



Relevant Pages

  • PXA2xx SPI controller updated for 2.6.16-rc1?
    ... Do you have a version of the PXA2xx SPI contoller driver more recent ... I've attached my attempt (PIO works but DMA doesn't) if it's of any use. ... I'm currently using SSP3 on the PXA27x with the slave chip select GPIO ... It looks like you're waiting for the transmit buffer in the controller ...
    (Linux-Kernel)
  • Re: MAX11043 - trying to avoid interrupts at 200kHz...
    ... does have a SPI DMA subsystem, but needs to be primed in code... ... So why not do the code for SPI with DMA? ... If you are sending data in Ethernet packets, you will be buffering the ... EOC interupt Start DMA of 4 x 16 bit transfers. ...
    (comp.arch.embedded)
  • DMA to SPI with descriptors (PXA27x)
    ... I run SDIO over SPI which means I send a command 53 "around" the data, ... After that I set up one TX DMA and one RX DMA ... Therefore I create three DMA descriptor for RX and three for TX and I set ...
    (microsoft.public.windowsce.platbuilder)
  • Re: PXA2xx SPI controller updated for 2.6.16-rc1?
    ... There are some SPI (and ... > I've attached my attempt (PIO works but DMA doesn't) if it's of any use. ... I believe this is the correct SSP in SPI mode behavior for PXA2xx. ... DMA descriptor chaining the next optimization for the driver. ...
    (Linux-Kernel)
  • Re: MCU w/ DMA SPI or suggestions?
    ... I didn't see how to shove the byte into the SPI tx register without looping and doing _nothing_ else... ... To expand on what you said: SPI into a serial-to-parallel and combine each 2 bits in the output latch with the two frame count bits to get the FRM lookup value that goes into the LCD panel. ... Since I really only need 3 colors I could use the extra color to generate the porches by padding my image rows and gating the pixel clock off. ... The DMA can handle an entire frame and leave the processor alone until the DMA terminate interrupt fires at 70Hz. ...
    (comp.arch.embedded)