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 4/4] ARM: kirkwood: convert orion-wdt to fdt.
Date: Fri, 2 Mar 2012 16:48:51 +0000	[thread overview]
Message-ID: <201203021648.52523.arnd@arndb.de> (raw)
In-Reply-To: <20120302153614.GG11986@titan.lakedaemon.net>

On Friday 02 March 2012, Jason wrote:
> > 
> > That would make wdt at fed20300/clock-frequency a phandle pointing to the
> > root property, which is not what we want here.
> 
> The 200000000 value is not the actual value used in most drivers [1],
> but rather the speed of the system clock [2] (hence, my inclination to
> make it a root property), the drivers have been pulling this number from
> a global variable [3] and dividing/rounding it as needed for their own needs
> [1].

Ah, I see. If you put a "clock-frequency" property into a device node,
it should definitely be the frequency used by that device, not the system
clock that it is derived from.

> Since it's derived from the SoC core [2], it would seem to make sense to
> have a root "clock-frequency" in the board dts.  Am I missing something?
> Is there a better way to do this?

The correct solution would be to use the clock binding, but I'm not sure
how far we are in making that final or usable.

> > > In any case, the simplest answer is to set clock-frequency in
> > > kirkwood-dreamplug.dts as a root node property, and then each driver
> > > that needs tclk, requests the clock-frequency from the root node.
> > > Hopefully, Grant can chime in on this one.
> > 
> > I think you can just pick a reasonable default value for
> > wdt at fed20300/clock-frequency, and let the board override that
> > by setting it to something else if necessary.
> 
> True, for now, I can just set clock-frequency for each device to the
> exact same value and we'll polish later once we have a better idea of
> the pattern it's following.
> 
> > I suppose this will also change a bit when kirkwood gets moved over to
> > generic clk support in the future and starts using the clk binding
> > instead of what you do now.
> 
> Yes, I don't want to over-think it, but I would like to make sure it's
> in the correct place, since it is a global property of the board.

Andrew Lunn said that he has a patch for plat-orion to use the generic
clock framework. I think we should look at that before introducing
a hack that will have to be removed again very soon.

Kirkwood/orion is probably not a bad platform to add to the initial
set of platforms for which we use the common clk infrastructure,
so maybe the best way forward for you is to take Andrews patches
and build on top of that. It might mean that your follow-on patches
get delayed until v3.5 instead of going into v3.4, but the initial
code you have in arm-soc is working already and you can work on
getting it the clock code right in the initial code.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Jason <jason@lakedaemon.net>, mturquette@linaro.org
Cc: grant.likely@secretlab.ca, Andrew Lunn <andrew@lunn.ch>,
	devicetree-discuss@lists.ozlabs.org,
	Simon Guinot <simon@sequanux.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
Date: Fri, 2 Mar 2012 16:48:51 +0000	[thread overview]
Message-ID: <201203021648.52523.arnd@arndb.de> (raw)
In-Reply-To: <20120302153614.GG11986@titan.lakedaemon.net>

On Friday 02 March 2012, Jason wrote:
> > 
> > That would make wdt@fed20300/clock-frequency a phandle pointing to the
> > root property, which is not what we want here.
> 
> The 200000000 value is not the actual value used in most drivers [1],
> but rather the speed of the system clock [2] (hence, my inclination to
> make it a root property), the drivers have been pulling this number from
> a global variable [3] and dividing/rounding it as needed for their own needs
> [1].

Ah, I see. If you put a "clock-frequency" property into a device node,
it should definitely be the frequency used by that device, not the system
clock that it is derived from.

> Since it's derived from the SoC core [2], it would seem to make sense to
> have a root "clock-frequency" in the board dts.  Am I missing something?
> Is there a better way to do this?

The correct solution would be to use the clock binding, but I'm not sure
how far we are in making that final or usable.

