public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Romit Dasgupta <romit@ti.com>
To: "Reddy, Teerth" <teerth@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] OMAP3: PM:  Dynamic calculation of SDRC clock stabilization delay
Date: Thu, 24 Dec 2009 16:01:08 +0530	[thread overview]
Message-ID: <4B3342EC.2070501@ti.com> (raw)
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB031DF2E2C2@dbde02.ent.ti.com>

Teerth, one more correction/improvement below:
> diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
> index d8d5094..ddbdaaf 100644
> --- a/arch/arm/plat-omap/sram.c
> +++ b/arch/arm/plat-omap/sram.c
> +#ifdef CONFIG_ARCH_OMAP3
> +unsigned long (*_omap3_sram_delay)(unsigned long);
> +unsigned int  measure_sram_delay(unsigned int loop)
> +{
> +	static struct omap_dm_timer *gpt;
> +	unsigned long flags, diff = 0, gt_rate, mpurate;
> +	unsigned int delay_sram, error_gain;
> +
> +	omap_dm_timer_init();
> +	gpt = omap_dm_timer_request_specific(10);
> +	if (!gpt)
> +		pr_err("Could not get the gptimer\n");
> +	omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK);
> +
> +	gt_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt));
> +	omap_dm_timer_set_load_start(gpt, 0, 0);
> +
> +	local_irq_save(flags);
> +	diff = _omap3_sram_delay(loop);
> +	local_irq_restore(flags);
> +
> +	omap_dm_timer_stop(gpt);
> +	omap_dm_timer_free(gpt);
> +
> +	mpurate = clk_get_rate(clk_get(NULL, "arm_fck"));
> +
> +	/* calculate the sram delay */
> +	delay_sram = (((mpurate / gt_rate) * diff) / 20000);
Instead of 20000 it should be (loop * 2).
> +
> +	error_gain = mpurate / gt_rate;
> +	delay_sram = delay_sram + error_gain;
> +
> +	return delay_sram;
> +}
> +#endif
> 

  reply	other threads:[~2009-12-24 10:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-24  5:33 [PATCH] OMAP3: PM: Dynamic calculation of SDRC clock stabilization delay Reddy, Teerth
2009-12-24 10:31 ` Romit Dasgupta [this message]
2009-12-28 19:57 ` Tony Lindgren
2010-01-06 23:06 ` Kevin Hilman
2010-01-21  5:35   ` Paul Walmsley
2010-01-21  8:58     ` Reddy, Teerth
2010-02-08 22:52       ` Paul Walmsley
  -- strict thread matches above, loose matches on Subject: below --
2009-12-23 13:56 Reddy, Teerth
2009-12-23 14:32 ` Romit Dasgupta
2009-12-24  5:31   ` Reddy, Teerth
2009-12-11 12:42 Romit Dasgupta
2009-12-11 12:05 Reddy, Teerth
2009-12-11 12:23 ` Menon, Nishanth
2009-12-11 12:31   ` Romit Dasgupta
2009-12-11 13:42     ` Nishanth Menon
2009-12-12  4:43       ` Nishanth Menon
2009-12-14  8:19         ` Romit Dasgupta
2009-12-11 13:14 ` Jean Pihet
2009-12-11 14:07   ` Romit Dasgupta
2009-12-11 16:38 ` Kevin Hilman
2009-12-12  0:49   ` Kevin Hilman
2009-12-14  9:01     ` Romit Dasgupta
2009-12-14 16:10       ` Kevin Hilman
2009-12-14 16:41         ` Dasgupta, Romit
2009-12-14 19:34           ` Kevin Hilman
2009-12-21 11:44             ` Reddy, Teerth
2009-12-22 15:56               ` Kevin Hilman
2009-12-22 16:00                 ` Sripathy, Vishwanath
2009-12-22 16:56                   ` Kevin Hilman
2009-12-11 10:35 Reddy, Teerth

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=4B3342EC.2070501@ti.com \
    --to=romit@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=teerth@ti.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