From: jszhang@marvell.com (Jisheng Zhang)
To: linux-arm-kernel@lists.infradead.org
Subject: [query] how to use "ranges" in device tree
Date: Fri, 17 Apr 2015 16:51:35 +0800 [thread overview]
Message-ID: <20150417165135.76f58eb8@xhacker> (raw)
In-Reply-To: <5530C678.5080702@gmail.com>
On Fri, 17 Apr 2015 01:38:16 -0700
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> wrote:
> On 17.04.2015 05:50, Jisheng Zhang wrote:
> > I got the solution, the ranges can define two or more ranges. What I need to do
> > is just add ranges for 0xe0000000 - 0xf0000000 as the following:
>
> Jisheng,
>
> the beauty of ranges property often reminds me of perl code: once you
> stop looking at it, you cannot recall how you did it nor how that
> has ever worked.
>
> What the ranges property does is to map an address range back to the
> address space of the parent node. In this case, the parent node of
> "soc" is the root node with "ranges;", i.e. 1:1 mapping.
>
> > soc {
> > ranges = <0 0xf7000000 0x1000000
>
> The line above maps 0x1000000 bytes starting at 0 back to 0xf7000000
> of the parent node's address space. This allows us to leave the 0xf7
> prefix for each of the internal bus nodes below.
>
> > 0xe0000000 0xe0000000 0x10000000>; //add this line
>
> You could have chosen any address as the first value that does not
> interfere with 0x0-0x1000000 of the first range, e.g.
>
> 0x20000000 0xe0000000 0x10000000
>
> would allow you to access the pcie memory space at 0x20000000 in nodes
> below that ranges property.
>
Thanks for this explanation which gives me good guide about the "ranges" usage.
>
> > pcie: pcie at e40000 {
> > ...
> > reg = <0xe40000 0x10000>, <0xe0000000 0x8000000>;
> > reg-names = "dbi", "pad", "config";
> > ...
> > };
> > }
> >
> > Now, we can get the config space correctly.
>
prev parent reply other threads:[~2015-04-17 8:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-16 13:59 [query] how to use "ranges" in device tree Jisheng Zhang
2015-04-16 22:59 ` Jaehoon Chung
2015-04-17 2:24 ` Jisheng Zhang
2015-04-17 3:50 ` Jisheng Zhang
2015-04-17 8:32 ` Arnd Bergmann
2015-04-17 8:45 ` Jisheng Zhang
2015-04-17 9:38 ` Arnd Bergmann
2015-04-17 8:38 ` Sebastian Hesselbarth
2015-04-17 8:51 ` Jisheng Zhang [this message]
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=20150417165135.76f58eb8@xhacker \
--to=jszhang@marvell.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).