From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Klossner <andrew@cesa.opbu.xerox.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: I don't understand #size-cells = <0>
Date: Mon, 05 Feb 2007 10:43:05 +1100 [thread overview]
Message-ID: <1170632585.2620.45.camel@localhost.localdomain> (raw)
In-Reply-To: <200702010022.l110MCan009105@pogo.cesa.opbu.xerox.com>
On Wed, 2007-01-31 at 16:22 -0800, Andrew Klossner wrote:
> I'm porting the kernel to an 8548-based board whose boot loader does
> not provide a device tree, so I'm rolling my own.
>
> Rev 0.5 of booting-without-of.txt says:
>
> "reg" properties are always a tuple of the type "address size"
> where the number of cells of address and size is specified by
> the bus #address-cells and #size-cells.
>
> but in the examples, we see
>
> reg = <22000 1000>;
> #address-cells = <1>;
> #size-cells = <0>;
>
> The number of cells of address is 1. The number of cells of size is 0.
> 1+0=1, so how can the reg property have a tuple of size 2?
Regardless of #size-cell of #address-cell, you are getting one basic
assumption wrong: those properties don't apply to the node itself but to
-children- of that node.
They are typically in a bus node to define the format of the "reg"
properties of nodes -under- that bus node.
Now, there are a few cases where #size-cells is 0, mostly it is an
unofficial and common way to say that devices on that bus aren't mmio
mapped. For example, take an i2c bus. Devices decode one and only one
address (ok, maybe 2, but the concept of "range" is irrelevant) and
there is no direct MMIO translation. This is typically a case where
#size-cells is 0. Another common example is /cpus (which is the parent
for all cores in the system). The cpus themselves have a reg property
that contain their physical ID, there is no concept of ranges of
addresses, thus #size-cell is 0.
Ben.
prev parent reply other threads:[~2007-02-04 23:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-01 0:22 I don't understand #size-cells = <0> Andrew Klossner
2007-02-01 0:25 ` David Gibson
2007-02-01 15:08 ` Yoder Stuart-B08248
2007-02-04 23:43 ` Benjamin Herrenschmidt [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=1170632585.2620.45.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=andrew@cesa.opbu.xerox.com \
--cc=linuxppc-dev@ozlabs.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).