> > > In any case, the simplest answer is to set clock-frequency in
> > > kirkwood-dreamplug.dts as a root node property, and then each driver
> > > that needs tclk, requests the clock-frequency from the root node.
> > > Hopefully, Grant can chime in on this one.
> > 
> > I think you can just pick a reasonable default value for
> > wdt@fed20300/clock-frequency, and let the board override that
> > by setting it to something else if necessary.
> 
> True, for now, I can just set clock-frequency for each device to the
> exact same value and we'll polish later once we have a better idea of
> the pattern it's following.
> 
> > I suppose this will also change a bit when kirkwood gets moved over to
> > generic clk support in the future and starts using the clk binding
> > instead of what you do now.
> 
> Yes, I don't want to over-think it, but I would like to make sure it's
> in the correct place, since it is a global property of the board.

Andrew Lunn said that he has a patch for plat-orion to use the generic
clock framework. I think we should look at that before introducing
a hack that will have to be removed again very soon.

Kirkwood/orion is probably not a bad platform to add to the initial
set of platforms for which we use the common clk infrastructure,
so maybe the best way forward for you is to take Andrews patches
and build on top of that. It might mean that your follow-on patches
get delayed until v3.5 instead of going into v3.4, but the initial
code you have in arm-soc is working already and you can work on
getting it the clock code right in the initial code.

	Arnd

  reply	other threads:[~2012-03-02 16:48 UTC|newest]

