public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Kevin Hilman <khilman@mvista.com>
Cc: linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH/RFC] ARM: OMAP: implement CPUfreq frequency table based on PRCM table
Date: Thu, 1 Nov 2007 05:33:09 -0700	[thread overview]
Message-ID: <20071101123308.GF20403@atomide.com> (raw)
In-Reply-To: <20071019172031.226299706@mvista.com>

Hi,

* Kevin Hilman <khilman@mvista.com> [071019 10:22]:
> This patch adds a CPUfreq frequency-table implementation for OMAP2 by
> walking the PRCM rate-table for available entries and adding them to a
> CPUfreq table.
> 
> CPUfreq can then be used to manage switching between all the available
> entries in the PRCM rate table.  Either use the CPUfreq sysfs
> interface directly, (see Section 3 of Documentation/cpu-freq/user-guide.txt)
> or use the cpufrequtils package:
> http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html
> 
> Signed-off-by: Kevin Hilman <khilman@mvista.com>
> 
> ---
>  arch/arm/mach-omap2/clock24xx.c |   39 ++++++++++++++++++++++++++++++
>  arch/arm/plat-omap/cpu-omap.c   |   52 ++++++++++++++++++++++++++++++++++++++--
>  2 files changed, 89 insertions(+), 2 deletions(-)
> 
> Index: dev/arch/arm/mach-omap2/clock24xx.c
> ===================================================================
> --- dev.orig/arch/arm/mach-omap2/clock24xx.c
> +++ dev/arch/arm/mach-omap2/clock24xx.c
> @@ -26,6 +26,7 @@
>  #include <linux/clk.h>
>  
>  #include <linux/io.h>
> +#include <linux/cpufreq.h>
>  
>  #include <asm/arch/clock.h>
>  #include <asm/arch/sram.h>
> @@ -461,6 +462,42 @@ static int __init omap2_clk_arch_init(vo
>  }
>  arch_initcall(omap2_clk_arch_init);
>  
> +#ifdef CONFIG_CPU_FREQ
> +/*
> + * Walk PRCM rate table and fillout cpufreq freq_table
> + */
> +static struct cpufreq_frequency_table freq_table[16];
> +struct cpufreq_frequency_table *omap2_cpufreq_table;
> +
> +static void omap2_cpufreq_init_table(void)
> +{
> +	struct prcm_config *prcm;
> +	int i = 0;
> +
> +	for (prcm = rate_table; prcm->mpu_speed; prcm++) {
> +		if (!(prcm->flags & cpu_mask))
> +			continue;
> +		if (prcm->xtal_speed != sys_ck.rate)
> +			continue;
> +
> +		/* don't put bypass rates in table */
> +		if (prcm->dpll_speed == prcm->xtal_speed)
> +			continue;
> +
> +		freq_table[i].index = i;
> +		freq_table[i].frequency = prcm->mpu_speed / 1000;
> +		i++;
> +	}
> +
> +	freq_table[i].index = i;
> +	freq_table[i].frequency = CPUFREQ_TABLE_END;
> +
> +	omap2_cpufreq_table = &freq_table[0];
> +}
> +#else
> +static void omap2_cpufreq_init_table(void) {}
> +#endif
> +
>  int __init omap2_clk_init(void)
>  {
>  	struct prcm_config *prcm;

How about rather call omap2_cpufreq_init_table(freq_table) from cpu-omap.c
init and pass it the freq table from cpu-omap.c?

Also, eventually we should allow board-*.c files specify the rate table too.

Regards,

Tony

      reply	other threads:[~2007-11-01 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19 17:20 [PATCH/RFC] ARM: OMAP: implement CPUfreq frequency table based on PRCM table Kevin Hilman
2007-11-01 12:33 ` Tony Lindgren [this message]

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=20071101123308.GF20403@atomide.com \
    --to=tony@atomide.com \
    --cc=khilman@mvista.com \
    --cc=linux-omap-open-source@linux.omap.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