linux-mips
[Top] [All Lists]

Re: Question on Au1550 ...

To: "Alexey Shinkin" <alexshinkin@hotmail.com>
Subject: Re: Question on Au1550 ...
From: Dan Malek <dan@embeddededge.com>
Date: Mon, 18 Oct 2004 12:09:19 -0400
Cc: linux-mips@linux-mips.org
In-reply-to: <BAY15-F37yRLVbNDN4C0000d65e@hotmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <BAY15-F37yRLVbNDN4C0000d65e@hotmail.com>
Sender: linux-mips-bounce@linux-mips.org

On Oct 18, 2004, at 8:01 AM, Alexey Shinkin wrote:

The goal is to make this memoty visible from user level application. The following approach is used on õ86 and works :

I'm kinda surprised it works anywhere.  You have taken a rather complex
approach to achieving your results.

  -  to use  remap_page_range() instead of vm_ops .

This is all you should have to do. Use the physical (dma_addr_t) address returned from pci_alloc_consistent() as the 'offset' parameter, use the VMA
allocated and provided to you, call remap_page_range() and you are done.

An alternative is to have an ioctl() in your driver that returns the physical
address of the buffer (as provided by pci_alloc_consistent()), then use
/dev/mem to do the mmap().  The only problem with this is coordination
with your driver, you have to ensure you release the /dev/mem mmap
in your application when the driver also does the same for the dma
buffer space.


        -- Dan


<Prev in Thread] Current Thread [Next in Thread>