Bug#638913: [PATCH] linux-source-3.0.0/drivers/cpufreq/speedstep-centrino.c

August 22nd, 2011 - 07:00 pm ET by Grzegorz Kochański | Report spam

from Grzegorz Kochański

Additional settings for thinkpads Intel M Processors.

Signed-off-by: Grzegorz Kochański <rumi_debian@o2.pl>



linux-source-3.0.0/drivers/cpufreq/speedstep-centrino.c.orig 2011-08-23
00:42:04.591009201 +0200
+++ linux-source-3.0.0/drivers/cpufreq/speedstep-centrino.c 2011-08-23
00:42:36.690605656 +0200
@@ -43,6 +43,7 @@ enum {
CPU_DOTHAN_A1,
CPU_DOTHAN_A2,
CPU_DOTHAN_B0,
+ CPU_DOTHAN_C0,
CPU_MP4HT_D0,
CPU_MP4HT_E0,
};
@@ -51,8 +52,9 @@ static const struct cpu_id cpu_ids[] = {
[CPU_BANIAS] = { 6, 9, 5 },
[CPU_DOTHAN_A1] = { 6, 13, 1 },
[CPU_DOTHAN_A2] = { 6, 13, 2 },
- [CPU_DOTHAN_B0] = { 6, 13, 6 },
- [CPU_MP4HT_D0] = {15, 3, 4 },
+ [CPU_DOTHAN_B0] = { 6, 13, 6 },
+ [CPU_DOTHAN_C0] = { 6, 13, 8 },
+ [CPU_MP4HT_D0] = {15, 3, 4 },
[CPU_MP4HT_E0] = {15, 4, 1 },
};
#define N_IDS ARRAY_SIZE(cpu_ids)
@@ -193,6 +195,85 @@ static struct cpufreq_frequency_table ba
{ .frequency = CPUFREQ_TABLE_END }
};
#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),
+ OPEX(1064, 133, 1100, 1093, 1068, 1066),
+ OPEX(1330, 133, 1212, 1198, 1148, 1143),
+ OPEX(1729, 133, 1356, 1356, 1260, 1260),
+ { .frequency = CPUFREQ_TABLE_END }
+};
+
+/* Intel Pentium M processor 750 / 1.86 GHz (Sonoma) */
+static struct cpufreq_frequency_table sonoma_1862[] =
+{
+ OPEX( 798, 133, 988, 988, 988, 988),
+ OPEX(1064, 133, 1084, 1080, 1068, 1056),
+ OPEX(1330, 133, 1180, 1172, 1132, 1124),
+ OPEX(1596, 133, 1276, 1264, 1196, 1192),
+ OPEX(1862, 133, 1356, 1356, 1260, 1260),
+ { .frequency = CPUFREQ_TABLE_END }
+};
+
+/* Intel Pentium M processor 760 / 2.00 GHz (Sonoma) */
+static struct cpufreq_frequency_table sonoma_1995[] =
+{
+ OPEX( 798, 133, 988, 988, 988, 988),
+ OPEX(1064, 133, 1084, 1070, 1052, 1048),
+ OPEX(1330, 133, 1164, 1152, 1116, 1109),
+ OPEX(1596, 133, 1244, 1233, 1180, 1169),
+ OPEX(1995, 133, 1356, 1356, 1260, 1260),
+ { .frequency = CPUFREQ_TABLE_END }
+};
+/* Intel Pentium M processor 770 / 2.13 GHz (Sonoma) */
+static struct cpufreq_frequency_table sonoma_2128[] =
+{
+ OPEX( 798, 133, 988, 988, 988, 988),
+ OPEX(1064, 133, 1068, 1065, 1052, 1042),
+ OPEX(1330, 133, 1148, 1142, 1100, 1097),
+ OPEX(1596, 133, 1228, 1218, 1164, 1151),
+ OPEX(1862, 133, 1308, 1295, 1212, 1206),
+ OPEX(2128, 133, 1372, 1372, 1260, 1260),
+ { .frequency = CPUFREQ_TABLE_END }
+};
+
+/* Intel Pentium M processor 780 / 2.26 GHz (Sonoma) */
+static struct cpufreq_frequency_table sonoma_2261[] =
+{
+ OPEX( 798, 133, 988, 988, 988, 988),
+ OPEX(1064, 133, 1068, 1064, 1052, 1037),
+ OPEX(1330, 133, 1148, 1139, 1100, 1087),
+ OPEX(1596, 133, 1228, 1215, 1148, 1136),
+ OPEX(1862, 133, 1292, 1291, 1196, 1186),
+ OPEX(2261, 133, 1404, 1404, 1260, 1260),
+ { .frequency = CPUFREQ_TABLE_END }
+};
+
+#undef OPEX
+
+#define SONOMA(cpuid, max, base, name) \
+{ .cpu_id = cpuid, \
+ .model_name = "Intel(R) Pentium(R) M processor " name "GHz", \
+ .max_freq = (max)*1000, \
+ .op_points = sonoma_##max, \
+}

