From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Static mappings at boottime
Date: Sat, 30 Jan 2010 14:55:49 +0000 [thread overview]
Message-ID: <20100130145549.GA17097@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <2703439e1001300647q1149a357v3b3e9da6bd8c91cf@mail.gmail.com>
On Sat, Jan 30, 2010 at 11:47:36PM +0900, Khushhua Mogambo wrote:
> Dears
>
> my soc have very simple and limited device controllers. I have thought
> maybe I can map all devices's register spaces using iotable_init in map_io.
Yes, you can do this.
> And pass already mapped Virtual addr(and not phys addr) to device drivers
> via IORESOURCE_MEM.
But you can't do this. Resources take physical addresses, not virtual
addresses.
> i thinks that way i can do most use of virtual address space for ioremap
> and I can set VMALLOC size to maximum possible. also drivers doesnt have
> to worry about mapping(and no addr space is mapped twice in two code pieces)
>
> is it considered good kernel porting practice? can we face any problem
> after some times?
Definitely not.
The "simple" approach to your proposal is to map the device space
statically and then intercept ioremap(). When you detect a request
for a range which is already statically mapped, then return the
already mapped virtual address.
This doesn't change the way you write the drivers; you write drivers
using the standard interfaces and continue to assume that those
interfaces will fail.
next prev parent reply other threads:[~2010-01-30 14:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-30 14:47 Static mappings at boottime Khushhua Mogambo
2010-01-30 14:55 ` Russell King - ARM Linux [this message]
2010-01-30 15:13 ` Khushhua Mogambo
2010-01-30 15:39 ` Russell King - ARM Linux
2010-01-31 0:03 ` Mogambo Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100130145549.GA17097@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).