public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/7] ARM: mach-shmobile: sh73a0: Minimal setup using DT
Date: Mon, 26 Nov 2012 13:53:06 +0100	[thread overview]
Message-ID: <67705146.EhpdzQI6yT@avalon> (raw)
In-Reply-To: <20121126045805.GC12790@verge.net.au>

Hi Simon,

On Monday 26 November 2012 13:58:06 Simon Horman wrote:
> On Mon, Nov 26, 2012 at 01:23:12PM +0900, Magnus Damm wrote:
> > On Mon, Nov 26, 2012 at 9:16 AM, Simon Horman <horms@verge.net.au> wrote:
> > > Allow a minimal setup of the sh73a0 SoC using a flattened device tree.
> > > 
> > > * Allow configuration of the i2c controllers using a flattened device
> > >   tree.
> > > 
> > > * SCI serial controller and CMT clock source, whose drivers do not yet
> > >   support configuration using a flattened device tree, are still
> > >   configured
> > >   using C code in order to allow booting of a board with this SoC.
> > > 
> > > An example dts snuppet follows:
> > >         i2c0: i2c at 0xe6820000 {
> > >         
> > >                 #address-cells = <1>;
> > >                 #size-cells = <0>;
> > >                 compatible = "renesas,rmobile-iic";
> > >                 reg = <0xe6820000 0x425>;
> > >                 interrupt-parent = <&gic>;
> > >                 interrupts = <0 167 0x4
> > >                 
> > >                               0 170 0x4>;
> > >         
> > >         };
> > >         
> > >         i2c1: i2c at 0xe6822000 {
> > >         
> > >                 #address-cells = <1>;
> > >                 #size-cells = <0>;
> > >                 compatible = "renesas,rmobile-iic";
> > >                 reg = <0xe6822000 0x425>;
> > >                 interrupt-parent = <&gic>;
> > >                 interrupts = <0 51 0x4
> > >                 
> > >                               0 44 0x4>;
> > >                 
> > >                 touchscreen at 55 {
> > >                 
> > >                         compatible = "sitronix,st1232";
> > >                         reg = <0x55>;
> > >                         interrupt-parent = <&gic>;
> > >                         interrupts = <0 9 0x4>;
> > >                 
> > >                 };
> > >         
> > >         };
> > >         
> > >         i2c2: i2c at 0xe6824000 {
> > >         
> > >                 #address-cells = <1>;
> > >                 #size-cells = <0>;
> > >                 compatible = "renesas,rmobile-iic";
> > >                 reg = <0xe6824000 0x425>;
> > >                 interrupt-parent = <&gic>;
> > >                 interrupts = <0 171 0x4
> > >                 
> > >                               0 174 0x4>;
> > >         
> > >         };
> > >         
> > >         i2c3: i2c at 0xe6826000 {
> > >         
> > >                 #address-cells = <1>;
> > >                 #size-cells = <0>;
> > >                 compatible = "renesas,rmobile-iic";
> > >                 reg = <0xe6826000 0x425>;
> > >                 interrupt-parent = <&gic>;
> > >                 interrupts = <0 183 0x4
> > >                 
> > >                               0 186 0x4>;
> > >         
> > >         };
> > >         
> > >         i2c4: i2c at 0xe6828000 {
> > >         
> > >                 #address-cells = <1>;
> > >                 #size-cells = <0>;
> > >                 compatible = "renesas,rmobile-iic";
> > >                 reg = <0xe6828000 0x425>;
> > >                 interrupt-parent = <&gic>;
> > >                 interrupts = <0 187 0x4
> > >                 
> > >                               0 190 0x4>;
> > >         
> > >         };
> > 
> > Uhm, doesn't the above want to go into sh73a0.dtsi?
> 
> There are two things that I am unsure of:
> 
> * What should go into sh73a0.dtsi and what should go into
>   sh73a0-kzm9g-refere3nce.dts.
> 
>   The i2c seems like it should go into sh73a0.dtsi as it is part of the
>   soc. Likewise the interrupt controllers.
> 
>   But when it comes to mmcif and sdhi I am less sure. Both of these make use
>   of regulators. Are the regulators part of the board or the SoC?

