From: Tonyliu <Bo.Liu@windriver.com>
To: Jonathan Haws <Jonathan.Haws@sdl.usu.edu>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: DMA to User-Space
Date: Wed, 04 Nov 2009 10:19:12 +0800 [thread overview]
Message-ID: <4AF0E4A0.30802@windriver.com> (raw)
In-Reply-To: <BB99A6BA28709744BF22A68E6D7EB51F0330F9DC29@midas.usurf.usu.edu>
Jonathan Haws wrote:
> 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.
>
You can maintain a DMA buffer in kernel, then mmap to user space. And
maybe you need some handshake between FPGA and the apps to balance input
datas with datas to disk.
> 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?
>
Use remap_pfn_range() in your kernel DMA buffer manipulation driver
.mmap() handler to export DMA buffer address to user space.
Tony
> Thanks for the help! I am still a newbie when it comes to kernel programming, so I really appreciate the help!
>
> Jonathan
>
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
>
--
Tony Liu | Liu Bo
-------------------------------------------------------------
WIND RIVER | China Development Center
Tel: 86-10-8477-8542 ext: 8542 | Fax: 86-10-64790367
(M): 86-136-7117-3612
Address: 15/F, Wangjing TowerB, Chaoyang District, Beijing, P.R.China
next prev parent reply other threads:[~2009-11-04 4:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-03 23:37 DMA to User-Space Jonathan Haws
2009-11-04 2:19 ` Tonyliu [this message]
2009-11-04 17:40 ` Jonathan Haws
2009-11-04 17:50 ` Jonathan Haws
2009-11-06 6:05 ` Chris Friesen
2009-11-06 16:34 ` Jonathan Haws
2009-11-06 17:07 ` Alan Nishioka
2009-11-06 18:47 ` Jonathan Haws
2009-11-04 19:02 ` john.p.price
2009-11-23 17:11 ` Sergey Temerkhanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AF0E4A0.30802@windriver.com \
--to=bo.liu@windriver.com \
--cc=Jonathan.Haws@sdl.usu.edu \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).