All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Iles <jamie@jamieiles.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Jamie Iles <jamie@jamieiles.com>,
	linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	Rob Herring <rob.herring@calxeda.com>,
	Sascha Hauer <kernel@pengutronix.de>,
	Mike Turquette <mturquette@ti.com>
Subject: Re: [RFC v2 4/9] of: add clock providers
Date: Thu, 12 Jan 2012 10:07:02 +0000	[thread overview]
Message-ID: <20120112100702.GM3226@page> (raw)
In-Reply-To: <CACxGe6vqb8AZcZb5WMvfmLsUZH7=SEtBrJCSfsFmDYpKX42MzA@mail.gmail.com>

On Wed, Jan 11, 2012 at 09:46:58PM -0700, Grant Likely wrote:
> On Tue, Jan 10, 2012 at 2:33 PM, Jamie Iles <jamie@jamieiles.com> wrote:
> > On Mon, Dec 12, 2011 at 03:02:04PM -0700, Grant Likely wrote:
> >> +- clock-output-names : From common clock binding
> >> +
> >> +Example:
> >> +     clock {
> >> +             compatible = "fixed-clock";
> >> +             #clock-cells = <0>;
> >> +             clock-frequency = <1000000000>;
> >> +     };
> >
> > I wonder if this should have an optional clock consumer with a standard
> > name for parenting?  For example, on picoxcell there is a fixed 200MHz
> > APB clock that is really a PLL from a 20MHz reference input and I'd like
> > to represent that in the clock tree.
> 
> If it depends on a parent clock, then it really isn't a fixed clock,
> is it (from the perspective of the OS).  The point of this binding is
> a trivial way to describe clocks that don't change.  If that
> assumption doesn't hold true, then this binding isn't suitable for
> that clock.  As you point out, even the gpio enable feature is pushing
> things a bit.
> 
> That said, I'm open to extending this binding if something can be
> defined that will have a lot of use cases.

Well for picoxcell where the 200MHz APB clock is just a PLL generated 
from a 20MHz clock then it kind of is a fixed clock as far as Linux is 
concerned isn't it?  The rate can't be changed and and the clock can't 
be disabled so it's just a dumb clock with a parent.

I guess I could just omit the parent as far as Linux is concerned, but 
it would be nice to represent the real clock tree if possible.

> > I'm about to start trying to get this and Mike's common struct clk
> > patches working on picoxcell, and the one thing I'm not understanding at
> > the moment is how to handle the tree itself.  Currently I was planning
> > on iterating over all clocks and finding a named input clock "ref" or
> > "input" perhaps.  This would be fine for picoxcell, but I guess more
> > complicated chips may need something else.
> 
> It might be useful to have something like of_irq_init() for setting up
> initial clocks, but the solution feels inelegant to me.  I suspect
> that there will be end up being intertwined init order dependencies
> between clocks and irqs and other early setup stuff that could be
> handled better.  Again, I need to think about this some more.  There
> might need to be something like an of_early_probe() call that accepts
> a match table of compatible values and setup functions with some logic
> or data to resolve dependencies.  The trick will be to not end up with
> something complex.  I'll need to think about this more...

Yes, probably not an easy problem to solve, especially for the platforms 
where the parent can change at runtime.

I wonder if an of_clk_init() could take a platform callback, so that 
of_clk_init() goes of and creates a struct clk for each clk in the DT, 
then for each registered clock calls a platform specific callback which 
returns the parent (if any).  It feels like a fairly platform specific 
problem to me.

