linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 10/11] ARM: vexpress: Add config bus components and clocks to DTs
Date: Tue, 04 Sep 2012 09:31:16 -0500	[thread overview]
Message-ID: <504610B4.6060902@gmail.com> (raw)
In-Reply-To: <1346763920.2605.81.camel@hornet>

On 09/04/2012 08:05 AM, Pawel Moll wrote:
> On Tue, 2012-09-04 at 13:58 +0100, Rob Herring wrote:
>>> -			sysctl at 020000 {
>>> +			v2m_sysctl: sysctl at 020000 {
>>>  				compatible = "arm,sp810", "arm,primecell";
>>>  				reg = <0x020000 0x1000>;
>>> +				clocks = <&v2m_refclk32khz>, <&v2m_refclk1mhz>, <&v2m_osc_clk0>;
>>> +				clock-names = "refclk", "timclk", "apb_pclk";
>>
>> See Documentation/devicetree/bindings/arm/primecell.txt
>>
>> apb_pclk should be first in the list.
> 
> Hm. Why, if you don't mind me asking? The amba_get_enable_pclk()
> explicitly asks for "apb_pclk" id:

So apb_pclk is always in the same position in the list and I had to
define something. Clock names are supposed to be optional, so we have to
be able to identify which clock is the bus clock without the name.

> struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk");
> 
> Now, let's have a look at MMCI:
> 
>                         mmci at 050000 {
>                                 compatible = "arm,pl180", "arm,primecell";
>                                 reg = <0x050000 0x1000>;
>                                 interrupts = <9 10>;
> +                               cd-gpios = <&v2m_sysreg 0 0>;
> +                               wp-gpios = <&v2m_sysreg 1 0>;
> +                               max-frequency = <12000000>;
> +                               vmmc-supply = <&v2m_fixed_3v3>;
> +                               clocks = <&v2m_clk_24mhz>, <&v2m_osc_clk0>;
> +                               clock-names = "mclk", "apb_pclk";
>                         };
> 
> and mmci_probe() does:
> 
>         host->clk = clk_get(&dev->dev, NULL);
>         if (IS_ERR(host->clk)) {
>                 ret = PTR_ERR(host->clk);
>                 host->clk = NULL;
>                 goto host_free;
>         }       
> 
> Now, if I put "apb_pclk" first, before "mclk", the driver will get the
> wrong clock.

You're getting lucky with how clk_get is implemented. The driver should
be more specific with which clock it wants if there is more than 1.
Perhaps we need a clk_get_by_index() function?

Rob

> 
> Pawe?
> 
> 

  reply	other threads:[~2012-09-04 14:31 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03 16:25 [PATCH 00/11] Versatile Express infrastructure Pawel Moll
2012-09-03 16:25 ` [PATCH 01/11] input: ambakmi: Add missing clk_[un]prepare() calls Pawel Moll
2012-09-04 13:37   ` Thomas Petazzoni
2012-09-04 13:45     ` Pawel Moll
2012-09-03 16:25 ` [PATCH 02/11] misc: Versatile Express config bus infrastructure Pawel Moll
2012-09-03 21:17   ` Arnd Bergmann
2012-09-04 11:53     ` Pawel Moll
2012-09-04 12:45       ` Arnd Bergmann
2012-09-04 16:41         ` Pawel Moll
2012-09-03 16:25 ` [PATCH 03/11] misc: Versatile Express reset driver Pawel Moll
2012-09-03 16:25 ` [PATCH 04/11] misc: Versatile Express display muxer driver Pawel Moll
2012-09-03 21:21   ` Arnd Bergmann
2012-09-04 11:53     ` Pawel Moll
2012-09-03 16:25 ` [PATCH 05/11] clk: Versatile Express clock generators ("osc") driver Pawel Moll
2012-09-10 19:14   ` Mike Turquette
2012-09-11 16:10     ` Pawel Moll
2012-09-11 18:00       ` Linus Walleij
2012-09-12 16:56         ` Pawel Moll
2012-09-11 18:33       ` Mike Turquette
2012-09-03 16:25 ` [PATCH 06/11] clk: Common clocks implementation for Versatile Express Pawel Moll
2012-09-03 21:24   ` Arnd Bergmann
2012-09-04 11:53     ` Pawel Moll
2012-09-04 12:43       ` Linus Walleij
2012-09-04 17:12         ` Ryan Harkin
2012-09-10 20:10   ` Mike Turquette
2012-09-03 16:25 ` [PATCH 07/11] regulators: Versatile Express regulator driver Pawel Moll
2012-09-03 16:25 ` [PATCH 08/11] hwmon: Versatile Express hwmon driver Pawel Moll
2012-09-03 16:25 ` [PATCH 09/11] misc: Versatile Express system registers driver Pawel Moll
2012-09-03 16:25 ` [PATCH 10/11] ARM: vexpress: Add config bus components and clocks to DTs Pawel Moll
2012-09-04 12:58   ` Rob Herring
2012-09-04 13:05     ` Pawel Moll
2012-09-04 14:31       ` Rob Herring [this message]
2012-09-04 15:37         ` Pawel Moll
2012-09-04 17:51           ` Rob Herring
2012-09-19  9:44             ` Pawel Moll
2012-09-03 16:25 ` [PATCH 11/11] ARM: vexpress: Start using new Versatile Express infrastructure Pawel Moll

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=504610B4.6060902@gmail.com \
    --to=robherring2@gmail.com \
    --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 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).