Linuxppc-embedded Digest, Vol 35, Issue 33

Siva Prasad sprasad at bivio.net
Wed Jul 18 08:41:05 EST 2007


Well!... you can manage any way you want.

 

1) You can store the virtual address in the DpRAM, and convert to
physical (should I say DMA mapped address) and then pass it on to the
device under consideration here.

 

2) Other way would be... store the physical address in DpRAM. Use that
address for the device, and convert to virtual before you use it in the
code.

 

My preference is for first option.

 

- Siva

 

 

________________________________

From: suresh suresh [mailto:sureshtang at gmail.com] 
Sent: Monday, July 16, 2007 10:59 PM
To: Scott Wood
Cc: Siva Prasad; linuxppc-embedded at ozlabs.org
Subject: Re: Linuxppc-embedded Digest, Vol 35, Issue 33

 

Thanks....

MPC8280 has internal memory space which contains Dualport(Dp) RAM. In
the DpRAM we allocate some tables and these has to store pointer of the
buffers which are allocated in external memory. Core will use this
pointer to access the buffers, basically these buffers are used for DMA.

Using IMMR register we can get physical address of the internal memory.
Now can I store the address return by the kmalloc() function? or I
should convert it into physical?

Please help me how to resove this address translation.


Regards,
Suresh

On 7/16/07, Scott Wood <scottwood at freescale.com> wrote:

Siva Prasad wrote:
> It returns kernel virtual address. If you use this buffer space for
DMA,
> please use appropriate flags. You may use __pa(address) or
> virt_to_phys() to convert virtual to physical. 

No, you may not -- physical and DMA addresses are not always identical.
  Use the DMA mapping API.

-Scott

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20070717/1a04956f/attachment.htm 


More information about the Linuxppc-embedded mailing list