From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: Device tree and IO map_desc.
Date: Wed, 21 Mar 2012 08:09:57 -0500 [thread overview]
Message-ID: <4F69D325.1000500@gmail.com> (raw)
In-Reply-To: <CAKON4OyHRVvdtZGt+HiCnsRT_5zTuDVBVgOx22kFC2xxFLnD+Q@mail.gmail.com>
On 03/20/2012 11:52 AM, jonsmirl at gmail.com wrote:
> Is there a helper for building the IO map_desc from the device tree?
>
No. This is one of those things that device tree cannot have knowledge
of what needs to be statically mapped as that's not a h/w description.
We could probably have a list of nodes to map and extract the size and
physical addresses from the DT. There's lots of register defines
typically associated with the static mappings, so you would still have
duplicated information.
> For example on Versatile. All of this map_io data is already in the
> device tree, it is just repeated here.
>
>
> DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)")
> .map_io = versatile_map_io,
> .init_early = versatile_init_early,
> ....
> MACHINE_END
>
> void __init versatile_map_io(void)
> {
> iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc));
> }
>
> static struct map_desc versatile_io_desc[] __initdata = {
> {
> .virtual = IO_ADDRESS(VERSATILE_SYS_BASE),
> .pfn = __phys_to_pfn(VERSATILE_SYS_BASE),
> .length = SZ_4K,
> .type = MT_DEVICE
> }, {
> .virtual = IO_ADDRESS(VERSATILE_SIC_BASE),
> .pfn = __phys_to_pfn(VERSATILE_SIC_BASE),
> .length = SZ_4K,
> .type = MT_DEVICE
> }, {
> .virtual = IO_ADDRESS(VERSATILE_VIC_BASE),
> .pfn = __phys_to_pfn(VERSATILE_VIC_BASE),
> .length = SZ_4K,
> .type = MT_DEVICE
The SIC and VIC should get converted to ioremap and using of_irq_init.
There's already DT init support for the VIC at least, so the conversion
should be easy. I think Linus W was working on this.
Rob
> }, {
> ...
>
next prev parent reply other threads:[~2012-03-21 13:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-20 16:52 Device tree and IO map_desc jonsmirl at gmail.com
2012-03-21 13:09 ` Rob Herring [this message]
2012-03-21 14:23 ` jonsmirl at gmail.com
2012-03-21 14:37 ` Rob Herring
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=4F69D325.1000500@gmail.com \
--to=robherring2@gmail.com \
--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).