linux-mips
[Top] [All Lists]

Re: Dma addr should use Kuseg1 for MIPS32?

To: figo zhang <figo1802@gmail.com>
Subject: Re: Dma addr should use Kuseg1 for MIPS32?
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 7 Dec 2009 13:45:02 +0000
Cc: David Daney <ddaney@caviumnetworks.com>, macro@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <c6ed1ac50912070455n736af31fuf2c981fc182b494f@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <c6ed1ac50912070455n736af31fuf2c981fc182b494f@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.20 (2009-08-17)
On Mon, Dec 07, 2009 at 08:55:12PM +0800, figo zhang wrote:

> I am writing a driver for MIPS32. i wirte this code for DMA addr:
> 
> dma_vaddr =(char*) __get_free_pages(GFP_KERNEL|
> GFP_DMA, order);

You probably don't want to use GFP_DMA - unless your hardware has DMA
restrictions such as the ISA's bus's 16MB limit.

> dma_phy = virt_to_phy(dma_vaddr);

Ouch.  Don't.  See Documentation/DMA-API.txt for how to do it.

> i write dma_phy to DMA base register, but why it cannot work? it should
> write Kseg1 space to DMA register?
> I remember that it is ok for ARM/X86 .

It's only happens to work on some systems.

  Ralf

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