It depends on the regulators. In theory you could have on-SoC regulators that 
would thus be part of the SoC. In practice I'm not sure how often that 
happens.

Most of the regulators are provided by the PMIC, so we can create PMIC-
specific .dtsi files that would be included by boards. See twl4030.dtsi for an 
example. Other board-specific regulators, including fixed regulators, should 
be provided by the board.

>   If the are part of the board then it makes it more difficult to put mmcif
>   and sdhi into sh73a0.dtsi as they need to reference the regulators
>   somehow.

I think you can split a node across several files. You could have

        mmcif: mmcif at 0x10010000 {
                compatible = "renesas,sh-mmcif";
                reg = <0xe6bd0000 0x100>;
                interrupt-parent = <&gic>;
                interrupts = <0 140 0x4
                              0 141 0x4>;
                reg-io-width = <4>;
        };

in the SoC .dtsi, and

        &mmcif {
                vmmc-supply = <&fixedregulator1v8>;
                vqmmc-supply = <&fixedregulator1v8>;
        };

in the board .dts.

> * What to do the of_dev_auxdata.
> 
>   Currently I add this in patch 4 to the board-kzm9g.c. It is used to force
>   the name of the i2c, mmcif and sdhi devices in order to allow their clock
>   lookup to work (though come to think of it it may not be necessary for
>   mmcif and sdhi).

Shouldn't clocks be specified as an attribute in DT nodes that reference the 
clock node ?

>   In any case, the location of the of_dev_auxdata might be come a bit
>   tricky if it covers devices in both the board and SoC dts files.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2012-11-26 12:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26  0:16 [PATCH 0/7] ARM: mach-shmobile: kzm9g: Reference DT implementation Simon Horman
2012-11-26  0:16 ` [PATCH 1/7] mmc: sh-mmcif: provide default allowed voltage Simon Horman
2012-11-26  4:06   ` Magnus Damm
2012-11-26  4:39     ` Simon Horman
2012-11-26  0:16 ` [PATCH 2/7] mmc: sdhi: enchance OF support for flags and cd-gpios Simon Horman
2012-11-26 10:16   ` Guennadi Liakhovetski
2012-11-26 10:18   ` Guennadi Liakhovetski
2012-11-26  0:16 ` [PATCH 3/7] sh: pfc: Allow device tree registration Simon Horman
2012-11-26 12:54   ` Laurent Pinchart
2012-11-27  0:07   ` Laurent Pinchart
2012-11-27  0:42     ` Simon Horman
2012-11-26  0:16 ` [PATCH 4/7] ARM: shmobile: pfc-sh73a0: Register device tree Simon Horman
2012-11-26 14:06   ` Laurent Pinchart
2012-11-27  3:36     ` Simon Horman
2012-11-26  0:16 ` [PATCH 5/7] ARM: mach-shmobile: sh73a0: Allow initialisation of GIC by DT Simon Horman
2012-11-26  0:16 ` [PATCH 6/7] ARM: mach-shmobile: sh73a0: Minimal setup using DT Simon Horman
2012-11-26  4:23   ` Magnus Damm
2012-11-26  4:58     ` Simon Horman
2012-11-26 12:53       ` Laurent Pinchart [this message]
2012-11-27  0:32         ` Simon Horman
2012-11-26  0:16 ` [PATCH 7/7] ARM: mach-shmobile: kzm9g: Reference DT implementation Simon Horman
2012-11-26  8:34   ` Tetsuyuki Kobayashi
2012-11-27  0:33     ` Simon Horman
2012-11-26  6:10 ` [PATCH 0/7] " Tetsuyuki Kobayashi
2012-11-27  0:32   ` Simon Horman

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=67705146.EhpdzQI6yT@avalon \
    --to=laurent.pinchart@ideasonboard.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