#define _BANIAS(cpuid, max, name) \
{ .cpu_id = cpuid, \
@@ -216,6 +297,14 @@ static struct cpu_model models[] =
BANIAS(1600),
BANIAS(1700),

+ /* Builtin tables for Dothan C0 CPUs, a.k.a Sonoma */
+ SONOMA(&cpu_ids[CPU_DOTHAN_C0], 1596, 133, "1.60"),
+ SONOMA(&cpu_ids[CPU_DOTHAN_C0], 1729, 133, "1.73"),
+ SONOMA(&cpu_ids[CPU_DOTHAN_C0], 1862, 133, "1.86"),
+ SONOMA(&cpu_ids[CPU_DOTHAN_C0], 1995, 133, "2.00"),
+ SONOMA(&cpu_ids[CPU_DOTHAN_C0], 2128, 133, "2.13"),
+ SONOMA(&cpu_ids[CPU_DOTHAN_C0], 2261, 133, "2.26"),
+
/* NULL model_name is a wildcard */
{ &cpu_ids[CPU_DOTHAN_A1], NULL, 0, NULL },
{ &cpu_ids[CPU_DOTHAN_A2], NULL, 0, NULL },


from Grzegorz Kochański<br><br>Additional settings for thinkpads Intel M Processors.<br><br><pre>Signed-off-by: Grzegorz Kochański &lt;<a href="mailto:rumi_debian@o2.pl">rumi_debian@o2.pl</a>&gt;<br><br><br><br> linux-source-3.0.0/drivers/cpufreq/speedstep-centrino.c.orig 2011-08-23 00:42:04.591009201 +0200<br>
+++ linux-source-3.0.0/drivers/cpufreq/speedstep-centrino.c 2011-08-23 00:42:36.690605656 +0200<br>@@ -43,6 +43,7 @@ enum {<br> CPU_DOTHAN_A1,<br> CPU_DOTHAN_A2,<br> CPU_DOTHAN_B0,<br>+ CPU_DOTHAN_C0,<br> CPU_MP4HT_D0,<br>
CPU_MP4HT_E0,<br> };<br>@@ -51,8 +52,9 @@ static const struct cpu_id cpu_ids[] = {<br> [CPU_BANIAS] = { 6, 9, 5 },<br> [CPU_DOTHAN_A1] = { 6, 13, 1 },<br> [CPU_DOTHAN_A2] = { 6, 13, 2 },<br>- [CPU_DOTHAN_B0] = { 6, 13, 6 },<br>
- [CPU_MP4HT_D0] = {15, 3, 4 },<br>+ [CPU_DOTHAN_B0] = { 6, 13, 6 },<br>+ [CPU_DOTHAN_C0] = { 6, 13, 8 },<br>+ [CPU_MP4HT_D0] = {15, 3, 4 },<br> [CPU_MP4HT_E0] = {15, 4, 1 },<br> };<br> #define N_IDS ARRAY_SIZE(cpu_ids)<br>
@@ -193,6 +195,85 @@ static struct cpufreq_frequency_table ba<br> { .frequency = CPUFREQ_TABLE_END }<br> };<br> #undef OP<br>+#define OPEX(mhz, base, mva, mvb, mvc, mvd) \<br>+{ \<br>
+ .frequency = (mhz) * 1000, \<br>+ .index = (((mhz)/(base)) &lt;&lt; 8) | ((mva - 700) / 16) \<br>+}<br>+<br>+/* Intel Pentium M processor 730 / 1.60 GHz (Sonoma) */<br>+static struct cpufreq_frequency_table sonoma_1596[] =<br>
+{<br>+ OPEX( 798, 133, 988, 988, 988, 988),<br>+ OPEX(1064, 133, 1116, 1111, 1084, 1079),<br>+ OPEX(1330, 133, 1244, 1233, 1180, 1169),<br>+ OPEX(1596, 133, 1356, 1356, 1260, 1260),<br>+ { .frequency = CPUFREQ_TABLE_END }<br>
+};<br>+<br>+/* Intel Pentium M processor 740 / 1.73 GHz (Sonoma) */<br>+static struct cpufreq_frequency_table sonoma_1729[] =<br>+{<br>+ OPEX( 798, 133, 988, 988, 988, 988),<br>+ OPEX(1064, 133, 1100, 1093, 1068, 1066),<br>
+ OPEX(1330, 133, 1212, 1198, 1148, 1143),<br>+ OPEX(1729, 133, 1356, 1356, 1260, 1260),<br>+ { .frequency = CPUFREQ_TABLE_END }<br>+};<br>+<br>+/* Intel Pentium M processor 750 / 1.86 GHz (Sonoma) */<br>
+static struct cpufreq_frequency_table sonoma_1862[] =<br>+{<br>+ OPEX( 798, 133, 988, 988, 988, 988),<br>+ OPEX(1064, 133, 1084, 1080, 1068, 1056),<br>+ OPEX(1330, 133, 1180, 1172, 1132, 1124),<br>
+ OPEX(1596, 133, 1276, 1264, 1196, 1192),<br>+ OPEX(1862, 133, 1356, 1356, 1260, 1260),<br>+ { .frequency = CPUFREQ_TABLE_END }<br>+};<br>+<br>+/* Intel Pentium M processor 760 / 2.00 GHz (Sonoma) */<br>
+static struct cpufreq_frequency_table sonoma_1995[] =<br>+{<br>+ OPEX( 798, 133, 988, 988, 988, 988),<br>+ OPEX(1064, 133, 1084, 1070, 1052, 1048),<br>+ OPEX(1330, 133, 1164, 1152, 1116, 1109),<br>+ OPEX(1596, 133, 1244, 1233, 1180, 1169),<br>
+ OPEX(1995, 133, 1356, 1356, 1260, 1260),<br>+ { .frequency = CPUFREQ_TABLE_END }<br>+};<br>+/* Intel Pentium M processor 770 / 2.13 GHz (Sonoma) */<br>+static struct cpufreq_frequency_table sonoma_2128[] =<br>
+{<br>+ OPEX( 798, 133, 988, 988, 988, 988),<br>+ OPEX(1064, 133, 1068, 1065, 1052, 1042),<br>+ OPEX(1330, 133, 1148, 1142, 1100, 1097),<br>+ OPEX(1596, 133, 1228, 1218, 1164, 1151),<br>+ OPEX(1862, 133, 1308, 1295, 1212, 1206),<br>
+ OPEX(2128, 133, 1372, 1372, 1260, 1260),<br>+ { .frequency = CPUFREQ_TABLE_END }<br>+};<br>+<br>+/* Intel Pentium M processor 780 / 2.26 GHz (Sonoma) */<br>+static struct cpufreq_frequency_table sonoma_2261[] =<br>
+{<br>+ OPEX( 798, 133, 988, 988, 988, 988),<br>+ OPEX(1064, 133, 1068, 1064, 1052, 1037),<br>+ OPEX(1330, 133, 1148, 1139, 1100, 1087),<br>+ OPEX(1596, 133, 1228, 1215, 1148, 1136),<br>+ OPEX(1862, 133, 1292, 1291, 1196, 1186),<br>
+ OPEX(2261, 133, 1404, 1404, 1260, 1260),<br>+ { .frequency = CPUFREQ_TABLE_END }<br>+};<br>+<br>+#undef OPEX<br>+<br>+#define SONOMA(cpuid, max, base, name) \<br>+{ .cpu_id = cpuid, \<br>
+ .model_name = &quot;Intel(R) Pentium(R) M processor &quot; name &quot;GHz&quot;, \<br>+ .max_freq = (max)*1000, \<br>+ .op_points = sonoma_##max, \<br>+}<br> <br> #define _BANIAS(cpuid, max, name) \<br>
{ .cpu_id = cpuid, \<br>@@ -216,6 +297,14 @@ static struct cpu_model models[] =<br> BANIAS(1600),<br> BANIAS(1700),<br> <br>+ /* Builtin tables for Dothan C0 CPUs, a.k.a Sonoma */<br>+ SONOMA(&amp;cpu_ids[CPU_DOTHAN_C0], 1596, 133, &quot;1.60&quot;),<br>
+ SONOMA(&amp;cpu_ids[CPU_DOTHAN_C0], 1729, 133, &quot;1.73&quot;),<br>+ SONOMA(&amp;cpu_ids[CPU_DOTHAN_C0], 1862, 133, &quot;1.86&quot;),<br>+ SONOMA(&amp;cpu_ids[CPU_DOTHAN_C0], 1995, 133, &quot;2.00&quot;),<br>
+ SONOMA(&amp;cpu_ids[CPU_DOTHAN_C0], 2128, 133, &quot;2.13&quot;),<br>+ SONOMA(&amp;cpu_ids[CPU_DOTHAN_C0], 2261, 133, &quot;2.26&quot;),<br>+<br> /* NULL model_name is a wildcard */<br> { &amp;cpu_ids[CPU_DOTHAN_A1], NULL, 0, NULL },<br>
{ &amp;cpu_ids[CPU_DOTHAN_A2], NULL, 0, NULL },<br><br></pre>




To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 1 replyReplies Make a reply

Replies

#1 Jonathan Nieder
August 22nd, 2011 - 07:40 pm ET | Report spam
Hi,

Grzegorz Kochański wrote:

Additional settings for thinkpads Intel M Processors.



It is best to credit the original author and mention where the patch
came from. IIUC this patch is by Christophe Dumez and can be found
at
http://kernel.ubuntu.com/git?p=ubun...;h#120eb5a

Unfortunately, at https://bugzilla.kernel.org/show_bug.cgi?idt63 we
see:

Comment #13 From Andrew Morton 2007-10-18 13:44:59
I asked davej about this and he said:

The only safe way to use scaling on 'dothan' cores is with ACPI.
We just have no way to tell which of the four sets of voltages
is in use. People keep proposing patches to hardcode a set of
tables for them which "works for them", but could do *anything*
on someone elses system.
Even if we added it as a CONFIG option, I'm worried that
people will turn it on not understanding the consequences
and either plague us with crappy bug reports of flaky kernels
(or worse).
(And you guarantee some distros will turn it on to
"make hardware 'just work'")

All-round crappy situation really, we're between a rock
and a hard place, and ACPI is the best hope we've got.

Has Ubuntu been using this patch without trouble?



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact

Similar topics