Using DMA

Bruce_Leonard at selinc.com Bruce_Leonard at selinc.com
Thu Nov 6 13:07:20 EST 2008


This may be the wrong forum for this question.  If so I apologize, and 
could someone please tell me the appropriate place to ask?

Assuming this is the right place, I'm working with the 2.6.27 (stable) 
kernel and an MPC8347E processor.  I'm using a custom NAND controller and 
a custom driver to talk with that controller.  I'm now to the point where 
I'm trying to optimize/improve performance and something I'd like to do is 
set up the driver to use DMA transfers to the controller.  (As an 
additional bit of info, I modeled my driver on the Cafe driver.)  However, 
no one here has ever had to set up DMA from scratch before, it's always 
been done by an existing driver or the kernel, so I'm in uncharted 
teritory.

In the Cafe driver, Linux Device Drivers 3rd Edition, and DMA-mapping.txt 
everyone talks about how to allocate buffers using 
dma/pci_alloc_coherent(), but no one talks about how to actually use it. 
I'm pretty sure (even in my ignorance) that just allocating a DMA coherent 
buffer and then copying in and out of it does NOT actually engage the 
underlying hardware and perform a DMA transfer.

With some digging I've found the Freescale Elo/Elo Plus DMA driver which 
supports my processor.  What I'm not clear on is how to actually make use 
of it.  How do I tie my NAND driver to the Freescale DMA driver and 
actually get the hardware to work?  Any pointers are greatly appreciated.

Thanks.

Bruce


More information about the Linuxppc-embedded mailing list