Re: [RFC][PATCH 1/2] ARM: OMAP4: clock: Add device tree support forAUXCLKs

From: Nishanth Menon
Date: Wed Apr 10 2013 - 13:39:43 EST


On 13:55-20130410, Roger Quadros wrote:
> On 04/10/2013 11:06 AM, Mike Turquette wrote:
> > Quoting Nishanth Menon (2013-04-09 13:49:00)
> >> On 10:43-20130409, Tony Lindgren wrote:
> >>> * Tony Lindgren <tony@xxxxxxxxxxx> [130409 09:54]:
> >>>> * Roger Quadros <rogerq@xxxxxx> [130409 03:00]:
> >>>>> On 04/05/2013 06:58 PM, Tony Lindgren wrote:
> >>>>>>
> >>>>>> Can't you just use the clock name there to get it?
> >>>>>
> >>>>> In device tree we don't pass around clock names. You can either get
> >>>>> a phandle or an index to the clock.
> >>>>>
> >>>>> e.g. Documentation/devicetree/bindings/clock/imx31-clock.txt
> >>>>
> >>>> Yes I understand that. But the driver/clock/omap driver can just
> >>>> remap the DT device initially so the board specific clock is
> >>>> found from the clock alias table. Basically initially a passthrough
> >>>> driver that can be enhanced to parse DT clock bindings and load
> >>>> data from /lib/firmware.
> >>>
> >>> Actually probably the driver/clock/omap can even do even less
> >>> initially. There probably even no need to remap clocks there.
> >>>
> >>> As long as the DT clock driver understands that a board specific
> >>> auxclk is specified in the DT it can just call clk_add_alias() so
> >>> the driver will get the right auxclk from cclock44xx_data.c.
> >>>
> >>> Then other features can be added later on like to allocate a
> >>> clock entirely based on the binding etc.
> >> I did try to have an implementation for cpufreq using clock nodes.
> >> unfortunately, device tree wont let me have arguments of strings :(
> >> So, I am unable to do clock = <&clk mpu_dpll>;
> >> instead, I am forced to do clock = <&clk 249>;
> >>
> >
> > See http://article.gmane.org/gmane.linux.ports.arm.kernel/229034
> >
>
> Awesome. Thanks for pointing this out Mike.
>
> Now all we need to do is create a named define for each clock index in the
> header file.
Approach #3: Thanks to Tony for collaborating on this:
Works for cpufreq-cpu0 - additional patches:
http://pastebin.com/GHnTRVJf, http://pastebin.com/FZS89J6L (tested on
beagleXM)
Work for USB - http://pastebin.com/aJpDnXci - thanks Roger for testing
this.
Details in the patch below (Tony, I have added you as collaborator for
helping in getting this working-clk_add_alias was'nt needed in the
internal patch discussion we had - I have taken a bit of freedom in
adding your contributions to the patch below)

Folks, this does seem to be the best compromise we can achieve at this
point in time. feedback on this approach is much appreciated - if folks
are ok, I can post this as an formal patch series.