Re: PCI DMA Address

From: Måns Rullgård (mru_at_kth.se)
Date: 04/29/04


Date: Thu, 29 Apr 2004 22:35:51 +0200


"Pete Zaitcev (OTID1)" <ot16a6ca05878e44c0@comcast.net> writes:

> On Wed, 28 Apr 2004 23:39:25 -0700, ina wrote:
>
>> 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.
>
> This is a misconception. Since you use mem= tricks, you are up to
> your armpits in API illegalities, so there will be no harm if you
> just use 0x6400000. There is no API which would help you to do
> what you are trying to do.

You will still need to take into account any differences in the
(physical) memory mapping as seen from the CPU vs. the PCI bus. On
regular PC hardware this is the same, but on many (64-bit) machines
this is not necessarily the case.

-- 
Måns Rullgård
mru@kth.se


Relevant Pages

  • Re: DMA APIs gumble grumble
    ... 32-bit mask should that fail. ... 32-bit SAC addressing is done more efficiently than DAC addressing. ... DAC interfaces to the PCI DMA API for when "you really really want DAC ...
    (Linux-Kernel)
  • Re: direct memory access
    ... No, 1 ISA, 5 PCI and 1 AGP. ... PCI and AGP might be shared. ... >>> If you don't see the Advanced tab, either your hardware doesn't>> support DMA or the DMA settings are incorrect in the BIOS. ... [[With some IDE drivers/Busmastering drivers, DMA cannot be>> enabled through the device manager, but only through the driver>> settings. ...
    (microsoft.public.windowsxp.help_and_support)
  • [PATCH] docs: move DMA-mapping.txt to Documentation/PCI/
    ... -addresses (DMA addresses) into physical addresses. ... This is needed so that e.g. PCI devices can ... -So that Linux can use the dynamic DMA mapping, it needs some help from the ... And at least one platform (SGI ...
    (Linux-Kernel)
  • [PATCH 1/3 for mainline] docs: Move DMA-mapping.txt to Documentation/PCI/
    ... -addresses (DMA addresses) into physical addresses. ... This is needed so that e.g. PCI devices can ... -So that Linux can use the dynamic DMA mapping, it needs some help from the ... And at least one platform (SGI ...
    (Linux-Kernel)
  • [PATCH 1/4] Documentation: move DMA-mapping.txt to Doc/PCI/
    ... -addresses (DMA addresses) into physical addresses. ... This is needed so that e.g. PCI devices can ... -So that Linux can use the dynamic DMA mapping, it needs some help from the ... And at least one platform (SGI ...
    (Linux-Kernel)