diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-12-04 20:39:16 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-12-12 17:29:04 -0500 |
commit | e11952b971ee729a8fdc2bfb1252f5760c0287b0 (patch) | |
tree | 38ef26ec277daebf98af6abf64b5c32b28a4d32c /arch/i386/kernel/cpu/cpufreq/speedstep-lib.c | |
parent | 7531a0b56f6211a5407c8cda4968c3b7ca9496ab (diff) |
[CPUFREQ] p4-clockmod: fix support for Core
Support for Core CPUs was broken in two ways in speedstep-lib: for x86_64,
we missed a MSR definition; for both x86_64 and i386, the FSB calculation
was wrong by four (it's a quad-pumped bus). Also increase the accuracy
of the calculation.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/i386/kernel/cpu/cpufreq/speedstep-lib.c')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-lib.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c index a709f6d67e25..d59277c00911 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c | |||
@@ -123,23 +123,22 @@ static unsigned int pentiumM_get_frequency(void) | |||
123 | return (msr_tmp * 100 * 1000); | 123 | return (msr_tmp * 100 * 1000); |
124 | } | 124 | } |
125 | 125 | ||
126 | #ifdef CONFIG_X86_32 | ||
127 | static unsigned int pentium_core_get_frequency(void) | 126 | static unsigned int pentium_core_get_frequency(void) |
128 | { | 127 | { |
129 | u32 fsb = 0; | 128 | u32 fsb = 0; |
130 | u32 msr_lo, msr_tmp; | 129 | u32 msr_lo, msr_tmp; |
131 | 130 | ||
132 | rdmsr(MSR_FSB_FREQ, msr_lo, msr_tmp); | 131 | rdmsr(MSR_FSB_FREQ, msr_lo, msr_tmp); |
133 | /* see table B-2 of 24547212.pdf */ | 132 | /* see table B-2 of 25366920.pdf */ |
134 | switch (msr_lo & 0x07) { | 133 | switch (msr_lo & 0x07) { |
135 | case 5: | 134 | case 5: |
136 | fsb = 400; | 135 | fsb = 100000; |
137 | break; | 136 | break; |
138 | case 1: | 137 | case 1: |
139 | fsb = 533; | 138 | fsb = 133333; |
140 | break; | 139 | break; |
141 | case 3: | 140 | case 3: |
142 | fsb = 667; | 141 | fsb = 166667; |
143 | break; | 142 | break; |
144 | default: | 143 | default: |
145 | printk(KERN_ERR "PCORE - MSR_FSB_FREQ undefined value"); | 144 | printk(KERN_ERR "PCORE - MSR_FSB_FREQ undefined value"); |
@@ -149,11 +148,11 @@ static unsigned int pentium_core_get_frequency(void) | |||
149 | dprintk("PCORE - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); | 148 | dprintk("PCORE - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); |
150 | 149 | ||
151 | msr_tmp = (msr_lo >> 22) & 0x1f; | 150 | msr_tmp = (msr_lo >> 22) & 0x1f; |
152 | dprintk("bits 22-26 are 0x%x, speed is %u\n", msr_tmp, (msr_tmp * fsb * 1000)); | 151 | dprintk("bits 22-26 are 0x%x, speed is %u\n", msr_tmp, (msr_tmp * fsb)); |
153 | 152 | ||
154 | return (msr_tmp * fsb * 1000); | 153 | return (msr_tmp * fsb); |
155 | } | 154 | } |
156 | #endif | 155 | |
157 | 156 | ||
158 | static unsigned int pentium4_get_frequency(void) | 157 | static unsigned int pentium4_get_frequency(void) |
159 | { | 158 | { |
@@ -205,10 +204,8 @@ static unsigned int pentium4_get_frequency(void) | |||
205 | unsigned int speedstep_get_processor_frequency(unsigned int processor) | 204 | unsigned int speedstep_get_processor_frequency(unsigned int processor) |
206 | { | 205 | { |
207 | switch (processor) { | 206 | switch (processor) { |
208 | #ifdef CONFIG_X86_32 | ||
209 | case SPEEDSTEP_PROCESSOR_PCORE: | 207 | case SPEEDSTEP_PROCESSOR_PCORE: |
210 | return pentium_core_get_frequency(); | 208 | return pentium_core_get_frequency(); |
211 | #endif | ||
212 | case SPEEDSTEP_PROCESSOR_PM: | 209 | case SPEEDSTEP_PROCESSOR_PM: |
213 | return pentiumM_get_frequency(); | 210 | return pentiumM_get_frequency(); |
214 | case SPEEDSTEP_PROCESSOR_P4D: | 211 | case SPEEDSTEP_PROCESSOR_P4D: |