All of lore.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: Wed, 23 Dec 2009 20:02:13 +0530	[thread overview]
Message-ID: <4B3229ED.10005@ti.com> (raw)
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB031DF2E202@dbde02.ent.ti.com>

> +#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/1000000) / (gt_rate/1000000)) * diff) / 20000);
Can remove the 1000000 from the denominators as they cancel out.
> +
> +	error_gain = ((mpurate/1000000) / (gt_rate/1000000));
Same as before.
> +	delay_sram = delay_sram + error_gain;
> +
> +	return delay_sram;
> +}


  reply	other threads:[~2009-12-23 14:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 13:56 [PATCH] OMAP3: PM: Dynamic calculation of SDRC clock stabilization delay Reddy, Teerth
2009-12-23 14:32 ` Romit Dasgupta [this message]
2009-12-24  5:31   ` Reddy, Teerth
  -- strict thread matches above, loose matches on Subject: below --
2009-12-24  5:33 Reddy, Teerth
2009-12-24 10:31 ` Romit Dasgupta
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
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=4B3229ED.10005@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 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.