linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: wael showair <showair2003@yahoo.com>
To: linuxppc-dev@ozlabs.org
Subject: When do i need to allocate DMA buffer
Date: Mon, 12 Jan 2009 04:03:15 -0800 (PST)	[thread overview]
Message-ID: <21413193.post@talk.nabble.com> (raw)


Hi All,
i have MPC8555 processor, also i have linux-kernel 2.6.19-rc5 on my board.i
want to use the DMA on my board, just a simple example is enough for me but
during my reading on how to use the DMA i have some questions:
1. The DMA buffer is always needed for all kind of buses or not? (I think
this is valid in the ISA bus but not in the PCI bus, plz correct me if i m
wrong?)
Note that my target is to transfer data from memory location to another
memory location & it will be an overhead if i copy the data from the src to
the DMA buffer then from the DMA buffer to the Destination.
isn't there any other way to avoid using that DMA buffer & to copy data from
src to dest directly?
i read the documentation of my board & it tells me that it contain DMA
engine which "is capable of transferring blocks of data from any legal
address range to any
other legal address range."

2. i have read DMA-API.txt in the linux Documentation folder but i m little
confused about the APIs that exist in this file. Actually, it is stated in
this file the following:
"This document describes the DMA API.This API is split into two pieces. 
Part I describes the API and the corresponding pci_ API".

so if the DMA controller is connected to the PCI bus, am i obligated to use
the pci_API & for any other case (like ISA bus or any other bus types) shall
i use this generic API?
also what r the benefits of these APIs over the normal kmalloc? specially
that i have read the following section in the DMA-mapping.txt:
"If you acquired your memory via the page allocator
(i.e. __get_free_page*()) or the generic memory allocators
(i.e. kmalloc() or kmem_cache_alloc()) then you may DMA to/from
that memory using the addresses returned from those routines."

thanks in advance for ur help
-- 
View this message in context: http://www.nabble.com/When-do-i-need-to-allocate-DMA-buffer-tp21413193p21413193.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

             reply	other threads:[~2009-01-12 12:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12 12:03 wael showair [this message]
2009-01-12 20:16 ` When do i need to allocate DMA buffer sjoyeau@wanadoo.fr
2009-01-13  9:03   ` wael showair
  -- strict thread matches above, loose matches on Subject: below --
2009-01-14 16:15 Misbahullah Khan

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=21413193.post@talk.nabble.com \
    --to=showair2003@yahoo.com \
    --cc=linuxppc-dev@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).