akarapatis
akarapatis

Reputation: 862

Linux DMA operations - how to initiate a transfer

I have read the Linux Device Driver LDD3 , the DMA-API.txt, DMA-HOWTO.txt also took a look at the drivers/dma/dmatest.c but I could not figure out how you initiate a dma transfer. All of the discuss about mapping memory but none on how to initiate a transaction. The PCI example driver has a transfer function but it uses "specific" DMA operations and I am trying to figure out a more generic/portable implementation that is not hardware depended

I am trying to make something like

  1. dma_map_single()
  2. initiate a read/write transaction
  3. interrupt that transaction has finished , use a handler, or wait_event_freezable_timeout
  4. dma_unmap_single()

Do I just read/write to the memory I mapped? How do I register a callback handler?

EDIT: To give a bit more detail I am working on a ARM platform.

Upvotes: 2

Views: 6071

Answers (1)

Konstantin Utkin
Konstantin Utkin

Reputation: 508

Maybe an example from Xilinx can help: http://www.wiki.xilinx.com/Zynq+Linux+pl330+DMA

And driver from Samsung (already contained in linux kernel): http://lxr.free-electrons.com/source/drivers/dma/pl330.c

Upvotes: 1

Related Questions