public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: Michael Welling <mwelling@ieee.org>,
	Mike Turquette <mturquette@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Russell King <linux@arm.linux.org.uk>,
	devicetree <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Tony Lindgren <tony@atomide.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Daniel Mack <daniel@zonque.org>
Subject: Re: AM335x OMAP2 common clock external fixed-clock registration
Date: Thu, 16 Apr 2015 07:32:32 +0300	[thread overview]
Message-ID: <552F3B60.8050703@ti.com> (raw)
In-Reply-To: <20150415205136.GA3399@deathray>

On 04/15/2015 11:51 PM, Michael Welling wrote:
> On Wed, Apr 15, 2015 at 01:45:53PM -0700, Mike Turquette wrote:
>> On Wed, Apr 15, 2015 at 12:47 PM, Michael Welling <mwelling@ieee.org> wrote:
>>> On Wed, Apr 15, 2015 at 09:43:30PM +0300, Tero Kristo wrote:
>>>> On 04/15/2015 05:09 PM, Michael Welling wrote:
>>>>> On Wed, Apr 15, 2015 at 09:34:48AM +0300, Tero Kristo wrote:
>>>>>> On 04/15/2015 12:17 AM, Michael Welling wrote:
>>>>>>> Greetings,
>>>>>>>
>>>>>>> I have developed an AM3354 based SoM and it uses an external SI5351 clock
>>>>>>> generator to drive the clock inputs for an external duart and I2S audio
>>>>>>> master clock. With the registration according to the documentation the
>>>>>>> reference clock is not being detected and hence the clock generator is
>>>>>>> not working as expect.
>>>>>>>
>>>>>>> After trying many different things, I started to look around the mailing
>>>>>>> lists to find information related to this issue.
>>>>>>>
>>>>>>> I came acrossed post that has the exact same issue:
>>>>>>> https://lkml.org/lkml/2013/2/18/468
>>>>>>>
>>>>>>> Seeing as the patch did not land upstream, I am wondering if there is
>>>>>>> a solution that I am not seeing.
>>>>>>>
>>>>>>> I am willing to provide a patch given appropriate guidance.
>>>>>>
>>>>>> Hi Michael,
>>>>>>
>>>>>> The info on the email you referenced is kind of obsolete, TI SoCs
>>>>>> are calling of_clk_init() during boot now, and thus external clock
>>>>>> nodes should be registered fine also. Maybe you can provide the
>>>>>> actual DTS patch you are trying out so we can help better...? Are
>>>>>
>>>>> See attached patch and console output.
>>>>
>>>> I see a bug in your dt data.
>>>>
>>>> <snip>
>>>>
>>>> +     clocks {
>>>> +             ref27: ref27 {
>>>> +                     #clock-cells = <0>;
>>>> +                     compatibale = "fixed-clock";
>>>>
>>>> This should be compatible, right? DT is annoying in that it doesn't
>>>> verify property names.
>>>>
>>>
>>> Ooops.
>>>
>>> Now the clock appears in /sys/kernel/debug/clk:
>>> root@som3517-som200:/sys/kernel/debug/clk# cat clk_summary
>>>     clock                         enable_cnt  prepare_cnt        rate   accuracy   phase
>>> ----------------------------------------------------------------------------------------
>>>   ref27                                    0            0    27000000          0 0
>>> ...
>>>
>>> There is still an issue with the si5351.
>>>
>>> I had to comment out the clk_put here for the frequency to show up:
>>> http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1133
>>>
>>> Ideas?
>>
>> What is the most recent upstream commit that you are based on?
>
> I am working from 4.0.0-rc7.
>
> 7b43b47373d40d557cd7e1a84a0bd8ebc4d745ab

Hmm, I wonder why si5351 calls clk_put immediately after of_clk_get in 
the first place, as far as I understand this destroys the clock handle, 
which is still being used later in the code.

-Tero

>
>>
>> Regards,
>> Mike
>>
>>>
>>>> +                     clock-frequency = <27000000>;
>>>> +             };
>>>> +     };
>>>>
>>>> -Tero
>>>>
>>>>>
>>>>>> you seeing any boot time error / warning prints for your new clock?
>>>>>
>>>>> With the debug messages on you see that the reference clock is not being
>>>>> detected.
>>>>>
>>>>> Whilest debugging I found that the of_clk_get is returning an error no matter
>>>>> which clock I pass it:
>>>>> http://lxr.free-electrons.com/source/drivers/clk/clk-si5351.c#L1131
>>>>>
>>>>>>
>>>>>> -Tero
>>>>


  reply	other threads:[~2015-04-16  4:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14 21:17 AM335x OMAP2 common clock external fixed-clock registration Michael Welling
2015-04-15  6:34 ` Tero Kristo
2015-04-15 14:09   ` Michael Welling
2015-04-15 18:43     ` Tero Kristo
2015-04-15 19:47       ` Michael Welling
2015-04-15 20:45         ` Mike Turquette
2015-04-15 20:51           ` Michael Welling
2015-04-16  4:32             ` Tero Kristo [this message]
2015-04-16 16:17               ` Michael Welling
2015-04-16 20:37                 ` Sebastian Hesselbarth
2015-04-16 22:09                   ` Michael Welling
2015-04-16 23:23                     ` Sebastian Hesselbarth
2015-04-17  2:00                       ` Michael Welling
2015-04-17  7:13                         ` Tero Kristo
2015-04-17  9:12                         ` Sebastian Hesselbarth
2015-04-17 10:18                           ` Russell King - ARM Linux
2015-04-17 19:06                             ` Michael Welling
2015-04-17 19:39                               ` Russell King - ARM Linux
2015-04-17 19:56                             ` Michael Turquette
2015-04-17 16:59                           ` Michael Welling

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=552F3B60.8050703@ti.com \
    --to=t-kristo@ti.com \
    --cc=daniel@zonque.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@linaro.org \
    --cc=mwelling@ieee.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --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