From: Roger Quadros <rogerq@ti.com>
To: Rajendra Nayak <rnayak@ti.com>
Cc: tony@atomide.com, b-cousson@ti.com, balbi@ti.com,
stern@rowland.harvard.edu, linux@arm.linux.org.uk,
linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-omap@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
paul@pwsan.com
Subject: Re: how to specify an OMAP clock in device tree?
Date: Tue, 5 Feb 2013 15:46:51 +0200 [thread overview]
Message-ID: <51110D4B.50904@ti.com> (raw)
In-Reply-To: <5110E9C4.9000301@ti.com>
On 02/05/2013 01:15 PM, Rajendra Nayak wrote:
> On Tuesday 05 February 2013 03:04 PM, Roger Quadros wrote:
>> Hi Rajendra,
>>
>> On 02/04/2013 05:58 PM, Roger Quadros wrote:
>>> Provide the RESET and Power regulators for the USB PHY,
>>> the USB Host port mode and the PHY device.
>>>
>>> Also provide pin multiplexer information for the USB host
>>> pins.
>>>
>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>>> ---
>>> arch/arm/boot/dts/omap4-panda.dts | 55 +++++++++++++++++++++++++++++++++++++
>>> 1 files changed, 55 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
>>> index 4122efe..fe2d3d4 100644
>>> --- a/arch/arm/boot/dts/omap4-panda.dts
>>> +++ b/arch/arm/boot/dts/omap4-panda.dts
>>> @@ -57,6 +57,35 @@
>>> "AFML", "Line In",
>>> "AFMR", "Line In";
>>> };
>>> +
>>> + /* HS USB Port 1 RESET */
>>> + hsusb1_reset: hsusb1_reset_reg {
>>> + compatible = "regulator-fixed";
>>> + regulator-name = "hsusb1_reset";
>>> + regulator-min-microvolt = <3300000>;
>>> + regulator-max-microvolt = <3300000>;
>>> + gpio = <&gpio2 30 0>; /* gpio_62 */
>>> + startup-delay-us = <70000>;
>>> + enable-active-high;
>>> + };
>>> +
>>> + /* HS USB Port 1 Power */
>>> + hsusb1_power: hsusb1_power_reg {
>>> + compatible = "regulator-fixed";
>>> + regulator-name = "hsusb1_vbus";
>>> + regulator-min-microvolt = <3300000>;
>>> + regulator-max-microvolt = <3300000>;
>>> + gpio = <&gpio1 1 0>; /* gpio_1 */
>>> + startup-delay-us = <70000>;
>>> + enable-active-high;
>>> + };
>>> +
>>> + /* HS USB Host PHY on PORT 1 */
>>> + hsusb1_phy: hsusb1_phy {
>>> + compatible = "usb-nop-xceiv";
>>> + reset-supply = <&hsusb1_reset>;
>>> + vcc-supply = <&hsusb1_power>;
>>> + };
>>
>> This is the patch I was discussing with you about before.
>>
>> Let me explain the problem again.
>>
>> The Pandaboard has a USB PHY whose reference clock is provided by
>> FREF_CLK3 pin which is a clock generated by the OMAP.
>> The PHY driver expects a reference to this clock in the PHY device node.
>
> Well, the driver just does a clk_get(dev, "main_clk"); and clk_get() is
> then able to either pick the reference from the PHY dt node or from a
> clkdev entry.
>
> The problem here seems to be that you are not able to add a clkdev entry
> because the device name wouldn't be fixed, since you have a node in
> the form of 'node: node {'. All other onchip OMAP devices don't have
> this issue because they have an entry in the form of 'node: node@addr'
> and hence have a fixed device name and hence can add a clkdev entry for
> the clocks they want to control.
>
> I don't know if there is any good way to define the DT node for the
> on board PHY in such a way that the device name is always fixed, in
> which case you can then add a clkdev entry for 'dev, main_clk' mapping
> to the onchip clock that provides the clock, but if there is one, then
> that should fix your problem.
Fixing the device name doesn't really solve the problem.
Not all OMAP boards will use the same clock for the external device.
So you can't provide this information in some common clock data file.
The data has to come from a board specific location, which in the DT boot
case is the board's dts file.
I think all we need to do is register a clock provider using of_clk_add_provider()
and provide a clk_src_get() hook that can get the right clock.
usage e.g.
/* provider */
clks: omapclocks {
compatible = "ti,omapclocks";
#clock-cells = <1>;
};
/* consumer */
hsusb1_phy: hsusb1_phy {
compatible = "usb-nop-xceiv";
clocks = <&clks "auxclk3_ck">; /* FREF_CLK3 */
clock-names = "main-clk";
};
The only problem I see is that the argument to the clks phandle
cannot be a string. It needs to be u32.
In that case we need to map all clocks into a u32 index.
If we can do that only for auxclks, my problem is solved for panda.
The usage e.g then changes to
/* provider */
aux_clks: omap_aux_clocks {
compatible = "ti,omap_aux_clocks";
#clock-cells = <1>;
};
/* consumer */
hsusb1_phy: hsusb1_phy {
compatible = "usb-nop-xceiv";
clocks = <&aux_clks 3>; /* FREF_CLK3 */
clock-names = "main-clk";
};
Does this idea sound reasonable?
regards,
-roger
next prev parent reply other threads:[~2013-02-05 13:46 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-04 15:58 [PATCH 00/13] Device tree support for OMAP HS USB Host Roger Quadros
2013-02-04 15:58 ` [PATCH 01/13] usb: phy: nop: Add device tree support and binding information Roger Quadros
2013-02-05 7:26 ` Felipe Balbi
2013-02-05 8:30 ` Roger Quadros
[not found] ` <5110C339.7080109-l0cyMroinI0@public.gmane.org>
2013-02-05 9:07 ` Felipe Balbi
[not found] ` <20130205072637.GA32118-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-03-11 15:52 ` Marc Kleine-Budde
[not found] ` <513DFDD7.7000801-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-12 9:09 ` Roger Quadros
2013-03-08 10:46 ` Marc Kleine-Budde
2013-03-08 15:04 ` Roger Quadros
[not found] ` <5139C174.7030401-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-08 15:45 ` Marc Kleine-Budde
[not found] ` <513A079A.1020106-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-11 8:40 ` Roger Quadros
2013-03-11 15:53 ` Marc Kleine-Budde
[not found] ` <1359993540-20780-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-02-04 15:58 ` [PATCH 02/13] USB: phy: nop: Defer probe if device needs VCC/RESET Roger Quadros
[not found] ` <1359993540-20780-3-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-02-05 5:54 ` kishon
2013-02-05 8:44 ` Roger Quadros
2013-02-05 9:09 ` Felipe Balbi
2013-02-05 9:43 ` Roger Quadros
[not found] ` <5110D45A.3040007-l0cyMroinI0@public.gmane.org>
2013-03-11 15:58 ` Marc Kleine-Budde
2013-03-12 9:10 ` Roger Quadros
2013-02-04 15:58 ` [PATCH 03/13] mfd: omap-usb-tll: move configuration code to omap_tll_init() Roger Quadros
2013-02-04 15:58 ` [PATCH 04/13] mfd: omap-usb-tll: Add device tree support Roger Quadros
2013-02-05 6:04 ` kishon
[not found] ` <5110A0DF.7050609-l0cyMroinI0@public.gmane.org>
2013-02-05 8:46 ` Roger Quadros
2013-02-04 15:58 ` [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information Roger Quadros
[not found] ` <1359993540-20780-10-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-02-05 6:16 ` kishon
[not found] ` <5110A3C6.6040808-l0cyMroinI0@public.gmane.org>
2013-02-05 8:50 ` Roger Quadros
2013-02-05 10:58 ` Roger Quadros
[not found] ` <5110E5C4.1000501-l0cyMroinI0@public.gmane.org>
2013-02-05 12:11 ` kishon
2013-02-05 12:27 ` Roger Quadros
2013-02-05 14:20 ` Mark Rutland
2013-02-05 14:42 ` Roger Quadros
2013-02-05 16:11 ` Mark Rutland
[not found] ` <20130205161141.GD26842-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-02-06 8:56 ` Roger Quadros
2013-02-04 15:59 ` [PATCH 13/13] ARM: dts: omap3-beagle: Add USB Host support Roger Quadros
2013-02-04 15:58 ` [PATCH 05/13] USB: ehci-omap: Get platform resources by index rather than by name Roger Quadros
2013-02-04 21:12 ` Alan Stern
2013-02-04 15:58 ` [PATCH 06/13] USB: ohci-omap3: " Roger Quadros
2013-02-04 21:12 ` Alan Stern
2013-02-04 15:58 ` [PATCH 07/13] USB: ohci-omap3: Add device tree support and binding information Roger Quadros
[not found] ` <1359993540-20780-8-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-02-04 21:14 ` Alan Stern
2013-02-04 15:58 ` [PATCH 08/13] USB: ehci-omap: " Roger Quadros
2013-02-04 21:15 ` Alan Stern
2013-02-05 12:33 ` Mark Rutland
[not found] ` <20130205123346.GB26842-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-02-05 12:46 ` Roger Quadros
2013-02-04 15:58 ` [PATCH 10/13] ARM: dts: OMAP4: Add HS USB Host IP nodes Roger Quadros
[not found] ` <1359993540-20780-11-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-02-05 6:24 ` kishon
2013-02-05 8:54 ` Roger Quadros
[not found] ` <5110C8CE.2020606-l0cyMroinI0@public.gmane.org>
2013-02-05 8:57 ` kishon
2013-02-05 7:41 ` Felipe Balbi
2013-02-05 8:57 ` Roger Quadros
2013-02-04 15:58 ` [PATCH 11/13] ARM: dts: omap4-panda: Add USB Host support Roger Quadros
[not found] ` <1359993540-20780-12-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-02-05 9:34 ` how to specify an OMAP clock in device tree? Roger Quadros
[not found] ` <5110D229.1000808-l0cyMroinI0@public.gmane.org>
2013-02-05 11:15 ` Rajendra Nayak
2013-02-05 13:46 ` Roger Quadros [this message]
[not found] ` <51110D4B.50904-l0cyMroinI0@public.gmane.org>
2013-02-05 14:13 ` Rajendra Nayak
2013-02-05 14:18 ` Roger Quadros
2013-02-05 14:21 ` Rajendra Nayak
2013-02-05 14:29 ` Roger Quadros
[not found] ` <51111739.2050805-l0cyMroinI0@public.gmane.org>
2013-02-05 14:36 ` Rajendra Nayak
2013-02-05 14:52 ` Roger Quadros
2013-02-06 10:21 ` Rajendra Nayak
[not found] ` <51122EC0.3040804-l0cyMroinI0@public.gmane.org>
2013-02-06 10:39 ` Roger Quadros
2013-02-04 15:58 ` [PATCH 12/13] ARM: dts: OMAP3: Add HS USB Host IP nodes Roger Quadros
2013-02-05 11:25 ` [PATCH 00/13] Device tree support for OMAP HS USB Host Rajendra Nayak
[not found] ` <5110EC0D.40609-l0cyMroinI0@public.gmane.org>
2013-02-05 11:32 ` 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=51110D4B.50904@ti.com \
--to=rogerq@ti.com \
--cc=b-cousson@ti.com \
--cc=balbi@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
--cc=stern@rowland.harvard.edu \
--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).