[2.5. PATCH] cpufreq: Intel Coppermines -- the saga continues.
The detection process for speedstep-enabled Pentium III Coppermines is
considered proprietary by Intel. The attempt to detect this
capability using MSRs failed. So, users need to pass the option
"speedstep_coppermine=1" to the kernel (boot option or parameter) if
they own a SpeedStep capable PIII Coppermine processor. Tualatins work
as before.
Dominik
--- linux-2546original/arch/i386/kernel/cpu/cpufreq/speedstep.c Tue Nov 5 12:27:14 2002
+++ linux/arch/i386/kernel/cpu/cpufreq/speedstep.c Tue Nov 5 13:01:39 2002
@@ -1,5 +1,5 @@
/*
- * $Id: speedstep.c,v 1.53 2002/09/29 23:43:11 db Exp $
+ * $Id: speedstep.c,v 1.57 2002/11/05 12:01:12 db Exp $
*
* (C) 2001 Dave Jones, Arjan van de ven.
* (C) 2002 Dominik Brodowski <[email protected]>
@@ -46,7 +46,8 @@
/* speedstep_processor
*/
-static unsigned int speedstep_processor;
+static unsigned int speedstep_processor = 0;
+static int speedstep_coppermine = 0;
#define SPEEDSTEP_PROCESSOR_PIII_C 0x00000001 /* Coppermine core */
#define SPEEDSTEP_PROCESSOR_PIII_T 0x00000002 /* Tualatin core */
@@ -72,7 +73,7 @@
#ifdef SPEEDSTEP_DEBUG
#define dprintk(msg...) printk(msg)
#else
-#define dprintk(msg...) do { } while(0);
+#define dprintk(msg...) do { } while(0)
#endif
@@ -429,7 +430,7 @@
/**
* speedstep_detect_processor - detect Intel SpeedStep-capable processors.
*
- * Returns the SPEEDSTEP_PROCESSOR_-number for the detected chipset,
+ * Returns the SPEEDSTEP_PROCESSOR_-number for the detected processor,
* or zero on failure.
*/
static unsigned int speedstep_detect_processor (void)
@@ -474,8 +475,6 @@
return SPEEDSTEP_PROCESSOR_PIII_T;
case 0x08: /* Intel PIII [Coppermine] */
- /* based on reverse-engineering information and
- * some guessing. HANDLE WITH CARE! */
{
u32 msr_lo, msr_hi;
@@ -487,21 +486,13 @@
if (msr_lo != 0x0080000)
return 0;
- /* platform ID seems to be 0x00140000 */
- rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi);
- dprintk(KERN_DEBUG "cpufreq: Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", msr_lo, msr_hi);
- msr_hi = msr_lo & 0x001c0000;
- if (msr_hi != 0x00140000)
- return 0;
-
- /* and these bits seem to be either 00_b, 01_b or
- * 10_b but never 11_b */
- msr_lo &= 0x00030000;
- if (msr_lo == 0x0030000)
- return 0;
+ if (speedstep_coppermine)
+ return SPEEDSTEP_PROCESSOR_PIII_C;
- /* let's hope this is correct... */
- return SPEEDSTEP_PROCESSOR_PIII_C;
+ printk(KERN_INFO "cpufreq: in case this is a SpeedStep-capable Intel Pentium III Coppermine\n");
+ printk(KERN_INFO "cpufreq: processor, please pass the boot option or module parameter\n");
+ printk(KERN_INFO "cpufreq: `speedstep_coppermine=1` to the kernel. Thanks!\n");
+ return 0;
}
default:
@@ -622,6 +613,25 @@
}
+#ifndef MODULE
+/**
+ * speedstep_setup speedstep command line parameter parsing
+ *
+ * speedstep command line parameter. Use:
+ * speedstep_coppermine=1
+ * if the CPU in your notebook is a SpeedStep-capable Intel
+ * Pentium III Coppermine. These processors cannot be detected
+ * automatically, as Intel continues to consider the detection
+ * alogrithm as proprietary material.
+ */
+static int __init speedstep_setup(char *str)
+{
+ speedstep_coppermine = simple_strtoul(str, &str, 0);
+ return 1;
+}
+__setup("speedstep_coppermine=", speedstep_setup);
+#endif
+
/**
* speedstep_init - initializes the SpeedStep CPUFreq driver
*
@@ -637,18 +647,19 @@
/* detect chipset */
- speedstep_chipset = speedstep_detect_chipset();
+ speedstep_chipset = speedstep_detect_chipset();
/* detect chipset */
if (speedstep_chipset)
speedstep_processor = speedstep_detect_processor();
if ((!speedstep_chipset) || (!speedstep_processor)) {
- dprintk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) for this %s not (yet) available.\n", speedstep_processor ? "chipset" : "processor");
+ printk(KERN_INFO "a 0x%x b 0x%x\n", speedstep_processor, speedstep_chipset);
+ printk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) for this %s not (yet) available.\n", speedstep_chipset ? "processor" : "chipset");
return -ENODEV;
}
- dprintk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) support $Revision: 1.53 $\n");
+ dprintk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) support $Revision: 1.57 $\n");
dprintk(KERN_DEBUG "cpufreq: chipset 0x%x - processor 0x%x\n",
speedstep_chipset, speedstep_processor);
@@ -726,3 +737,5 @@
MODULE_LICENSE ("GPL");
module_init(speedstep_init);
module_exit(speedstep_exit);
+
+MODULE_PARM (speedstep_coppermine, "i");
On fri 08 nov 2002 09:30:08 GMT, Dominik Brodowski wrote:
> The detection process for speedstep-enabled Pentium III Coppermines is
> considered proprietary by Intel.
They seem to have changed their mind:
http://www.intel.com/support/processors/sb/cs-003779-prd24.htm
Which looks a bit like what was implemented at first. Here is a patch.
I kept the setup parameter, but it might be removed now?
--- linux-2.5.70-bk12/arch/i386/kernel/cpu/cpufreq/speedstep.c 2003-05-26 21:00:20.000000000 -0400
+++ linux/arch/i386/kernel/cpu/cpufreq/speedstep.c 2003-06-14 04:33:04.000000000 -0400
@@ -503,6 +503,15 @@
if (speedstep_coppermine)
return SPEEDSTEP_PROCESSOR_PIII_C;
+ /* if the processor is a mobile version,
+ * platform ID has bit 50 set
+ * it has SpeedStep technology if either
+ * bit 56 or 57 is set */
+ rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi);
+ dprintk(KERN_DEBUG "cpufreq: Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", msr_lo, msr_hi);
+ if ((msr_hi & (1<<18)) && (msr_hi & (3<<24)))
+ return SPEEDSTEP_PROCESSOR_PIII_C;
+
printk(KERN_INFO "cpufreq: in case this is a SpeedStep-capable Intel Pentium III Coppermine\n");
printk(KERN_INFO "cpufreq: processor, please pass the boot option or module parameter\n");
printk(KERN_INFO "cpufreq: `speedstep_coppermine=1` to the kernel. Thanks!\n");