Async DMA question regarding dma_async_memcpy_buf_to_buf

Bruce_Leonard at selinc.com Bruce_Leonard at selinc.com
Tue Nov 25 08:23:54 EST 2008


> 
> Any given memcpy operation involves *both* directions.  Data is copied 
> out of host memory into the DMA engine's internal buffer (this is the 
> src mapping), and then it its copied back into host memory at a 
> different address (this is the dest mapping).
> 

Whoops!  Now we may be getting to the heart of what I'm confused about ;). 
 My bad, some more background may be in order for you to help me.

What I'm trying to do is set up a DMA transfer to/from a NAND flash 
controller hanging on a PCI bus.  So, let's say I'm doing a read of the 2K 
NAND page.  My "source" is a PCI address and is what I was assuming I 
needed to pass to the memcpy function as "src".  But that assumption 
conflicts with your statement that "Data is copied out of host memory into 
the DMA engine's internal buffer (this is the src mapping)".  Is this 
where my ignorance is jumping up and bitting me?

Maybe (with you clarification) this is starting to make sense.  It doesn't 
matter if the "src" is host memory or PCI space.  What the "src" and it's 
DMA_TO_DEVICE mapping is saying to the kernel is "this data needs to be 
moved into the DMA engine", while the "dest" and it's DMA_FROM_DEIVCE 
mapping is telling the kernel "this data needs to be moved from the DMA 
engine".

Or am I even more confused :(  ?

Bruce


More information about the Linuxppc-embedded mailing list