Commit 906b4b7e authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-dj.bkbits.net/cpufreq

into ppc970.osdl.org:/home/torvalds/v2.5/linux
parents 9f103d98 29a21004
...@@ -336,14 +336,12 @@ config CPU_FREQ_SA1100 ...@@ -336,14 +336,12 @@ config CPU_FREQ_SA1100
bool bool
depends on CPU_FREQ && SA1100_LART depends on CPU_FREQ && SA1100_LART
default y default y
select CPU_FREQ_DEFAULT_GOV_USERSPACE
select CPU_FREQ_24_API if SYSCTL select CPU_FREQ_24_API if SYSCTL
config CPU_FREQ_SA1110 config CPU_FREQ_SA1110
bool bool
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
select CPU_FREQ_DEFAULT_GOV_USERSPACE
select CPU_FREQ_24_API if SYSCTL select CPU_FREQ_24_API if SYSCTL
config CPU_FREQ_INTEGRATOR config CPU_FREQ_INTEGRATOR
......
...@@ -199,6 +199,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy) ...@@ -199,6 +199,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
{ {
struct cpuinfo_x86 *c = cpu_data; struct cpuinfo_x86 *c = cpu_data;
unsigned int i; unsigned int i;
int result;
/* capability check */ /* capability check */
if ((c->x86_vendor != X86_VENDOR_AMD) || if ((c->x86_vendor != X86_VENDOR_AMD) ||
...@@ -220,7 +221,20 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy) ...@@ -220,7 +221,20 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
policy->cur = elanfreq_get_cpu_frequency(); policy->cur = elanfreq_get_cpu_frequency();
return cpufreq_frequency_table_cpuinfo(policy, &elanfreq_table[0]);; result = cpufreq_frequency_table_cpuinfo(policy, elanfreq_table);
if (result)
return (result);
cpufreq_frequency_table_get_attr(elanfreq_table, policy->cpu);
return 0;
}
static int elanfreq_cpu_exit(struct cpufreq_policy *policy)
{
cpufreq_frequency_table_put_attr(policy->cpu);
return 0;
} }
...@@ -245,12 +259,20 @@ __setup("elanfreq=", elanfreq_setup); ...@@ -245,12 +259,20 @@ __setup("elanfreq=", elanfreq_setup);
#endif #endif
static struct freq_attr* elanfreq_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
static struct cpufreq_driver elanfreq_driver = { static struct cpufreq_driver elanfreq_driver = {
.verify = elanfreq_verify, .verify = elanfreq_verify,
.target = elanfreq_target, .target = elanfreq_target,
.init = elanfreq_cpu_init, .init = elanfreq_cpu_init,
.exit = elanfreq_cpu_exit,
.name = "elanfreq", .name = "elanfreq",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.attr = elanfreq_attr,
}; };
......
...@@ -234,6 +234,8 @@ static int __init longhaul_get_ranges (void) ...@@ -234,6 +234,8 @@ static int __init longhaul_get_ranges (void)
case 2: case 2:
rdmsrl (MSR_VIA_LONGHAUL, longhaul.val); rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
//TODO: Nehemiah may have borken MaxMHzBR.
// need to extrapolate from FSB.
invalue = longhaul.bits.MaxMHzBR; invalue = longhaul.bits.MaxMHzBR;
if (longhaul.bits.MaxMHzBR4) if (longhaul.bits.MaxMHzBR4)
invalue += 16; invalue += 16;
...@@ -245,7 +247,16 @@ static int __init longhaul_get_ranges (void) ...@@ -245,7 +247,16 @@ static int __init longhaul_get_ranges (void)
else else
minmult = multipliers[invalue]; minmult = multipliers[invalue];
fsb = guess_fsb(maxmult); switch (longhaul.bits.MaxMHzFSB) {
case 0x0: fsb=133;
break;
case 0x1: fsb=100;
break;
case 0x2: printk (KERN_INFO PFX "Invalid (reserved) FSB!\n");
return -EINVAL;
case 0x3: fsb=66;
break;
}
break; break;
} }
...@@ -438,15 +449,34 @@ static int __init longhaul_cpu_init (struct cpufreq_policy *policy) ...@@ -438,15 +449,34 @@ static int __init longhaul_cpu_init (struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
policy->cur = calc_speed (longhaul_get_cpu_mult(), fsb); policy->cur = calc_speed (longhaul_get_cpu_mult(), fsb);
return cpufreq_frequency_table_cpuinfo(policy, longhaul_table); ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table);
if (ret)
return ret;
cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu);
return 0;
}
static int longhaul_cpu_exit(struct cpufreq_policy *policy)
{
cpufreq_frequency_table_put_attr(policy->cpu);
return 0;
} }
static struct freq_attr* longhaul_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
static struct cpufreq_driver longhaul_driver = { static struct cpufreq_driver longhaul_driver = {
.verify = longhaul_verify, .verify = longhaul_verify,
.target = longhaul_target, .target = longhaul_target,
.init = longhaul_cpu_init, .init = longhaul_cpu_init,
.exit = longhaul_cpu_exit,
.name = "longhaul", .name = "longhaul",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.attr = longhaul_attr,
}; };
static int __init longhaul_init (void) static int __init longhaul_init (void)
......
...@@ -140,6 +140,7 @@ static int powernow_k6_target (struct cpufreq_policy *policy, ...@@ -140,6 +140,7 @@ static int powernow_k6_target (struct cpufreq_policy *policy,
static int powernow_k6_cpu_init(struct cpufreq_policy *policy) static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
{ {
unsigned int i; unsigned int i;
int result;
if (policy->cpu != 0) if (policy->cpu != 0)
return -ENODEV; return -ENODEV;
...@@ -161,7 +162,13 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy) ...@@ -161,7 +162,13 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
policy->cur = busfreq * max_multiplier; policy->cur = busfreq * max_multiplier;
return cpufreq_frequency_table_cpuinfo(policy, &clock_ratio[0]); result = cpufreq_frequency_table_cpuinfo(policy, clock_ratio);
if (result)
return (result);
cpufreq_frequency_table_get_attr(clock_ratio, policy->cpu);
return 0;
} }
...@@ -172,9 +179,14 @@ static int powernow_k6_cpu_exit(struct cpufreq_policy *policy) ...@@ -172,9 +179,14 @@ static int powernow_k6_cpu_exit(struct cpufreq_policy *policy)
if (i==max_multiplier) if (i==max_multiplier)
powernow_k6_set_state(i); powernow_k6_set_state(i);
} }
cpufreq_frequency_table_put_attr(policy->cpu);
return 0; return 0;
} }
static struct freq_attr* powernow_k6_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
static struct cpufreq_driver powernow_k6_driver = { static struct cpufreq_driver powernow_k6_driver = {
.verify = powernow_k6_verify, .verify = powernow_k6_verify,
...@@ -183,6 +195,7 @@ static struct cpufreq_driver powernow_k6_driver = { ...@@ -183,6 +195,7 @@ static struct cpufreq_driver powernow_k6_driver = {
.exit = powernow_k6_cpu_exit, .exit = powernow_k6_cpu_exit,
.name = "powernow-k6", .name = "powernow-k6",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.attr = powernow_k6_attr,
}; };
......
...@@ -389,15 +389,29 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy) ...@@ -389,15 +389,29 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
policy->cur = maximum_speed; policy->cur = maximum_speed;
cpufreq_frequency_table_get_attr(powernow_table, policy->cpu);
return cpufreq_frequency_table_cpuinfo(policy, powernow_table); return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
} }
static int powernow_cpu_exit (struct cpufreq_policy *policy) {
cpufreq_frequency_table_put_attr(policy->cpu);
return 0;
}
static struct freq_attr* powernow_table_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
static struct cpufreq_driver powernow_driver = { static struct cpufreq_driver powernow_driver = {
.verify = powernow_verify, .verify = powernow_verify,
.target = powernow_target, .target = powernow_target,
.init = powernow_cpu_init, .init = powernow_cpu_init,
.exit = powernow_cpu_exit,
.name = "powernow-k7", .name = "powernow-k7",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.attr = powernow_table_attr,
}; };
static int __init powernow_init (void) static int __init powernow_init (void)
......
...@@ -802,6 +802,8 @@ powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -802,6 +802,8 @@ powernowk8_cpu_init(struct cpufreq_policy *pol)
return -EINVAL; return -EINVAL;
} }
cpufreq_frequency_table_get_attr(powernow_table, pol->cpu);
printk(KERN_INFO PFX "cpu_init done, current fid 0x%x, vid 0x%x\n", printk(KERN_INFO PFX "cpu_init done, current fid 0x%x, vid 0x%x\n",
currfid, currvid); currfid, currvid);
...@@ -813,12 +815,19 @@ static int __exit powernowk8_cpu_exit (struct cpufreq_policy *pol) ...@@ -813,12 +815,19 @@ static int __exit powernowk8_cpu_exit (struct cpufreq_policy *pol)
if (pol->cpu != 0) if (pol->cpu != 0)
return -EINVAL; return -EINVAL;
cpufreq_frequency_table_put_attr(pol->cpu);
if (powernow_table) if (powernow_table)
kfree(powernow_table); kfree(powernow_table);
return 0; return 0;
} }
static struct freq_attr* powernow_k8_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
static struct cpufreq_driver cpufreq_amd64_driver = { static struct cpufreq_driver cpufreq_amd64_driver = {
.verify = powernowk8_verify, .verify = powernowk8_verify,
.target = powernowk8_target, .target = powernowk8_target,
...@@ -826,6 +835,7 @@ static struct cpufreq_driver cpufreq_amd64_driver = { ...@@ -826,6 +835,7 @@ static struct cpufreq_driver cpufreq_amd64_driver = {
.exit = powernowk8_cpu_exit, .exit = powernowk8_cpu_exit,
.name = "powernow-k8", .name = "powernow-k8",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.attr = powernow_k8_attr,
}; };
......
...@@ -303,16 +303,37 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) ...@@ -303,16 +303,37 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
policy->cur = speed; policy->cur = speed;
return cpufreq_frequency_table_cpuinfo(policy, &speedstep_freqs[0]); result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);
if (result)
return (result);
cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
return 0;
}
static int speedstep_cpu_exit(struct cpufreq_policy *policy)
{
cpufreq_frequency_table_put_attr(policy->cpu);
return 0;
} }
static struct freq_attr* speedstep_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
static struct cpufreq_driver speedstep_driver = { static struct cpufreq_driver speedstep_driver = {
.name = "speedstep-ich", .name = "speedstep-ich",
.verify = speedstep_verify, .verify = speedstep_verify,
.target = speedstep_target, .target = speedstep_target,
.init = speedstep_cpu_init, .init = speedstep_cpu_init,
.exit = speedstep_cpu_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.attr = speedstep_attr,
}; };
......
...@@ -286,7 +286,20 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) ...@@ -286,7 +286,20 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
policy->cur = speed; policy->cur = speed;
return cpufreq_frequency_table_cpuinfo(policy, &speedstep_freqs[0]); result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);
if (result)
return (result);
cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
return 0;
}
static int speedstep_cpu_exit(struct cpufreq_policy *policy)
{
cpufreq_frequency_table_put_attr(policy->cpu);
return 0;
} }
...@@ -300,14 +313,20 @@ static int speedstep_resume(struct cpufreq_policy *policy) ...@@ -300,14 +313,20 @@ static int speedstep_resume(struct cpufreq_policy *policy)
return result; return result;
} }
static struct freq_attr* speedstep_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
static struct cpufreq_driver speedstep_driver = { static struct cpufreq_driver speedstep_driver = {
.name = "speedstep-smi", .name = "speedstep-smi",
.verify = speedstep_verify, .verify = speedstep_verify,
.target = speedstep_target, .target = speedstep_target,
.init = speedstep_cpu_init, .init = speedstep_cpu_init,
.exit = speedstep_cpu_exit,
.resume = speedstep_resume, .resume = speedstep_resume,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.attr = speedstep_attr,
}; };
/** /**
......
...@@ -13,7 +13,8 @@ config CPU_FREQ_PROC_INTF ...@@ -13,7 +13,8 @@ config CPU_FREQ_PROC_INTF
choice choice
prompt "Default CPUFreq governor" prompt "Default CPUFreq governor"
depends on CPU_FREQ depends on CPU_FREQ
default CPU_FREQ_DEFAULT_GOV_PERFORMANCE default CPU_FREQ_DEFAULT_GOV_PERFORMANCE if !CPU_FREQ_SA1100 && !CPU_FREQ_SA1110
default CPU_FREQ_DEFAULT_GOV_USERSPACE if CPU_FREQ_SA1100 || CPU_FREQ_SA1110
help help
This option sets which CPUFreq governor shall be loaded at This option sets which CPUFreq governor shall be loaded at
startup. If in doubt, select 'performance'. startup. If in doubt, select 'performance'.
......
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