Re: [PATCH] Enable speedstep for sonoma processors.

Previous thread: [PATCH] add AGP support for Radeon Mobility 9000 chipset by maximilian attems on Tuesday, June 3, 2008 - 10:07 am. (3 messages)

Next thread: [PATCH] UBUNTU: i386 -generic builds. Ignore: yes by maximilian attems on Tuesday, June 3, 2008 - 9:48 am. (2 messages)
From: maximilian attems
Date: Tuesday, June 3, 2008 - 10:04 am

From: cking <colin.king@canonical.com>

OriginalAuthor: Christophe Dumez, repackaged by Wolfgang Tremmel
OriginalLocation: http://launchpadlibrarian.net/11575235/speedstep-sonoma.patch Bug: 132271

Signed-off-by: cking <colin.king@canonical.com>
Signed-off-by: maximilian attems <max@stro.at>
---
 arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c |   93 ++++++++++++++++++++++
 1 files changed, 93 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
index 908dd34..6d6896e 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -44,6 +44,7 @@ enum {
 	CPU_DOTHAN_A1,
 	CPU_DOTHAN_A2,
 	CPU_DOTHAN_B0,
+	CPU_DOTHAN_C0,
 	CPU_MP4HT_D0,
 	CPU_MP4HT_E0,
 };
@@ -53,6 +54,7 @@ static const struct cpu_id cpu_ids[] = {
 	[CPU_DOTHAN_A1]	= { 6, 13, 1 },
 	[CPU_DOTHAN_A2]	= { 6, 13, 2 },
 	[CPU_DOTHAN_B0]	= { 6, 13, 6 },
+	[CPU_DOTHAN_C0]	= { 6, 13, 8 },
 	[CPU_MP4HT_D0]	= {15,  3, 4 },
 	[CPU_MP4HT_E0]	= {15,  4, 1 },
 };
@@ -194,6 +196,88 @@ static struct cpufreq_frequency_table banias_1700[] =
 };
 #undef OP
 
+
+#define OPEX(mhz, base, mva, mvb, mvc, mvd)                     \
+{                                                               \
+        .frequency = (mhz) * 1000,                              \
+        .index = (((mhz)/(base)) << 8) | ((mva - 700) / 16)     \
+}
+
+/* Intel Pentium M processor 730 / 1.60 GHz (Sonoma) */
+static struct cpufreq_frequency_table sonoma_1596[] =
+{
+        OPEX( 798, 133,  988,  988,  988,  988),
+        OPEX(1064, 133, 1116, 1111, 1084, 1079),
+        OPEX(1330, 133, 1244, 1233, 1180, 1169),
+        OPEX(1596, 133, 1356, 1356, 1260, 1260),
+        { .frequency = CPUFREQ_TABLE_END }
+};
+
+/* Intel Pentium M processor 740 / 1.73 GHz (Sonoma) */
+static struct cpufreq_frequency_table sonoma_1729[] =
+{
+        OPEX( 798, 133,  988,  988,  988,  988),
+        ...
From: Dave Jones
Date: Tuesday, June 3, 2008 - 10:42 am

On Tue, Jun 03, 2008 at 07:04:16PM +0200, maximilian attems wrote:
 > From: cking <colin.king@canonical.com>
 > 
 > OriginalAuthor: Christophe Dumez, repackaged by Wolfgang Tremmel
 > OriginalLocation: http://launchpadlibrarian.net/11575235/speedstep-sonoma.patch Bug: 132271
 > 
 > Signed-off-by: cking <colin.king@canonical.com>
 > Signed-off-by: maximilian attems <max@stro.at>
 > ---
 >  arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c |   93 ++++++++++++++++++++++
 >  1 files changed, 93 insertions(+), 0 deletions(-)

This patch has been floating around for years.
So long, I've forgotten the original reason it wasn't accepted.
It had something to do with it working for some users, but not others,
and we can't detect the 'not working' case.

speedstep-centrino is also deprecated in favour of acpi-cpufreq for some time.
If acpi isn't working on these machines, we should find out why.

	Dave

 > diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
 > index 908dd34..6d6896e 100644
 > --- a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
 > +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
 > @@ -44,6 +44,7 @@ enum {
 >  	CPU_DOTHAN_A1,
 >  	CPU_DOTHAN_A2,
 >  	CPU_DOTHAN_B0,
 > +	CPU_DOTHAN_C0,
 >  	CPU_MP4HT_D0,
 >  	CPU_MP4HT_E0,
 >  };
 > @@ -53,6 +54,7 @@ static const struct cpu_id cpu_ids[] = {
 >  	[CPU_DOTHAN_A1]	= { 6, 13, 1 },
 >  	[CPU_DOTHAN_A2]	= { 6, 13, 2 },
 >  	[CPU_DOTHAN_B0]	= { 6, 13, 6 },
 > +	[CPU_DOTHAN_C0]	= { 6, 13, 8 },
 >  	[CPU_MP4HT_D0]	= {15,  3, 4 },
 >  	[CPU_MP4HT_E0]	= {15,  4, 1 },
 >  };
 > @@ -194,6 +196,88 @@ static struct cpufreq_frequency_table banias_1700[] =
 >  };
 >  #undef OP
 >  
 > +
 > +#define OPEX(mhz, base, mva, mvb, mvc, mvd)                     \
 > +{                                                               \
 > +        .frequency = (mhz) * 1000,                              \
 > +        .index = (((mhz)/(base)) << 8) | ((mva - 700) / 16) ...
From: Matthew Garrett
Date: Tuesday, June 3, 2008 - 6:21 pm

My recollection is that we had no way to work out which voltage table 
was appropriate for a given CPU, so there was a risk of us either over- 
or under-volting the chip. Doing it via ACPI is safe.

-- 
Matthew Garrett | mjg59@srcf.ucam.org
--

Previous thread: [PATCH] add AGP support for Radeon Mobility 9000 chipset by maximilian attems on Tuesday, June 3, 2008 - 10:07 am. (3 messages)

Next thread: [PATCH] UBUNTU: i386 -generic builds. Ignore: yes by maximilian attems on Tuesday, June 3, 2008 - 9:48 am. (2 messages)