linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Andrew Klossner <andrew@cesa.opbu.xerox.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: I don't understand #size-cells = <0>
Date: Thu, 1 Feb 2007 11:25:34 +1100	[thread overview]
Message-ID: <20070201002534.GD29213@localhost.localdomain> (raw)
In-Reply-To: <200702010022.l110MCan009105@pogo.cesa.opbu.xerox.com>

On Wed, Jan 31, 2007 at 04:22:12PM -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?

The #address-cells and #size-cells properties apply to children of the
node they appear in, but not in the node itself.  So the "reg" here
uses the #address-cells and #size-cells values from its parent.

This is so that a bridge to a different bus (say, PCI<->USB) can have
a reg property in the format of its parent bus for the control
registers, but define a new address format for things on the
subordinate bus.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2007-02-01  0:25 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 [this message]
2007-02-01 15:08   ` Yoder Stuart-B08248
2007-02-04 23:43 ` Benjamin Herrenschmidt

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=20070201002534.GD29213@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --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).