diff mbox

[U-Boot,V2,07/14] ARM: AM43xx: Select clk source for Timer2

Message ID 1385014699-7257-8-git-send-email-lokeshvutla@ti.com
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Lokesh Vutla Nov. 21, 2013, 6:18 a.m. UTC
Selecting the Master osc clk as Timer2 clock source.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/cpu/armv7/am33xx/clock_am43xx.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Vaibhav Bedia Nov. 21, 2013, 8:31 p.m. UTC | #1
On Thu, Nov 21, 2013 at 1:18 AM, Lokesh Vutla <lokeshvutla@ti.com> wrote:
> Selecting the Master osc clk as Timer2 clock source.
>
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> ---
>  arch/arm/cpu/armv7/am33xx/clock_am43xx.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
> index c4890f2..22963b7 100644
> --- a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
> +++ b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
> @@ -18,6 +18,7 @@
>
>  struct cm_perpll *const cmper = (struct cm_perpll *)CM_PER;
>  struct cm_wkuppll *const cmwkup = (struct cm_wkuppll *)CM_WKUP;
> +struct cm_dpll *const cmdpll = (struct cm_dpll *)CM_DPLL;
>
>  const struct dpll_regs dpll_mpu_regs = {
>         .cm_clkmode_dpll        = CM_WKUP + 0x560,
> @@ -107,4 +108,7 @@ void enable_basic_clocks(void)
>         };
>
>         do_enable_clocks(clk_domains, clk_modules_explicit_en, 1);
> +
> +       /* Select the Master osc clk as Timer2 clock source */
> +       writel(0x1, &cmdpll->clktimer2clk);

I really don't see a point of copying whatever AM335x does. You should
have a good reason for not using the other timers :P
Lokesh Vutla Nov. 25, 2013, 4:53 a.m. UTC | #2
On Friday 22 November 2013 02:01 AM, Vaibhav Bedia wrote:
> On Thu, Nov 21, 2013 at 1:18 AM, Lokesh Vutla <lokeshvutla@ti.com> wrote:
>> Selecting the Master osc clk as Timer2 clock source.
>>
>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>> ---
>>  arch/arm/cpu/armv7/am33xx/clock_am43xx.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
>> index c4890f2..22963b7 100644
>> --- a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
>> +++ b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
>> @@ -18,6 +18,7 @@
>>
>>  struct cm_perpll *const cmper = (struct cm_perpll *)CM_PER;
>>  struct cm_wkuppll *const cmwkup = (struct cm_wkuppll *)CM_WKUP;
>> +struct cm_dpll *const cmdpll = (struct cm_dpll *)CM_DPLL;
>>
>>  const struct dpll_regs dpll_mpu_regs = {
>>         .cm_clkmode_dpll        = CM_WKUP + 0x560,
>> @@ -107,4 +108,7 @@ void enable_basic_clocks(void)
>>         };
>>
>>         do_enable_clocks(clk_domains, clk_modules_explicit_en, 1);
>> +
>> +       /* Select the Master osc clk as Timer2 clock source */
>> +       writel(0x1, &cmdpll->clktimer2clk);
> 
> I really don't see a point of copying whatever AM335x does. You should
> have a good reason for not using the other timers :P
Again nothing is copied here, I am reusing the code what ever is present.
I don't have any restrictions to choose any timer here. All OMAPs and AM uses timer 2
and I used it. I have already told you why I can't use timer1.

First please give me a *valid reason* why I should not use timer2, then Ill think of using other timer.
As per my understanding there is nothing wrong to reuse what ever is present.
Please be specific when you are commenting.

Thanks
Lokesh
>
Vaibhav Bedia Nov. 26, 2013, 11:56 p.m. UTC | #3
On Sun, Nov 24, 2013 at 11:53 PM, Lokesh Vutla <lokeshvutla@ti.com> wrote:
> On Friday 22 November 2013 02:01 AM, Vaibhav Bedia wrote:
>> On Thu, Nov 21, 2013 at 1:18 AM, Lokesh Vutla <lokeshvutla@ti.com> wrote:
>>> Selecting the Master osc clk as Timer2 clock source.
>>>
>>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>>> ---
>>>  arch/arm/cpu/armv7/am33xx/clock_am43xx.c |    4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
>>> index c4890f2..22963b7 100644
>>> --- a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
>>> +++ b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
>>> @@ -18,6 +18,7 @@
>>>
>>>  struct cm_perpll *const cmper = (struct cm_perpll *)CM_PER;
>>>  struct cm_wkuppll *const cmwkup = (struct cm_wkuppll *)CM_WKUP;
>>> +struct cm_dpll *const cmdpll = (struct cm_dpll *)CM_DPLL;
>>>
>>>  const struct dpll_regs dpll_mpu_regs = {
>>>         .cm_clkmode_dpll        = CM_WKUP + 0x560,
>>> @@ -107,4 +108,7 @@ void enable_basic_clocks(void)
>>>         };
>>>
>>>         do_enable_clocks(clk_domains, clk_modules_explicit_en, 1);
>>> +
>>> +       /* Select the Master osc clk as Timer2 clock source */
>>> +       writel(0x1, &cmdpll->clktimer2clk);
>>
>> I really don't see a point of copying whatever AM335x does. You should
>> have a good reason for not using the other timers :P
> Again nothing is copied here, I am reusing the code what ever is present.
> I don't have any restrictions to choose any timer here. All OMAPs and AM uses timer 2
> and I used it. I have already told you why I can't use timer1.
>

If by that you are referring to your reasoning that there's a base
address that's already
there and hence let's reuse it, then yes you did.

> First please give me a *valid reason* why I should not use timer2, then Ill think of using other timer.
> As per my understanding there is nothing wrong to reuse what ever is present.
> Please be specific when you are commenting.
>

And the reuse without rethink is exactly how over a period of time we
end up with choices in s/w that no one can recollect.... have it your way :)

Regards,
Vaibhav
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
index c4890f2..22963b7 100644
--- a/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_am43xx.c
@@ -18,6 +18,7 @@ 
 
 struct cm_perpll *const cmper = (struct cm_perpll *)CM_PER;
 struct cm_wkuppll *const cmwkup = (struct cm_wkuppll *)CM_WKUP;
+struct cm_dpll *const cmdpll = (struct cm_dpll *)CM_DPLL;
 
 const struct dpll_regs dpll_mpu_regs = {
 	.cm_clkmode_dpll	= CM_WKUP + 0x560,
@@ -107,4 +108,7 @@  void enable_basic_clocks(void)
 	};
 
 	do_enable_clocks(clk_domains, clk_modules_explicit_en, 1);
+
+	/* Select the Master osc clk as Timer2 clock source */
+	writel(0x1, &cmdpll->clktimer2clk);
 }