All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] ARM: SPEAr600: Add device-tree support to SPEAr600 boards
Date: Thu, 15 Mar 2012 11:40:27 +0000	[thread overview]
Message-ID: <201203151140.27453.arnd@arndb.de> (raw)
In-Reply-To: <4F61CC81.1020902@st.com>

On Thursday 15 March 2012, Viresh Kumar wrote:
> On 3/15/2012 4:20 PM, Stefan Roese wrote:
> 
> > diff --git a/arch/arm/boot/dts/spear600.dtsi b/arch/arm/boot/dts/spear600.dtsi
> 
> > +/ {
> > +       compatible = "st,spear600";
> > +
> > +       cpus {
> > +               cpu at 0 {
> > +                       compatible = "arm,arm926ejs";
> > +               };
> > +       };
> > +
> > +       memory {
> > +               device_type = "memory";
> > +               reg = <0 0x40000000>; /* Real value updated by U-Boot */
> > +       };
> > +
> > +       ahb {
> 
> What is the significance of this name? As i see gpio/spi etc in this list,
> which are on apb bus.

That sounds like it should be corrected, the device tree should reflect
the physical hierarchy where possible, e.g.

	ahb0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges = <0xe0000000 0xe0000000 0x10000000>;

		ethernet at e0800000 {
			...
		};

		...
	};

	ahb1 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges = <0xd0000000 0xd0000000 0x10000000>;
		ranges = <0xf0000000 0xf0000000 0x10000000>;

		apb {
			#address-cells = <1>;
			#size-cells = <1>;
			compatible = "simple-bus";
			ranges = <0x0 0xf0000000 0x10000000>;
	
			gpio at f0100000 {
				/* note: reg relative to local ranges property */
				reg = <0x100000 0x1000>;
				...
			};
			...
		};
		...


               i2c at d0200000 {
                        reg = <0xd0200000 0x1000>;
			...
               };

	};

I don't have the data sheet, so the bus hierarchy above is completely made up,
but I guess you get the idea. If each bus has its own local register range, it
may be helpful to use the ranges property to remap the reg properties in the
way that I did in the apb example above.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Viresh Kumar <viresh.kumar@st.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Stefan Roese <sr@denx.de>,
	"devicetree-discuss@ozlabs.org" <devicetree-discuss@ozlabs.org>,
	spear-devel <spear-devel@list.st.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v3] ARM: SPEAr600: Add device-tree support to SPEAr600 boards
Date: Thu, 15 Mar 2012 11:40:27 +0000	[thread overview]
Message-ID: <201203151140.27453.arnd@arndb.de> (raw)
In-Reply-To: <4F61CC81.1020902@st.com>

On Thursday 15 March 2012, Viresh Kumar wrote:
> On 3/15/2012 4:20 PM, Stefan Roese wrote:
> 
> > diff --git a/arch/arm/boot/dts/spear600.dtsi b/arch/arm/boot/dts/spear600.dtsi
> 
> > +/ {
> > +       compatible = "st,spear600";
> > +
> > +       cpus {
> > +               cpu@0 {
> > +                       compatible = "arm,arm926ejs";
> > +               };
> > +       };
> > +
> > +       memory {
> > +               device_type = "memory";
> > +               reg = <0 0x40000000>; /* Real value updated by U-Boot */
> > +       };
> > +
> > +       ahb {
> 
> What is the significance of this name? As i see gpio/spi etc in this list,
> which are on apb bus.

That sounds like it should be corrected, the device tree should reflect
the physical hierarchy where possible, e.g.

	ahb0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges = <0xe0000000 0xe0000000 0x10000000>;

		ethernet@e0800000 {
			...
		};

		...
	};

	ahb1 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges = <0xd0000000 0xd0000000 0x10000000>;
		ranges = <0xf0000000 0xf0000000 0x10000000>;

		apb {
			#address-cells = <1>;
			#size-cells = <1>;
			compatible = "simple-bus";
			ranges = <0x0 0xf0000000 0x10000000>;
	
			gpio@f0100000 {
				/* note: reg relative to local ranges property */
				reg = <0x100000 0x1000>;
				...
			};
			...
		};
		...


               i2c@d0200000 {
                        reg = <0xd0200000 0x1000>;
			...
               };

	};

I don't have the data sheet, so the bus hierarchy above is completely made up,
but I guess you get the idea. If each bus has its own local register range, it
may be helpful to use the ranges property to remap the reg properties in the
way that I did in the apb example above.

	Arnd

  reply	other threads:[~2012-03-15 11:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15 10:50 [PATCH v3] ARM: SPEAr600: Add device-tree support to SPEAr600 boards Stefan Roese
2012-03-15 10:50 ` Stefan Roese
2012-03-15 11:03 ` Viresh Kumar
2012-03-15 11:03   ` Viresh Kumar
2012-03-15 11:40   ` Arnd Bergmann [this message]
2012-03-15 11:40     ` Arnd Bergmann
2012-03-16  4:02     ` Viresh Kumar
2012-03-16  4:02       ` Viresh Kumar

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=201203151140.27453.arnd@arndb.de \
    --to=arnd@arndb.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.