From: Roger Quadros <rogerq@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: "Menon, Nishanth" <nm@ti.com>, Paul Walmsley <paul@pwsan.com>,
linux-usb@vger.kernel.org, linux@arm.linux.org.uk,
b-cousson@ti.com, devicetree-discuss@lists.ozlabs.org,
rnayak@ti.com, linux-kernel@vger.kernel.org, balbi@ti.com,
grygorii.strashko@ti.com, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC][PATCH 1/2] ARM: OMAP4: clock: Add device tree support for AUXCLKs
Date: Tue, 9 Apr 2013 12:55:21 +0300 [thread overview]
Message-ID: <5163E589.1040809@ti.com> (raw)
In-Reply-To: <20130405155851.GA10155@atomide.com>
On 04/05/2013 06:58 PM, Tony Lindgren wrote:
> * Roger Quadros <rogerq@ti.com> [130405 03:44]:
>> On 04/04/2013 07:41 PM, Tony Lindgren wrote:
>>> * Roger Quadros <rogerq@ti.com> [130404 00:39]:
>>>> On 04/04/2013 02:42 AM, Tony Lindgren wrote:
>>> For v3.10, let's just make sure that USB works with DT as then
>>> after v3.10 we can make omap4 DT only and get rid of estimated
>>> 7K lines of code and data. I guess this is the last piece missing
>>> for that, or are we also missing something else?
>>
>> For panda we just need a way to map the auxclk to the USB PHY device
>> and the relevant dts data to get USB host working with DT.
>> Beagle USB host should work already with DT without any changes.
>>
>>>
>>> Can't you set up a clock alias for your device so it can find the
>>> auxclk when requesting it with the dev entry?
>>>
>>
>> which clock is mapped to which PHY device depends on board design
>> and that cannot be per-determined at one place. This information
>> needs to come from the board.dts file.
>
> OK that makes sense.
>
>> There was an earlier attempt to provide a way of building clock aliases
>> at runtime from device tree [1], but the current approach is way better
>>
>> [1]
>> https://lkml.org/lkml/2013/3/12/241
>>
>>> For the DT clock driver if needed for v3.10, how about just do a
>>> minimal drivers/clock/omap/ that uses the standard binding?
>>> Then that driver can just do clk_get() from cclock44xx_data.c
>>
>> I don't understand how to do it and why it is better than the current
>> approach.
>
> Well your approach is fine as a first step moving all the clock
> code, but it needs to be a real driver under drivers/clock/omap.
> And the DT binding needs to stay the same for the driver(s) in the
> long term as we start moving clocks to DT + /lib/firmware.
The code needs to be there were the clock structs are defined.
Currently they are in arch/arm/mach-omap2/cclock44xx_data.c for OMAP4.
>
> If this all is too late for v3.10, I suggest you just set up the
> right clock alias for panda with machine_is_compatible flag in
> board-generic.c so we get EHCI working with DT for v3.10. Then
> it's easy to to deal with it properly for v3.11.
OK, let's do it this way for Panda for 3.10.
>
>> How can that driver do clk_get() from cclock44xx_data.c?
>> from where does it get the clk_id to pass into clk_get()?
>
> 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
>
>>> for now? And then later on we'll just move all the clocks to a
>>> combination of DT + /lib/firmware.
>>
>> What is the benefit of moving clock data to /lib/firmware? We could
>> as well just move it to DT only, no?
>
> DT only clocks option is naturally available with this too. It
> just gets easily inefficient with such a huge number of clocks.
>
OK.
>>>> e.g. auxclk are required to be specified in DT nodes for USB PHY.
>>>> Without this we can't get USB host working on Panda.
>>>
>>> OK. So if the USB PHY has a dev entry, can't you just set up a
>>> clock alias in struct omap_clk omap44xx_clks[] for it?
>>
>> I've explained why this can't be done above.
>
> Yes I understand now, the clock is board specific.
>
>>>> As Rajendra points out, it seems moving entire clock data to DT is not
>>>> going to happen soon. So this is the simplistic way things can work.
>>>
>>> Right but seems like we can get started there without moving
>>> them all at once.
>>>
>> What if we provide a complete clock list instead of only auxclks in
>> dt_clks[]?
>>
>> This approach is similar to arch/arm/mach-imx/clk-imx35.c
>>
>> Device drivers can then use them as they migrate to DT. Then later
>> we could migrate clock data to DT, without impacting device drivers.
>
> As long as the binding stays the same in the long run too, this
> clock remapping approach is just fine as a starting point. And
> the driver needs to go to drivers/clock/omap. But in the long run
> we just want to get the huge amounts static data out of the kernel
> for clocks and hwmod data to fix things for good.
In that case we need to identify what clocks need to be supported.
If it is all (~200) of them, is this method good enough?
cheers,
-roger
next prev parent reply other threads:[~2013-04-09 9:55 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-19 14:26 [RFC][PATCH 0/2] Device tree support for OMAP4 SCRM clocks Roger Quadros
[not found] ` <1363703220-4777-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-03-19 14:26 ` [RFC][PATCH 1/2] ARM: OMAP4: clock: Add device tree support for AUXCLKs Roger Quadros
[not found] ` <1363703220-4777-2-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-03-19 14:30 ` Roger Quadros
2013-03-21 13:08 ` Rajendra Nayak
[not found] ` <514B0650.5070406-l0cyMroinI0@public.gmane.org>
2013-03-21 13:54 ` Roger Quadros
2013-03-21 14:04 ` Rajendra Nayak
2013-03-21 14:11 ` Roger Quadros
2013-03-21 14:07 ` Roger Quadros
2013-03-26 10:23 ` [PATCH v2] " Roger Quadros
[not found] ` <1364293408-20677-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-04-02 8:23 ` Roger Quadros
[not found] ` <515A958B.5080905-l0cyMroinI0@public.gmane.org>
2013-04-05 8:47 ` Roger Quadros
2013-04-05 8:48 ` Nishanth Menon
2013-04-05 8:50 ` Roger Quadros
2013-04-03 23:42 ` [RFC][PATCH 1/2] " Tony Lindgren
2013-04-04 5:20 ` Rajendra Nayak
2013-04-04 16:33 ` Tony Lindgren
[not found] ` <20130403234242.GE10155-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2013-04-04 7:35 ` Roger Quadros
2013-04-04 16:41 ` Tony Lindgren
2013-04-05 10:39 ` Roger Quadros
2013-04-05 15:58 ` Tony Lindgren
2013-04-09 9:55 ` Roger Quadros [this message]
2013-04-09 16:49 ` Tony Lindgren
2013-04-09 17:43 ` Tony Lindgren
[not found] ` <20130409174319.GP10155-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2013-04-09 20:49 ` Nishanth Menon
2013-04-09 21:54 ` Nishanth Menon
2013-04-10 11:04 ` Roger Quadros
2013-04-09 22:22 ` Tony Lindgren
2013-04-10 8:06 ` Mike Turquette
2013-04-10 10:55 ` Roger Quadros
2013-04-10 17:39 ` Nishanth Menon
2013-04-10 18:49 ` Tony Lindgren
[not found] ` <20130410184919.GJ10155-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2013-04-10 19:19 ` Nishanth Menon
2013-04-10 20:21 ` Tony Lindgren
2013-04-11 7:48 ` Roger Quadros
2013-04-11 9:04 ` Grygorii Strashko
2013-04-11 22:45 ` Nishanth Menon
2013-04-11 18:46 ` Mike Turquette
2013-04-11 22:40 ` Nishanth Menon
2013-04-05 17:56 ` Grygorii Strashko
2013-04-09 10:16 ` Roger Quadros
2013-03-19 14:27 ` [PATCH 2/2] ARM: dts: omap4-panda: Provide PHY clock information Roger Quadros
2013-03-19 14:28 ` [RFC][PATCH 0/2] Device tree support for OMAP4 SCRM clocks Roger Quadros
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=5163E589.1040809@ti.com \
--to=rogerq@ti.com \
--cc=b-cousson@ti.com \
--cc=balbi@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grygorii.strashko@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nm@ti.com \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
--cc=tony@atomide.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 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).