linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jason@lakedaemon.net (Jason Cooper)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: kirkwood: Basic support for DNS-320 and DNS-325
Date: Sun, 11 Mar 2012 23:17:51 -0400	[thread overview]
Message-ID: <20120312031751.GY5050@titan.lakedaemon.net> (raw)
In-Reply-To: <201203111746.09757.arnd@arndb.de>

On Sun, Mar 11, 2012 at 05:46:09PM +0000, Arnd Bergmann wrote:
> On Sunday 11 March 2012, Jamie Lentin wrote:
> > Add support for the DNS-320 and DNS-325. Describe as much as currently possible
> > in the devicetree files, leave everything else in board-dt.c to be patched
> > later.
> > 
> > Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
> 
> Great work!
> 
> > +
> > +/ {
> > +	model = "D-Link DNS-320 NAS (Rev A1)";
> > +	compatible = "dlink,dns-320-a1", "dlink,dns-320", "dlink,dns-kirkwood", "marvell,kirkwood-88f6281", "marvell,kirkwood";
> > +
> > +	memory {
> > +		device_type = "memory";
> > +		reg = <0x00000000 0x8000000>;
> > +	};
> > +
> > +	chosen {
> > +		bootargs = "console=ttyS0,115200n8 earlyprintk";
> > +	};
> > +
> > +	wdt at fed20300 {
> > +		compatible = "mrvl,orion-wdt";
> > +		reg = <0xfed20300 0x28>;
> > +		clock-frequency = <166666667>;
> > +	};
> > +
> > +	serial at f1012000 {
> > +		compatible = "ns16550a";
> > +		reg = <0xf1012000 0xff>;
> > +		reg-shift = <2>;
> > +		interrupts = <33>;
> > +		clock-frequency = <166666667>;
> > +	};
> > +
> > +	serial at f1012100 {
> > +		compatible = "ns16550a";
> > +		reg = <0xf1012100 0xff>;

oops, I missed this earlier (and, I just corrected in my own code).
Arnd says Linux uses inclusive sizes, so the above should be 0x100.
Please correct for all register sizes.

> > +		reg-shift = <2>;
> > +		interrupts = <34>;
> > +		clock-frequency = <166666667>;
> > +	};
> 
> I think the generic kirkwood device nodes should all be part of
> the kirkwood.dtsi file, except for any properties you want to
> override.
> 
> You can add a status="disabled" property in device nodes
> that may not be connected in individual boards, and then
> just override it by listing status="enabled" in the board.dts
> file, without having to duplicate all the other properties.

The clock-frequency property complicates that, since it is different
from board to board.  of_serial appears to print an error message if
clock-frequency isn't set, so would this work:

### blah.dtsi ###
...
	serial at f1012100 {
		compatible = "ns16550a";
		reg = <0xf1012100 0xff>;
		reg-shift = <2>;
		interrupts = <34>;
		/* no clock set */
		status = "disabled";
	}
#################

then,

### blah-foo.dts ###
...
	serial at f1012100 {
		status = "ok";
		clock-frequency = <166666667>;
	}
####################

> I would also suggest to change the kirkwood.dtsi layout to
> put all the on-chip peripherals from the 0xf1 section into
> one bus in the device tree, like
> 
> 	ocp at f1000000 {
> 		compatible = "simple-bus";
> 		ranges = <0xf1000000 0xf1000000 0x1000000>;
> 		#address-cells = 1;
> 		#size-cells = 1;
> 
> 		serial at f1012000 {
> 			...
> 		};
> 
> 		...
> 	};
> 
> Or even use the ranges property to remap everything into
> a simpler address range:
> 
> 	ocp at f1000000 {
> 		compatible = "simple-bus";
> 		ranges = <0 0xf1000000 0x1000000>;
> 		#address-cells = 1;
> 		#size-cells = 1;
> 
> 		serial at 12000 {
> 			reg = <0x12000 0x100>;
> 			...
> 		};
> 
> 		...
> 	};

Okay, that's pretty slick.  The wdt and intc are at 0xfed00000, is that
another ocp bus?  Or, am I missing something?

thx,

Jason.

  reply	other threads:[~2012-03-12  3:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-11 14:33 [PATCH 0/2] Add support for DNS-320 and DNS-325 using devicetree Jamie Lentin
2012-03-11 14:33 ` [PATCH 1/2] ARM: kirkwood: Basic support for DNS-320 and DNS-325 Jamie Lentin
2012-03-11 17:46   ` Arnd Bergmann
2012-03-12  3:17     ` Jason Cooper [this message]
2012-03-12  8:11       ` Arnd Bergmann
2012-03-12 16:10         ` Jason Cooper
2012-03-12  3:02   ` Jason Cooper
2012-03-12  8:17     ` Arnd Bergmann
2012-03-12 14:22       ` Jamie Lentin
2012-03-12 14:27         ` Jason Cooper
2012-03-12 14:58           ` Arnd Bergmann
2012-03-12 17:59     ` Jamie Lentin
2012-03-12 18:56       ` Jason Cooper
2012-03-11 14:33 ` [PATCH 2/2] ARM: kirkwood: Convert orion-nand to fdt Jamie Lentin
2012-03-11 17:52   ` Arnd Bergmann
2012-03-12  3:23   ` Jason Cooper
2012-03-12  2:36 ` [PATCH 0/2] Add support for DNS-320 and DNS-325 using devicetree Jason Cooper

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=20120312031751.GY5050@titan.lakedaemon.net \
    --to=jason@lakedaemon.net \
    --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).