mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: PCI DMA Address
Date: Fri, 30 Apr 2004 23:19:30 -0600	[thread overview]
Message-ID: <005701c42f3b$e1ab6aa0$6601a8c0@northbrook> (raw)
In-Reply-To: <a826e204.0404282237.6a6b28b0@posting.google.com>

I don't think ioremap is what you want here. ioremap is used to map a PCI
memory region on the card itself. To allocate a DMA region within system
memory to transfer to, you want something like pci_alloc_consistent (but
128MB seems a rather large amount to use for that function, given that it
allocates with GFP_ATOMIC..)


----- Original Message ----- 
From: "ina" <celina.miranda@eazix.com>
Newsgroups: fa.linux.kernel
Sent: Thursday, April 29, 2004 12:37 AM
Subject: PCI DMA Address


> Hi,
>
> I need to create a driver for a PCI camera device that uses DMA to
> transfer the captured images. The system that i use is an x86 board
> that has 128M of RAM, I reserved the top of the physical RAM during
> bootup by passing "mem=100".
>
> In my driver i claimed the reserved memory by using ioremap call:
> void* pAdd = ioremap(0x6400000,(1280x1024))
>
> This is the memory where the PCI device should DMA the captured data.
> My question is how do I tell the PCI device the DMA address? I know
> that inorder for the PCI device to access the DMA address correctly, i
> have to convert the return value of ioremap into a bus address. How do
> i do this? I already used:
> virt_to_phys(pAdd)
> but this doesn't seem to work.
>
> I read somewhere that the output of ioremap cannot be directly used
> for virt_to_phys function call, but I'm not really sure...
>
> Thanks,
> Ina


       reply	other threads:[~2004-05-01  5:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a826e204.0404282237.6a6b28b0@posting.google.com>
2004-05-01  5:19 ` Robert Hancock [this message]
2004-05-01 13:47   ` Richard B. Johnson
2008-02-18 15:05 PCI DMA address Ke
2008-02-18 16:49 ` Jiri Slaby

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='005701c42f3b$e1ab6aa0$6601a8c0@northbrook' \
    --to=hancockr@shaw.ca \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome