linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: Paul Walmsley <paul@pwsan.com>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] ARM: OMAP1: Fix dpll1 default rate reprogramming method
Date: Mon, 28 Nov 2011 09:45:09 -0800	[thread overview]
Message-ID: <20111128174508.GO31337@atomide.com> (raw)
In-Reply-To: <1322364751-29980-2-git-send-email-jkrzyszt@tis.icnet.pl>

* Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [111126 19:06]:
> According to comments in omap1_select_table_rate(), reprogramming dpll1
> is tricky, and should always be done from SRAM.
> 
> While being at it, move OMAP730 special case handling inside
> omap_sram_reprogram_clock().
> 
> Created on top of omap-fixes, not yet in mainline as of 3.2-rc3.
> Tested on Amstrad Delta.

Thanks for looking into these issues. For most of this we should plan on
getting them done for the next merge window because we currently rely
on Kconfig options for the supported MHz rates. This means that with
this change omap1_defconfig will stop booting on most systems as it
would try to change to 216MHz. To fix that issue we should allow the
boards to set the supported rates before applying this patch.

Regards,

Tony
 
> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
> ---
>  arch/arm/mach-omap1/clock.c      |    6 +-----
>  arch/arm/mach-omap1/clock_data.c |    7 +++++--
>  arch/arm/plat-omap/sram.c        |    3 +++
>  3 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
> index 84ef704..3899176 100644
> --- a/arch/arm/mach-omap1/clock.c
> +++ b/arch/arm/mach-omap1/clock.c
> @@ -215,12 +215,8 @@ int omap1_select_table_rate(struct clk *clk, unsigned long rate)
>  	/*
>  	 * In most cases we should not need to reprogram DPLL.
>  	 * Reprogramming the DPLL is tricky, it must be done from SRAM.
> -	 * (on 730, bit 13 must always be 1)
>  	 */
> -	if (cpu_is_omap7xx())
> -		omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val | 0x2000);
> -	else
> -		omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val);
> +	omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val);
>  
>  	/* XXX Do we need to recalculate the tree below DPLL1 at this point? */
>  	ck_dpll1_p->rate = ptr->pll_rate;
> diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
> index 1297bb5..4550415 100644
> --- a/arch/arm/mach-omap1/clock_data.c
> +++ b/arch/arm/mach-omap1/clock_data.c
> @@ -23,6 +23,7 @@
>  #include <plat/clock.h>
>  #include <plat/cpu.h>
>  #include <plat/clkdev_omap.h>
> +#include <plat/sram.h>	/* for omap_sram_reprogram_clock() */
>  #include <plat/usb.h>   /* for OTG_BASE */
>  
>  #include "clock.h"
> @@ -933,8 +934,10 @@ void __init omap1_clk_late_init(void)
>  	/* Find the highest supported frequency and enable it */
>  	if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
>  		pr_err("System frequencies not set, using default. Check your config.\n");
> -		omap_writew(0x2290, DPLL_CTL);
> -		omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL);
> +		/*
> +		 * Reprogramming the DPLL is tricky, it must be done from SRAM.
> +		 */
> +		omap_sram_reprogram_clock(0x2290, 0x1005);
>  		ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE;
>  	}
>  	propagate_rate(&ck_dpll1);
> diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
> index 8b28664..312bee8 100644
> --- a/arch/arm/plat-omap/sram.c
> +++ b/arch/arm/plat-omap/sram.c
> @@ -224,6 +224,9 @@ static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl);
>  void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl)
>  {
>  	BUG_ON(!_omap_sram_reprogram_clock);
> +	/* On 730, bit 13 must always be 1 */
> +	if (cpu_is_omap7xx())
> +		ckctl |= 0x2000;
>  	_omap_sram_reprogram_clock(dpllctl, ckctl);
>  }
>  
> -- 
> 1.7.3.4
> 

  reply	other threads:[~2011-11-28 17:45 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27  3:32 [PATCH 0/5] ARM: OMAP1: Fix dpll1 reprogramming related issues Janusz Krzysztofik
2011-11-27  3:32 ` [PATCH 1/5] ARM: OMAP1: Fix dpll1 default rate reprogramming method Janusz Krzysztofik
2011-11-28 17:45   ` Tony Lindgren [this message]
2011-11-28 22:00     ` [PATCH 2a/5] Remove unsafe clock values from omap1_defconfig Janusz Krzysztofik
2011-11-30 22:32       ` Tony Lindgren
2011-11-30 20:57     ` [PATCH 2a/5 v2] ARM: OMAP1: select clock rate by CPU type Janusz Krzysztofik
2011-11-30 22:28       ` Tony Lindgren
2011-12-01 10:10         ` Janusz Krzysztofik
2011-12-01 18:22           ` Tony Lindgren
2011-12-01 18:54             ` Janusz Krzysztofik
2011-12-01 19:06               ` Tony Lindgren
2011-12-09  1:51       ` [PATCH] ARM: OMAP1: Set the omap1623 sram size to 16K Tony Lindgren
     [not found]     ` <201112010310.43890.jkrzyszt@tis.icnet.pl>
     [not found]       ` <20111201022750.GY13928@atomide.com>
2011-12-01  9:54         ` [PATCH 2a/5] Remove unsafe clock values from omap1_defconfig Janusz Krzysztofik
2011-12-01 10:21           ` Janusz Krzysztofik
2011-12-01 17:17           ` Tony Lindgren
2011-12-01 18:38             ` Janusz Krzysztofik
2011-12-01 19:04               ` Tony Lindgren
2011-12-01 19:23                 ` Janusz Krzysztofik
2011-12-01 19:46                   ` Tony Lindgren
2011-12-01 20:30                     ` [PATCH] ARM: OMAP1: " Janusz Krzysztofik
2011-12-01 20:13                   ` [PATCH 0/2 v2] ARM: OMAP1: Fix dpll1 reprogramming related issues Janusz Krzysztofik
2011-12-01 21:16                     ` [PATCH v2] ARM: OMAP1: Update dpll1 default rate reprogramming method Janusz Krzysztofik
2011-12-02  2:09                     ` [PATCH 0/2 v2] ARM: OMAP1: Fix dpll1 reprogramming related issues Tony Lindgren
2011-12-02 17:02                       ` Janusz Krzysztofik
2011-12-01 20:13                   ` [PATCH 1/2 v2] ARM: OMAP1: Fix ckctl value used for dpll1 defualt rate Janusz Krzysztofik
2011-12-01 20:13                   ` [PATCH 2/2 v2] ARM: OMAP1: recalculate loops per jiffy after dpll1 reprogram Janusz Krzysztofik
2011-11-27  3:32 ` [PATCH 2/5] ARM: OMAP1: Fix ckctl value used for dpll1 defualt rate Janusz Krzysztofik
2011-11-27  3:32 ` [PATCH 3/5] ARM: OMAP1: Fix dpll1 reprogramming not actually allowed Janusz Krzysztofik
2011-11-28 17:46   ` Tony Lindgren
2011-11-27  3:32 ` [PATCH 4/5] init/calibrate.c: allow for recalibration of loops per jiffy Janusz Krzysztofik
2011-11-28 15:39   ` Russell King - ARM Linux
2011-11-28 22:30     ` Janusz Krzysztofik
2011-11-27  3:32 ` [PATCH 5/5] ARM: OMAP1: recalibrate loops per jiffy after dpll1 reprogram Janusz Krzysztofik
2011-11-29  0:25   ` [PATCH 5/5 v2] ARM: OMAP1: recalculate " Janusz Krzysztofik
2011-12-09  8:42     ` Russell King - ARM Linux
2011-12-09 10:00       ` Janusz Krzysztofik
2011-12-09 10:09         ` Janusz Krzysztofik
2011-12-10  0:25         ` Russell King - ARM Linux
2011-12-10 12:04           ` Janusz Krzysztofik

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=20111128174508.GO31337@atomide.com \
    --to=tony@atomide.com \
    --cc=jkrzyszt@tis.icnet.pl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.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;
as well as URLs for NNTP newsgroup(s).