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: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Tue, 08 Dec 2009 14:36:58 +0300
Cc: Ralf Baechle <ralf@linux-mips.org>, David Daney <ddaney@caviumnetworks.com>, macro@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <c6ed1ac50912071749m49b1e5f5m7ae53384389338d9@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <c6ed1ac50912070455n736af31fuf2c981fc182b494f@mail.gmail.com> <20091207134502.GB5119@linux-mips.org> <c6ed1ac50912071749m49b1e5f5m7ae53384389338d9@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)
Hello.

figo zhang wrote:


    > 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.


in my puzzle, if i run dma_vaddr =(char*) __get_free_pages(GFP_KERNEL, order);
dma_phy = virt_to_phy(dma_vaddr);

if the result is:
dma_vaddr = 0x801b00000;
dma_phy = 0x1b00000;

so i should write 0x1b00000 to my DMA Base register or wirte (0x1b000000 | 0xa0000000) to DMA?

You must always use the physical addresses when programming DMA, i.e. 0x1b00000 in this case.

WBR, Sergei



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