0

I am trying to use DMA to program an FPGA connected to an OMAP-L138's SPI bus, but without success.

Currently, I am using the stock davinci-spi driver (drivers/spi/spi-davinci.c)that comes with linux 3.19. FPGA configuration is successful (without DMA enabled), but it is very slow. I am using a device tree to configure the SPI interface.

I would like to use DMA to improve performance, however from looking at the spi-davinci.c source code and its device tree bindings, the driver does not appear to support DMA when configured with device tree. Is my understanding correct? If so, are there any plans to support DMA transfers using davinci's SPI driver when also using device tree?

Punit Vara
  • 3,744
  • 1
  • 16
  • 30
  • *"Currently, I am using the stock davinci-spi driver (drivers/spi/davinci-spi.c)that comes with linux 3.19."* -- There is no such file in mainline. Some drivers use both DT and a structure from a board file to get configuration information. – sawdust Nov 30 '15 at 22:09
  • Sorry, I meant drivers/spi/spi-davinci.c. I didn't realize that some drivers use both DT and a board file to get configuration information. I thought that one of the purposes of DT is to remove the need for board specific files. – Bob Brickhouse Dec 01 '15 at 17:11
  • *"I thought that one of the purposes of DT ..."* -- True, but do you want to discuss intent versus what actually has been implemented? FWIW I use SoCs from one of the DT early-adopters (Atmel & Free Electrons), and it was still several years before all boards & drivers were 100% DT. – sawdust Dec 01 '15 at 20:30
  • Good to know. I think this clears up my confusion on the state of the davinci SPI driver. – Bob Brickhouse Dec 01 '15 at 20:55

1 Answers1

0

Here are a few guidelines to achieve your goal:

First, check if the SPI has it's own DMA engine. If it doesn't, perhaps there's a generic DMA controller on board. You can check this by looking at the SPI datasheet and looking at the board interconnect schematics.

If none of the above are true, then you can't use DMA with the SPI.

If the SPI has its own DMA, you'll need to write a driver for that. If there's a DMA on board, it's probably utilized by other components, search for dma_dngine driver for that particular device. Then you'll need to create a DMA client for that particular DMA engine.

Please read:

DMA Provider

DMA Client

Good luck

Maximillian Laumeister
  • 19,884
  • 8
  • 59
  • 78
stdcall
  • 27,613
  • 18
  • 81
  • 125