Thread overview: 272+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
2012-03-01 18:20 ` Jason Cooper
2012-03-01 18:20 ` [PATCH 1/4] ARM: kirkwood: move var setting to correct location Jason Cooper
2012-03-01 18:20   ` Jason Cooper
2012-03-01 18:20 ` [PATCH 2/4] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
2012-03-01 18:20   ` Jason Cooper
2012-03-02  7:09   ` Grant Likely
2012-03-02  7:09     ` Grant Likely
2012-03-01 18:20 ` [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt Jason Cooper
2012-03-01 18:20   ` Jason Cooper
2012-03-01 19:35   ` Arnd Bergmann
2012-03-01 19:35     ` Arnd Bergmann
2012-03-01 21:26     ` Jason
2012-03-01 21:26       ` Jason
2012-03-02  7:19   ` Grant Likely
2012-03-02  7:19     ` Grant Likely
2012-03-02  9:48     ` Arnd Bergmann
2012-03-02  9:48       ` Arnd Bergmann
2012-03-02 16:27     ` Jason
2012-03-02 16:27       ` Jason
2012-03-04 14:59   ` Michael Walle
2012-03-04 14:59     ` Michael Walle
2012-03-04 16:48     ` Arnd Bergmann
2012-03-04 16:48       ` Arnd Bergmann
2012-03-04 22:27       ` Jason
2012-03-04 22:27         ` Jason
2012-03-04 23:22         ` Michael Walle
2012-03-04 23:22           ` Michael Walle
2012-03-01 18:20 ` [PATCH 4/4] ARM: kirkwood: convert orion-wdt " Jason Cooper
2012-03-01 18:20   ` Jason Cooper
2012-03-01 19:48   ` Arnd Bergmann
2012-03-01 19:48     ` Arnd Bergmann
2012-03-02  7:22   ` Grant Likely
2012-03-02  7:22     ` Grant Likely
2012-03-02  9:15   ` Simon Guinot
2012-03-02  9:15     ` Simon Guinot
2012-03-02 14:15     ` Jason
2012-03-02 14:15       ` Jason
2012-03-02 14:56       ` Arnd Bergmann
2012-03-02 14:56         ` Arnd Bergmann
2012-03-02 15:36         ` Jason
2012-03-02 15:36           ` Jason
2012-03-02 16:48           ` Arnd Bergmann [this message]
2012-03-02 16:48             ` Arnd Bergmann
2012-03-02 17:02             ` Jason
2012-03-02 17:02               ` Jason
2012-03-02 22:36               ` Andrew Lunn
2012-03-02 22:36                 ` Andrew Lunn
2012-03-03 22:54                 ` Jason
2012-03-03 22:54                   ` Jason
2012-03-01 19:50 ` [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs " Arnd Bergmann
2012-03-01 19:50   ` Arnd Bergmann
2012-03-01 20:01   ` Jason
2012-03-01 20:01     ` Jason
2012-03-01 20:28     ` Arnd Bergmann
2012-03-01 20:28       ` Arnd Bergmann
2012-03-01 21:23       ` Jason
2012-03-01 21:23         ` Jason
2012-03-01 22:14         ` Arnd Bergmann
2012-03-01 22:14           ` Arnd Bergmann
2012-03-02 16:31           ` Jason
2012-03-02 16:31             ` Jason
2012-03-02 16:58             ` Arnd Bergmann
2012-03-02 16:58               ` Arnd Bergmann
2012-03-02 17:04               ` Jason
2012-03-02 17:04                 ` Jason
2012-03-02 17:50 ` [PATCH 0/5 v2] " Jason Cooper
2012-03-02 17:50   ` Jason Cooper
2012-03-02 17:50   ` [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi " Jason Cooper
2012-03-02 17:50     ` Jason Cooper
2012-03-04 18:12     ` Michael Walle
2012-03-04 18:12       ` Michael Walle
2012-03-04 20:29       ` Arnd Bergmann
2012-03-04 20:29         ` Arnd Bergmann
2012-03-02 17:50   ` [PATCH 2/5] ARM: kirkwood: move var setting to correct location Jason Cooper
2012-03-02 17:50     ` Jason Cooper
2012-03-02 17:50   ` [PATCH 3/5 v2] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
2012-03-02 17:50     ` Jason Cooper
2012-03-02 17:50   ` [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt Jason Cooper
2012-03-02 17:50     ` Jason Cooper
2012-03-04 15:12     ` Michael Walle
2012-03-04 15:12       ` Michael Walle
2012-03-04 16:50       ` Arnd Bergmann
2012-03-04 16:50         ` Arnd Bergmann
2012-03-05  0:17         ` Jason
2012-03-05  0:17           ` Jason
2012-03-02 17:50   ` [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt " Jason Cooper
2012-03-02 17:50     ` Jason Cooper
2012-03-02 18:32     ` Arnd Bergmann
2012-03-02 18:32       ` Arnd Bergmann
2012-03-02 19:57       ` Jason
2012-03-02 19:57         ` Jason
2012-03-02 20:02         ` Arnd Bergmann
2012-03-02 20:02           ` Arnd Bergmann
     [not found]       ` <201203021832.34901.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-02 20:00         ` [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs " Jason
2012-03-02 20:35           ` Arnd Bergmann
2012-03-02 20:35             ` Arnd Bergmann
2012-03-02 21:18             ` Arnd Bergmann
2012-03-02 21:18               ` Arnd Bergmann
2012-03-05 18:49               ` Nicolas Pitre
2012-03-05 18:49                 ` Nicolas Pitre
2012-03-05 19:15                 ` Jason
2012-03-05 19:15                   ` Jason
2012-03-05 20:16                   ` Arnd Bergmann
2012-03-05 20:16                     ` Arnd Bergmann
2012-03-05 20:29                     ` Jason
2012-03-05 20:29                       ` Jason
2012-03-05 20:43                       ` Nicolas Pitre
2012-03-05 20:43                         ` Nicolas Pitre
2012-03-05 21:17                         ` Jason
2012-03-05 21:17                           ` Jason
2012-03-05 21:27                           ` Nicolas Pitre
2012-03-05 21:27                             ` Nicolas Pitre
2012-03-06 14:29                             ` Jason
2012-03-06 14:29                               ` Jason
2012-03-03 10:08       ` [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt " Russell King - ARM Linux
2012-03-03 10:08         ` Russell King - ARM Linux
2012-03-03 23:05         ` Jason
2012-03-03 23:05           ` Jason
2012-03-02 17:52   ` [PULL REQUEST] ARM: kirkwood: fdt: convert kirkwood init funcs " Jason
2012-03-02 17:52     ` Jason
2012-03-02 17:56     ` Jason
2012-03-02 17:56       ` Jason
2012-03-07  3:44 ` [PATCH 0/14 v3] ARM: kirkwood: fdt: convert kirkwood " Jason Cooper
2012-03-07  3:44   ` Jason Cooper
2012-03-07  3:44   ` [PATCH 01/14] ARM: orion: spi: remove enable_clock_fix which is not used Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-09  4:33     ` Grant Likely
2012-03-09  4:33       ` Grant Likely
2012-03-07  3:44   ` [PATCH 02/14] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 03/14] ARM: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 04/14] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 05/14] ARM: kirkwood: add interrupt controller to devicetree Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 06/14] ARM: kirkwood: convert uart0 " Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07 18:31     ` Arnd Bergmann
2012-03-07 18:31       ` Arnd Bergmann
2012-03-07 18:37       ` Jason
2012-03-07 18:37         ` Jason
2012-03-07 19:27       ` Jason
2012-03-07 19:27         ` Jason
2012-03-07 20:05         ` Andrew Lunn
2012-03-07 20:05           ` Andrew Lunn
2012-03-07 20:55           ` Jason
2012-03-07 20:55             ` Jason
2012-03-07 21:13         ` Arnd Bergmann
2012-03-07 21:13           ` Arnd Bergmann
2012-03-07 21:29           ` Jason
2012-03-07 21:29             ` Jason
2012-03-08 16:25           ` Jason
2012-03-08 16:25             ` Jason
2012-03-08 17:01             ` Arnd Bergmann
2012-03-08 17:01               ` Arnd Bergmann
2012-03-08 17:41               ` Arnd Bergmann
2012-03-08 17:41                 ` Arnd Bergmann
2012-03-08 19:27               ` Thomas Gleixner
2012-03-08 19:27                 ` Thomas Gleixner
2012-03-08 19:47                 ` Jason
2012-03-08 19:47                   ` Jason
2012-03-08 21:32                   ` Grant Likely
2012-03-08 21:32                     ` Grant Likely
2012-03-08 21:50                     ` Jason
2012-03-08 21:50                       ` Jason
2012-03-08 22:22                       ` Rob Herring
2012-03-08 22:22                         ` Rob Herring
2012-03-08 21:27           ` Grant Likely
2012-03-08 21:27             ` Grant Likely
2012-03-08 23:14             ` Arnd Bergmann
2012-03-08 23:14               ` Arnd Bergmann
2012-03-07 21:47         ` Michael Walle
2012-03-07 21:47           ` Michael Walle
2012-03-08 21:31         ` Grant Likely
2012-03-08 21:31           ` Grant Likely
2012-03-08 21:55           ` Jason
2012-03-08 21:55             ` Jason
2012-03-07  3:44   ` [PATCH 07/14] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 08/14] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07 18:32     ` Arnd Bergmann
2012-03-07 18:32       ` Arnd Bergmann
2012-03-07  3:44   ` [PATCH 09/14] ARM: kirkwood: mv_cesa devicetree bindings Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 10/14] ARM: kirkwood: mv_cesa devicetree support Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 11/14] ARM: kirkwood: ehci-orion: add device tree binding Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 12/14] ARM: kirkwood: use devicetree for orion-ehci Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 13/14] ARM: kirkwood: sata_mv: add device tree binding Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07  3:44   ` [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv Jason Cooper
2012-03-07  3:44     ` Jason Cooper
2012-03-07 18:40     ` Arnd Bergmann
2012-03-07 18:40       ` Arnd Bergmann
2012-03-07 18:52       ` Jason
2012-03-07 18:52         ` Jason
2012-03-07 19:00         ` Arnd Bergmann
2012-03-07 19:00           ` Arnd Bergmann
2012-03-13  1:57 ` [PATCH 0/7 v4] ARM: kirkwood: fdt: convert kirkwood to fdt Jason Cooper
2012-03-13  1:57   ` Jason Cooper
2012-03-13  1:57   ` [PATCH 1/7] ARM: orion: spi: remove enable_clock_fix which is not used Jason Cooper
2012-03-13  1:57     ` Jason Cooper
2012-03-13  1:57   ` [PATCH 2/7] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data Jason Cooper
2012-03-13  1:57     ` Jason Cooper
2012-03-13  1:57   ` [PATCH 3/7 v2] ARM: orion: wdt: use resource vice direct access Jason Cooper
2012-03-13  1:57     ` Jason Cooper
2012-03-13  9:54     ` Arnd Bergmann
2012-03-13  9:54       ` Arnd Bergmann
2012-03-13  1:57   ` [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-03-13  1:57     ` Jason Cooper
2012-03-13 10:10     ` Arnd Bergmann
2012-03-13 10:10       ` Arnd Bergmann
2012-03-13 13:12       ` Jason Cooper
2012-03-13 13:12         ` Jason Cooper
2012-04-05 22:07     ` Ian Campbell
2012-04-05 22:07       ` Ian Campbell
2012-04-05 22:41       ` Jason Cooper
2012-04-05 22:41         ` Jason Cooper
2012-04-06  8:52         ` Ian Campbell
2012-04-06  8:52           ` Ian Campbell
     [not found]         ` <384286E8-E5C8-4069-9702-8A24C70D799C@gmail.com>
2012-04-16 13:27           ` dreamplug kernel and uboot code and apparent dreamplug board design change Jason Cooper
2012-03-13  1:57   ` [PATCH 5/7 v2] ARM: kirkwood: convert uart0 to devicetree Jason Cooper
2012-03-13  1:57     ` Jason Cooper
2012-03-13 13:18     ` Jason Cooper
2012-03-13 13:18       ` Jason Cooper
2012-03-13  1:57   ` [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
2012-03-13  1:57     ` Jason Cooper
2012-03-13  9:57     ` Arnd Bergmann
2012-03-13  9:57       ` Arnd Bergmann
2012-03-13 10:03     ` Uwe Kleine-König
2012-03-13 10:03       ` Uwe Kleine-König
2012-03-13  1:57   ` [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
2012-03-13  1:57     ` Jason Cooper
2012-03-13  9:58     ` Arnd Bergmann
2012-03-13  9:58       ` Arnd Bergmann
2012-03-13 13:22       ` Jason Cooper
2012-03-13 13:22         ` Jason Cooper
2012-03-13 13:44         ` Arnd Bergmann
2012-03-13 13:44           ` Arnd Bergmann
2012-03-16  4:21 ` [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt Jason Cooper
2012-03-16  4:21   ` Jason Cooper
2012-03-16  4:21   ` [PATCH 1/9] ARM: orion: spi: remove enable_clock_fix which is not used Jason Cooper
2012-03-16  4:21     ` Jason Cooper
2012-03-16  4:21   ` [PATCH 2/9] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data Jason Cooper
2012-03-16  4:21     ` Jason Cooper
2012-03-16  4:21   ` [PATCH 3/9 v3] ARM: orion: wdt: use resource vice direct access Jason Cooper
2012-03-16  4:21     ` Jason Cooper
2012-03-16  4:21   ` [PATCH 4/9] ARM: kirkwood: fdt: use mrvl ticker symbol Jason Cooper
2012-03-16  4:21     ` Jason Cooper
2012-03-16  4:21   ` [PATCH 5/9] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
2012-03-16  4:21     ` Jason Cooper
2012-03-16  4:21   ` [PATCH 6/9 v2] ARM: kirkwood: fdt: facilitate new boards during fdt migration Jason Cooper
2012-03-16  4:21     ` Jason Cooper
2012-03-16  4:21   ` [PATCH 7/9] ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0 Jason Cooper
2012-03-16  4:21     ` Jason Cooper
2012-03-16  4:21   ` [PATCH 8/9 v2] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
2012-03-16  4:21     ` Jason Cooper
2012-03-16  4:21   ` [PATCH 9/9] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
2012-03-16  4:21     ` Jason Cooper
2012-03-16 20:18   ` [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt Arnd Bergmann
2012-03-16 20:18     ` Arnd Bergmann
2012-03-16 20:28     ` Jason Cooper
2012-03-16 20:28       ` Jason Cooper
2012-03-16 20:41       ` Arnd Bergmann
2012-03-16 20:41         ` Arnd Bergmann
2012-03-16 21:02         ` Jason Cooper
2012-03-16 21:02           ` 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=201203021648.52523.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.