From: Tero Kristo <t-kristo@ti.com>
To: Lokesh Vutla <lokeshvutla@ti.com>, linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, tony@atomide.com,
rnayak@ti.com, nsekhar@ti.com
Subject: Re: [PATCH] ARM: AM43xx: clk: Change the wdt1 func clk src to per_32k clk
Date: Mon, 19 May 2014 15:31:52 +0300 [thread overview]
Message-ID: <5379F9B8.6070402@ti.com> (raw)
In-Reply-To: <53563F2D.20906@ti.com>
On 04/22/2014 01:06 PM, Tero Kristo wrote:
> On 04/16/2014 07:14 AM, Lokesh Vutla wrote:
>> WDT1 module can take one of the below clocks as input functional
>> clock -
>> - On-Chip 32K RC Osc [default/reset]
>> - 32K from PRCM
>>
>> The On-Chip 32K RC Osc clock is not an accurate clock-source as per
>> the design/spec, so as a result, for example, timer which supposed
>> to get expired @60Sec, but will expire somewhere ~@40Sec, which is
>> not expected by any use-case.
>>
>> The solution here is to switch the input clock-source to PRCM
>> generated 32K clock-source during boot-time itself.
>> This is derived from AM33xx clock file.
>
> I guess this patch should wait until we have a proper solution upstream
> for selecting parents based on DT data, unless you have pressing need to
> merge this as a temporary hack.
I've decided to take this patch in its current form as the DT parenting
is still WIP.
Queued for 3.16/ti-clk-drv.
-Tero
>
>>
>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>> ---
>> drivers/clk/ti/clk-43xx.c | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/clk/ti/clk-43xx.c b/drivers/clk/ti/clk-43xx.c
>> index 67c8de5..ae2524e 100644
>> --- a/drivers/clk/ti/clk-43xx.c
>> +++ b/drivers/clk/ti/clk-43xx.c
>> @@ -110,9 +110,22 @@ static struct ti_dt_clk am43xx_clks[] = {
>>
>> int __init am43xx_dt_clk_init(void)
>> {
>> + struct clk *clk1, *clk2;
>> +
>> ti_dt_clocks_register(am43xx_clks);
>>
>> omap2_clk_disable_autoidle_all();
>>
>> + /*
>> + * The On-Chip 32K RC Osc clock is not an accurate clock-source
>> as per
>> + * the design/spec, so as a result, for example, timer which
>> supposed
>> + * to get expired @60Sec, but will expire somewhere ~@40Sec,
>> which is
>> + * not expected by any use-case, so change WDT1 clock source to PRCM
>> + * 32KHz clock.
>> + */
>> + clk1 = clk_get_sys(NULL, "wdt1_fck");
>> + clk2 = clk_get_sys(NULL, "clkdiv32k_ick");
>> + clk_set_parent(clk1, clk2);
>> +
>> return 0;
>> }
>>
>
WARNING: multiple messages have this Message-ID (diff)
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: AM43xx: clk: Change the wdt1 func clk src to per_32k clk
Date: Mon, 19 May 2014 15:31:52 +0300 [thread overview]
Message-ID: <5379F9B8.6070402@ti.com> (raw)
In-Reply-To: <53563F2D.20906@ti.com>
On 04/22/2014 01:06 PM, Tero Kristo wrote:
> On 04/16/2014 07:14 AM, Lokesh Vutla wrote:
>> WDT1 module can take one of the below clocks as input functional
>> clock -
>> - On-Chip 32K RC Osc [default/reset]
>> - 32K from PRCM
>>
>> The On-Chip 32K RC Osc clock is not an accurate clock-source as per
>> the design/spec, so as a result, for example, timer which supposed
>> to get expired @60Sec, but will expire somewhere ~@40Sec, which is
>> not expected by any use-case.
>>
>> The solution here is to switch the input clock-source to PRCM
>> generated 32K clock-source during boot-time itself.
>> This is derived from AM33xx clock file.
>
> I guess this patch should wait until we have a proper solution upstream
> for selecting parents based on DT data, unless you have pressing need to
> merge this as a temporary hack.
I've decided to take this patch in its current form as the DT parenting
is still WIP.
Queued for 3.16/ti-clk-drv.
-Tero
>
>>
>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>> ---
>> drivers/clk/ti/clk-43xx.c | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/clk/ti/clk-43xx.c b/drivers/clk/ti/clk-43xx.c
>> index 67c8de5..ae2524e 100644
>> --- a/drivers/clk/ti/clk-43xx.c
>> +++ b/drivers/clk/ti/clk-43xx.c
>> @@ -110,9 +110,22 @@ static struct ti_dt_clk am43xx_clks[] = {
>>
>> int __init am43xx_dt_clk_init(void)
>> {
>> + struct clk *clk1, *clk2;
>> +
>> ti_dt_clocks_register(am43xx_clks);
>>
>> omap2_clk_disable_autoidle_all();
>>
>> + /*
>> + * The On-Chip 32K RC Osc clock is not an accurate clock-source
>> as per
>> + * the design/spec, so as a result, for example, timer which
>> supposed
>> + * to get expired @60Sec, but will expire somewhere ~@40Sec,
>> which is
>> + * not expected by any use-case, so change WDT1 clock source to PRCM
>> + * 32KHz clock.
>> + */
>> + clk1 = clk_get_sys(NULL, "wdt1_fck");
>> + clk2 = clk_get_sys(NULL, "clkdiv32k_ick");
>> + clk_set_parent(clk1, clk2);
>> +
>> return 0;
>> }
>>
>
next prev parent reply other threads:[~2014-05-19 12:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 4:14 [PATCH] ARM: AM43xx: clk: Change the wdt1 func clk src to per_32k clk Lokesh Vutla
2014-04-16 4:14 ` Lokesh Vutla
2014-04-22 10:06 ` Tero Kristo
2014-04-22 10:06 ` Tero Kristo
2014-05-19 12:31 ` Tero Kristo [this message]
2014-05-19 12:31 ` Tero Kristo
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=5379F9B8.6070402@ti.com \
--to=t-kristo@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=lokeshvutla@ti.com \
--cc=nsekhar@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.