Jamie

  reply	other threads:[~2012-01-12 10:07 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12 22:02 [RFC v2 1/9] arm/versatile*: merge all versatile struct clk definitions Grant Likely
2011-12-12 22:02 ` Grant Likely
2011-12-12 22:02 ` [RFC v2 5/9] dt/clock: Add handling for fixed clocks and a clock node setup iterator Grant Likely
     [not found]   ` <1323727329-4989-5-git-send-email-grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2011-12-15 15:19     ` Shawn Guo
2011-12-15 15:19       ` Shawn Guo
     [not found] ` <1323727329-4989-1-git-send-email-grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2011-12-12 22:02   ` [RFC v2 2/9] arm/versatile*: Consolidate clk_ops and setvco implementations Grant Likely
2011-12-12 22:02     ` Grant Likely
2011-12-12 22:02   ` [RFC v2 3/9] of: Add of_property_match_string() to find index into a string list Grant Likely
2011-12-12 22:02     ` Grant Likely
2011-12-12 22:02   ` [RFC v2 4/9] of: add clock providers Grant Likely
2011-12-12 22:02     ` Grant Likely
     [not found]     ` <1323727329-4989-4-git-send-email-grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2011-12-12 23:29       ` Jamie Iles
2011-12-12 23:29         ` Jamie Iles
2011-12-13 17:54         ` Grant Likely
2011-12-13 17:54           ` Grant Likely
2011-12-13 18:01           ` Rob Herring
2011-12-13 18:03             ` Grant Likely
2011-12-15 13:51           ` Shawn Guo
2011-12-15 13:51             ` Shawn Guo
     [not found]             ` <20111215135129.GA2831-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-12-15 14:23               ` Rob Herring
2011-12-15 14:23                 ` Rob Herring
2011-12-15 15:13                 ` Shawn Guo
2011-12-15 15:13                   ` Shawn Guo
     [not found]                   ` <20111215151335.GB2831-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-12-15 17:37                     ` Grant Likely
2011-12-15 17:37                       ` Grant Likely
2012-01-10 21:33       ` Jamie Iles
2012-01-10 21:33         ` Jamie Iles
2012-01-12  4:46         ` Grant Likely
2012-01-12  4:46           ` Grant Likely
2012-01-12 10:07           ` Jamie Iles [this message]
2012-01-12 18:44             ` Turquette, Mike
2012-01-12 19:16               ` Grant Likely
     [not found]           ` <CACxGe6vqb8AZcZb5WMvfmLsUZH7=SEtBrJCSfsFmDYpKX42MzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-13 12:47             ` Shawn Guo
2012-01-13 12:47               ` Shawn Guo
2012-01-14  4:30               ` Turquette, Mike
2012-01-14  5:40                 ` Shawn Guo
2012-01-13 13:50       ` Shawn Guo
2012-01-13 13:50         ` Shawn Guo
     [not found]         ` <20120113135036.GC17029-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-01-13 14:05           ` Rob Herring
2012-01-13 14:05             ` Rob Herring
     [not found]             ` <4F103A21.1050403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-01-13 14:38               ` Shawn Guo
2012-01-13 14:38                 ` Shawn Guo
2012-01-17 20:44     ` Stephen Warren
2012-01-17 22:47       ` Grant Likely
2012-01-17 23:37         ` Turquette, Mike
     [not found]           ` <CAJOA=zMgGsZKGQ-EfSnXDY_WoFrzG6XPZtuxANFKqdL8CAaYrw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-17 23:49             ` Grant Likely
2012-01-17 23:49               ` Grant Likely
2012-01-18  0:05             ` Stephen Warren
2012-01-18  0:05               ` Stephen Warren
2011-12-12 22:02   ` [RFC v2 6/9] arm/dt: add devicetree support to sp804 timer support Grant Likely
2011-12-12 22:02     ` Grant Likely
2011-12-12 23:54     ` Rob Herring
     [not found]       ` <4EE69446.2060009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-12-13  0:29         ` Grant Likely
2011-12-12 22:02   ` [RFC v2 9/9] arm/highbank: Use clock binding common support code Grant Likely
2011-12-12 22:02     ` Grant Likely
2011-12-12 22:02 ` [RFC v2 7/9] arm/dt: Common plat-versatile support for icst and sp804 based system clocks Grant Likely
     [not found]   ` <1323727329-4989-7-git-send-email-grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2012-01-17 21:05     ` Stephen Warren
2012-01-17 21:05       ` Stephen Warren
2012-01-17 22:02       ` Rob Herring
2012-01-17 22:59       ` Grant Likely
2011-12-12 22:02 ` [RFC v2 8/9] dt/arm: versatile add clock parsing Grant Likely

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=20120112100702.GM3226@page \
    --to=jamie@jamieiles.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@ti.com \
    --cc=rob.herring@calxeda.com \
    /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.