Re: [PATCH 08/13] OMAP3: cpufreq driver changes for DVFS support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Vishwanath,

On Fri, Jan 21, 2011 at 16:01, Vishwanath BS <vishwanath.bs@xxxxxx> wrote:
> Changes in the omap cpufreq driver for DVFS support.
>
> Signed-off-by: Vishwanath BS <vishwanath.bs@xxxxxx>
> Cc: Santosh Shilimkar <santosh.shilimkar@xxxxxx>
> ---
> Âarch/arm/plat-omap/cpu-omap.c | Â 35 ++++++++++++++++++++++++++++++++---
> Â1 files changed, 32 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
> index 1c1b80b..d965220 100644
> --- a/arch/arm/plat-omap/cpu-omap.c
> +++ b/arch/arm/plat-omap/cpu-omap.c
> @@ -30,10 +30,12 @@
> Â#include <mach/hardware.h>
> Â#include <plat/clock.h>
> Â#include <asm/system.h>
> +#include <asm/cpu.h>
>
> Â#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
> Â#include <plat/omap-pm.h>
> Â#include <plat/common.h>
> +#include <plat/dvfs.h>
> Â#endif
>
> Â#define VERY_HI_RATE Â 900000000
> @@ -85,11 +87,11 @@ static int omap_target(struct cpufreq_policy *policy,
> Â Â Â Â Â Â Â Â Â Â Â unsigned int target_freq,
> Â Â Â Â Â Â Â Â Â Â Â unsigned int relation)
> Â{
> -#ifdef CONFIG_ARCH_OMAP1
> Â Â Â Âstruct cpufreq_freqs freqs;
> -#endif
> Â#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
> Â Â Â Âunsigned long freq;
> + Â Â Â int i;
> + Â Â Â struct cpufreq_freqs freqs_notify;
> Â Â Â Âstruct device *mpu_dev = omap2_get_mpuss_device();
> Â#endif
> Â Â Â Âint ret = 0;
> @@ -116,9 +118,36 @@ static int omap_target(struct cpufreq_policy *policy,
> Â Â Â Âret = clk_set_rate(mpu_clk, freqs.new * 1000);
> Â Â Â Âcpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
> Â#elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
> + Â Â Â freqs.old = omap_getspeed(policy->cpu);;
> + Â Â Â freqs_notify.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
> + Â Â Â freqs.cpu = policy->cpu;
> +
> + Â Â Â if (freqs.old == freqs.new)
> + Â Â Â Â Â Â Â return ret;
> +
> + Â Â Â /* pre notifiers */
> + Â Â Â for_each_cpu(i, policy->cpus) {
> + Â Â Â Â Â Â Â freqs.cpu = i;
> + Â Â Â Â Â Â Â cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
> + Â Â Â }
> +
> + Â Â Â /* scale the frequency */
> Â Â Â Âfreq = target_freq * 1000;
> Â Â Â Âif (opp_find_freq_ceil(mpu_dev, &freq))
> - Â Â Â Â Â Â Â omap_pm_cpu_set_freq(freq);
> + Â Â Â Â Â Â Â omap_device_scale(mpu_dev, mpu_dev, freq);
> +
> + Â Â Â /* Update loops per jiffy */
> + Â Â Â freqs.new = omap_getspeed(policy->cpu);
> + Â Â Â for_each_cpu(i, policy->cpus)
> + Â Â Â Â Â Â Â per_cpu(cpu_data, i).loops_per_jiffy =
> + Â Â Â Â Â Â Â cpufreq_scale(per_cpu(cpu_data, i).loops_per_jiffy,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â freqs.old, freqs.new);
> +
> + Â Â Â /* post notifiers */
> + Â Â Â for_each_cpu(i, policy->cpus) {
> + Â Â Â Â Â Â Â freqs.cpu = i;
> + Â Â Â Â Â Â Â cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
> + Â Â Â }
> Â#endif
> Â Â Â Âreturn ret;
> Â}
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at Âhttp://vger.kernel.org/majordomo-info.html
>

I took those patches and applied to my .38-rc4 with help from Nishanth Menon.

There is problem appeared during compilation:

arch/arm/plat-omap/cpu-omap.c:142: error: 'struct cpuinfo_arm' has no
member named 'loops_per_jiffy'

My kernel is for Zoom3 board (OMAP3630-GP rev 2, CPU-OPP2 L3-200MHz)
Looking at the source, arch/arm/include/asm/cpu.h
loops_per_jiffy is under CONFIG_SMP and since the omap2plus_defconfig
builds for OMAP4 as well by default, I am guessing this bug was not
immediately visible...

Is there solution for the issue?

Regards,
Gery
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux