Thread (10 messages) 10 messages, 4 authors, 2012-07-11

Mapping of Device Physical Address to Kernel Virtual address

From: Prabhu nath <hidden>
Date: 2012-07-11 01:03:26

On Tue, Jul 10, 2012 at 10:03 PM, ?? ? [off-list ref] wrote:

? 2012-7-10?17:16?"Prabhu nath" < [off-list ref]
gprabhunath at gmail.com> ???

Thanks for your reply. Plz see inline

On Tue, Jul 10, 2012 at 11:17 AM, Philipp Ittershagen <[off-list ref][off-list ref]
p.ittershagen at googlemail.com> wrote:
quoted
Hi Prabhu,

On Tue, Jul 10, 2012 at 6:56 AM, Prabhu nath < [off-list ref][off-list ref]
gprabhunath at gmail.com> wrote:
quoted
For E.g. I have a device whose physical address range is 0x80008000 to
0x80008FFF.
             Is it possible to map this device physical address to a
known
quoted
virtual address range 0xF0008000 to 0xF0008FFF.
I don't think this is possible, because these virtual address ranges
are handled by the kernel VMA system and are allocated dynamically, so
that is not just a bitmask or something to change.
quoted
My hardware configuration has 128 MB of system RAM which will have been
MAPPED to the Kernel virtual address from 0xC0000000 to 0xC7FFFFFF

Also is it possible to configure the vmalloc kernel virtual address
region
quoted
to a fixed range of 128 MB from 0xC8000000 to 0xCFFFFFFF
You could change PAGE_OFFSET. From [1]:


PHYS_OFFSET
        Physical start address of the first bank of RAM.

PAGE_OFFSET
        Virtual start address of the first bank of RAM.  During the kernel
        boot phase, virtual address PAGE_OFFSET will be mapped to physical
        address PHYS_OFFSET, along with any other mappings you supply.
        This should be the same value as TASK_SIZE.


But I'm curious: Why do you want to change it?
      Just wanted to have a constant mapping from PA to VA of devices and
wanted to have a separate region for vmalloc.
quoted
what do you mean constant?
After mapping, it is constant.
Before mapping, it is constant for
Low memory region, but is not
Constant for vmalloc region.
   I mean fixed/static mapping rather than kernel allocating kernel virtual
address dynamically.
Vmalloc region is separate in default.
Your change doesn't make any sense.
    You mean ioremap(...) will not map the physical address of the device
into vmalloc region ?
The most difficult thing for you is
To make sure what do you want to
Do really. Please give detail demand.
    My requirement is very simple. I have designed a layout showing mapping
of physical address to kernel virtual address. I also want to implement in
the same way.

    1. Low mem region - which is already fixed by the kernel based on the
memory size.
    2. Vmalloc region which can be fixed as per your previous mail
    3. Also have a fixed mapping of device physical address by
ioremap_page_range(...)

     I think I got what I needed. Thank you all very much for your valuable
time.

quoted
Greetings,

  Philipp


[1]: <http://www.kernelport.org/defines.html><http://www.kernelport.org/defines.html>
http://www.kernelport.org/defines.html
_______________________________________________
Kernelnewbies mailing list
[off-list ref]Kernelnewbies at kernelnewbies.org
<http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies>
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120711/6b55f950/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help