public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP: Use dynamic detection for setting default sys_ck
@ 2007-10-23  0:17 Kevin Hilman
  2007-10-23  0:35 ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2007-10-23  0:17 UTC (permalink / raw)
  To: linux-omap-open-source

A cleaner way than my previous static fix...  Rather than setting a
static sys_ck.rate, detect the correct value at boot time.

Signed-off-by: Kevin Hilman <khilman@mvista.com>

---
 arch/arm/mach-omap2/clock24xx.c |    1 +
 arch/arm/mach-omap2/clock24xx.h |    1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

Index: dev/arch/arm/mach-omap2/clock24xx.c
===================================================================
--- dev.orig/arch/arm/mach-omap2/clock24xx.c
+++ dev/arch/arm/mach-omap2/clock24xx.c
@@ -475,6 +475,7 @@ int __init omap2_clk_init(void)
 	clk_init(&omap2_clk_functions);
 
 	omap2_osc_clk_recalc(&osc_ck);
+	omap2_sys_clk_recalc(&sys_ck);
 
 	for (clkp = onchip_24xx_clks;
 	     clkp < onchip_24xx_clks + ARRAY_SIZE(onchip_24xx_clks);
Index: dev/arch/arm/mach-omap2/clock24xx.h
===================================================================
--- dev.orig/arch/arm/mach-omap2/clock24xx.h
+++ dev/arch/arm/mach-omap2/clock24xx.h
@@ -581,7 +581,6 @@ static struct clk osc_ck = {		/* (*12, *
 /* With out modem likely 12MHz, with modem likely 13MHz */
 static struct clk sys_ck = {		/* (*12, *13, 19.2, 26, 38.4)MHz */
 	.name		= "sys_ck",		/* ~ ref_clk also */
-	.rate           = 13000000,
 	.parent		= &osc_ck,
 	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
 				ALWAYS_ENABLED | RATE_PROPAGATES,
--

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: OMAP: Use dynamic detection for setting default sys_ck
  2007-10-23  0:17 [PATCH] ARM: OMAP: Use dynamic detection for setting default sys_ck Kevin Hilman
@ 2007-10-23  0:35 ` Tony Lindgren
  2007-10-23  0:38   ` Kevin Hilman
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2007-10-23  0:35 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap-open-source

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

* Kevin Hilman <khilman@mvista.com> [071022 17:18]:
> A cleaner way than my previous static fix...  Rather than setting a
> static sys_ck.rate, detect the correct value at boot time.
> 
> Signed-off-by: Kevin Hilman <khilman@mvista.com>
> 
> ---
>  arch/arm/mach-omap2/clock24xx.c |    1 +
>  arch/arm/mach-omap2/clock24xx.h |    1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> Index: dev/arch/arm/mach-omap2/clock24xx.c
> ===================================================================
> --- dev.orig/arch/arm/mach-omap2/clock24xx.c
> +++ dev/arch/arm/mach-omap2/clock24xx.c
> @@ -475,6 +475,7 @@ int __init omap2_clk_init(void)
>  	clk_init(&omap2_clk_functions);
>  
>  	omap2_osc_clk_recalc(&osc_ck);
> +	omap2_sys_clk_recalc(&sys_ck);
>  
>  	for (clkp = onchip_24xx_clks;
>  	     clkp < onchip_24xx_clks + ARRAY_SIZE(onchip_24xx_clks);
> Index: dev/arch/arm/mach-omap2/clock24xx.h
> ===================================================================
> --- dev.orig/arch/arm/mach-omap2/clock24xx.h
> +++ dev/arch/arm/mach-omap2/clock24xx.h
> @@ -581,7 +581,6 @@ static struct clk osc_ck = {		/* (*12, *
>  /* With out modem likely 12MHz, with modem likely 13MHz */
>  static struct clk sys_ck = {		/* (*12, *13, 19.2, 26, 38.4)MHz */
>  	.name		= "sys_ck",		/* ~ ref_clk also */
> -	.rate           = 13000000,
>  	.parent		= &osc_ck,
>  	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
>  				ALWAYS_ENABLED | RATE_PROPAGATES,
> --

I'll undo your earlier patch and apply first part of this if you don't
mind. Also merged comments from your first patch, hope that's OK with
you, see attached.

Regards,

Tony

[-- Attachment #2: kevin.patch --]
[-- Type: text/x-diff, Size: 1023 bytes --]

>From 3e02c8300f5a7900e91bb6da219faa6cf27b64f7 Mon Sep 17 00:00:00 2001
From: Kevin Hilman <khilman@mvista.com>
Date: Fri, 19 Oct 2007 14:14:15 -0700
Subject: [PATCH] ARM: OMAP: fix default sys_ck.rate for boot-time DPLL detection

In the clock init code, the DPLL value set by the bootloader is
queried, but always turns zero due it's parent clock (sys_ck) having
no default rate.  This results in the improper setting of the default
PRCM rate-table entry and any queries of virt_prcm_set rate to return 0.

Rather than setting a static sys_ck.rate, detect the correct value at
boot time.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

--- dev.orig/arch/arm/mach-omap2/clock24xx.c
+++ dev/arch/arm/mach-omap2/clock24xx.c
@@ -475,6 +475,7 @@ int __init omap2_clk_init(void)
 	clk_init(&omap2_clk_functions);

 	omap2_osc_clk_recalc(&osc_ck);
+	omap2_sys_clk_recalc(&sys_ck);

 	for (clkp = onchip_24xx_clks;
 	     clkp < onchip_24xx_clks + ARRAY_SIZE(onchip_24xx_clks);

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: OMAP: Use dynamic detection for setting default sys_ck
  2007-10-23  0:35 ` Tony Lindgren
@ 2007-10-23  0:38   ` Kevin Hilman
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Hilman @ 2007-10-23  0:38 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap-open-source

Tony Lindgren wrote:

> 
> I'll undo your earlier patch and apply first part of this if you don't
> mind. Also merged comments from your first patch, hope that's OK with
> you, see attached.
> 

Looks good to me,  Thanks.

Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-23  0:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-23  0:17 [PATCH] ARM: OMAP: Use dynamic detection for setting default sys_ck Kevin Hilman
2007-10-23  0:35 ` Tony Lindgren
2007-10-23  0:38   ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox