DMA to User-Space

Jonathan Haws Jonathan.Haws at sdl.usu.edu
Wed Nov 4 10:37:38 EST 2009


All,

I have what may be an unconventional question:

Our application consists of data being captured by an FPGA, processed, and transferred to SDRAM.  I simply give the FPGA an address of where I want it stored in SDRAM and it simply DMAs the data over and interrupts me when finished.  I then take that data and store it to disk.

I have code in user space that handles all of the writing to disk nicely and fast enough for my application (I am capturing data at about 35-40 Mbytes/sec).

My question is this:  is it possible to give a user-space pointer to the FPGA to DMA to?  It seems like I would have problems with alignment, address manipulation, and a whole slew of other issues.

What would be the best way to accomplish something like that?  I want to handle all the disk access in user-space, but I do not want to have to copy 40 MB/s from kernel space to user-space either.

I can maintain an allocated, DMA-safe buffer in kernel space if needed.  Can I simply get a user-space pointer to that buffer?  What calls are needed to translate addresses?

Thanks for the help!  I am still a newbie when it comes to kernel programming, so I really appreciate the help!

Jonathan





More information about the Linuxppc-dev mailing list