Re: Mapping of Device Physical Address to Kernel Virtual address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI Prabhu,

On Tue, Jul 10, 2012 at 2:00 AM, Prabhu nath <gprabhunath@xxxxxxxxx> wrote:
> Thanks for your reply. Plz see inline
>
> On Tue, Jul 10, 2012 at 11:50 AM, Dave Hylands <dhylands@xxxxxxxxx> wrote:
>>
>> Hi Prabhu,
>>
>> On Mon, Jul 9, 2012 at 9:56 PM, Prabhu nath <gprabhunath@xxxxxxxxx> wrote:
>> > Dear All,
>> >
>> >                    Is it possible to map a physical address of a device
>> > to a
>> > known Kernel virtual address. I know about ioremap_xxx (...).
>> > which will map a physical address of a device to a kernel virtual
>> > address
>> > allocated by ioremap_xxx(...).
>> >
>> > 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
>> > virtual address range 0xF0008000 to 0xF0008FFF.
>>
>> About the only way to do this is to use static mappings. I was under
>> the impression that static mappings are on the way out, and that
>> dynamic mappings are required when using device tree.
>>
>> An example of using static mappings can be found here:
>>
>> http://lxr.linux.no/linux+v3.4.4/arch/arm/mach-integrator/integrator_ap.c#L88
>
>
>    In this file, how did they mark IO_BASE. Is the allocator not aware of
> this region in the kernel virtual address space. ?

Well for a given device it's really kind of arbitrary. For the
integrator device IO_BASE is found here:
http://lxr.linux.no/linux+v3.4.4/arch/arm/mach-integrator/include/mach/hardware.h#L31

Nornally you would make sure that the I/O area doesn't overlap with
the vmalloc area by controlling VMALLOC_END. But since the default
VMALLOC_END is now 0xff000000 it looks like they're trying to make you
use dynamic mappings.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux