Commit ad5c555e authored by Russell King's avatar Russell King

[ARM] CPUFREQ - allow ARM to work with userspace governor.

Patch from Dominik Brodowski.

This patch is necessary to update the ARM drivers so that they can
live with the new cpufreq governor "userspace" (which I sent to Linus a
moment ago).
parent bdfd71e6
...@@ -534,6 +534,9 @@ config CPU_FREQ ...@@ -534,6 +534,9 @@ config CPU_FREQ
written) to implement the policy. If you don't understand what this written) to implement the policy. If you don't understand what this
is all about, it's safe to say 'N'. is all about, it's safe to say 'N'.
# CPUfreq on SA11x0 is special -- it _needs_ the userspace governor
config CPU_FREQ_SA1100 config CPU_FREQ_SA1100
bool bool
depends on CPU_FREQ && SA1100_LART depends on CPU_FREQ && SA1100_LART
...@@ -544,20 +547,16 @@ config CPU_FREQ_SA1110 ...@@ -544,20 +547,16 @@ config CPU_FREQ_SA1110
depends on CPU_FREQ && (SA1100_ASSABET || SA1100_CERF || SA1100_PT_SYSTEM3) depends on CPU_FREQ && (SA1100_ASSABET || SA1100_CERF || SA1100_PT_SYSTEM3)
default y default y
config CPU_FREQ_INTEGRATOR if (CPU_FREQ_SA1100 || CPU_FREQ_SA1110)
tristate "CPUfreq driver for ARM Integrator CPUs"
depends on ARCH_INTEGRATOR && CPU_FREQ
default y
help
This enables the CPUfreq driver for ARM Integrator CPUs.
For details, take a look at linux/Documentation/cpufreq. config CPU_FREQ_GOV_USERSPACE
bool
If in doubt, say Y. depends on CPU_FREQ
default y
config CPU_FREQ_24_API config CPU_FREQ_24_API
bool bool
depends on CPU_FREQ depends on CPU_FREQ_GOV_USERSPACE && SYSCTL
default y default y
config CPU_FREQ_PROC_INTF config CPU_FREQ_PROC_INTF
...@@ -572,6 +571,27 @@ config CPU_FREQ_PROC_INTF ...@@ -572,6 +571,27 @@ config CPU_FREQ_PROC_INTF
If in doubt, say N. If in doubt, say N.
endif
# CPUfreq on Integrator can use the generic cpufreq core
config CPU_FREQ_INTEGRATOR
tristate "CPUfreq driver for ARM Integrator CPUs"
depends on ARCH_INTEGRATOR && CPU_FREQ
default y
help
This enables the CPUfreq driver for ARM Integrator CPUs.
For details, take a look at linux/Documentation/cpufreq.
If in doubt, say Y.
if (CPU_FREQ_INTEGRATOR)
source "drivers/cpufreq/Kconfig"
endif
source "drivers/pci/Kconfig" source "drivers/pci/Kconfig"
config HOTPLUG config HOTPLUG
......
...@@ -204,7 +204,7 @@ static int integrator_cpufreq_init(struct cpufreq *policy) ...@@ -204,7 +204,7 @@ static int integrator_cpufreq_init(struct cpufreq *policy)
policy->cpuinfo.max_freq = 160000; policy->cpuinfo.max_freq = 160000;
policy->cpuinfo.min_freq = 12000; policy->cpuinfo.min_freq = 12000;
policy->cpuinfo.transition_latency = 1000; /* 1 ms, assumed */ policy->cpuinfo.transition_latency = 1000; /* 1 ms, assumed */
integrator_driver.cpu_cur_freq[policy->cpu] = policy->min = policy->max = vco_to_freq(vco, 1); /* current freq */ policy->cur = policy->min = policy->max = vco_to_freq(vco, 1); /* current freq */
set_cpus_allowed(current, cpus_allowed); set_cpus_allowed(current, cpus_allowed);
......
...@@ -221,7 +221,7 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy) ...@@ -221,7 +221,7 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy)
{ {
if (policy->cpu != 0) if (policy->cpu != 0)
return -EINVAL; return -EINVAL;
sa1100_driver.cpu_cur_freq[policy->cpu] = policy->min = policy->max = sa11x0_getspeed(); policy->cur = policy->min = policy->max = sa11x0_getspeed();
policy->policy = CPUFREQ_POLICY_POWERSAVE; policy->policy = CPUFREQ_POLICY_POWERSAVE;
policy->cpuinfo.min_freq = 59000; policy->cpuinfo.min_freq = 59000;
policy->cpuinfo.max_freq = 287000; policy->cpuinfo.max_freq = 287000;
...@@ -238,6 +238,7 @@ static struct cpufreq_driver sa1100_driver = { ...@@ -238,6 +238,7 @@ static struct cpufreq_driver sa1100_driver = {
static int __init sa1100_dram_init(void) static int __init sa1100_dram_init(void)
{ {
cpufreq_gov_userspace_init();
if ((processor_id & CPU_SA1100_MASK) == CPU_SA1100_ID) if ((processor_id & CPU_SA1100_MASK) == CPU_SA1100_ID)
return cpufreq_register_driver(&sa1100_driver); return cpufreq_register_driver(&sa1100_driver);
else else
......
...@@ -314,7 +314,7 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy) ...@@ -314,7 +314,7 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy)
{ {
if (policy->cpu != 0) if (policy->cpu != 0)
return -EINVAL; return -EINVAL;
sa1110_driver.cpu_cur_freq[policy->cpu] = policy->min = policy->max = sa11x0_getspeed(); policy->cur = policy->min = policy->max = sa11x0_getspeed();
policy->policy = CPUFREQ_POLICY_POWERSAVE; policy->policy = CPUFREQ_POLICY_POWERSAVE;
policy->cpuinfo.min_freq = 59000; policy->cpuinfo.min_freq = 59000;
policy->cpuinfo.max_freq = 287000; policy->cpuinfo.max_freq = 287000;
...@@ -348,6 +348,8 @@ static int __init sa1110_clk_init(void) ...@@ -348,6 +348,8 @@ static int __init sa1110_clk_init(void)
sdram->tck, sdram->trcd, sdram->trp, sdram->tck, sdram->trcd, sdram->trp,
sdram->twr, sdram->refresh, sdram->cas_latency); sdram->twr, sdram->refresh, sdram->cas_latency);
cpufreq_gov_userspace_init();
memcpy(&sdram_params, sdram, sizeof(sdram_params)); memcpy(&sdram_params, sdram, sizeof(sdram_params));
return cpufreq_register_driver(&sa1110_driver); return cpufreq_register_driver(&sa1110_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment