Code/undervolt-pentium-m-2.6.13.1.patch

From ThinkWiki
Revision as of 09:25, 11 April 2025 by ThinkGNU (Talk | contribs) (Put patch in <pre> block)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
--- linux-2.6.13.1-vanilla/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c	2005-09-10 05:42:58.000000000 +0300
+++ linux-2.6.13.1/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c	2005-10-18 04:46:01.000000000 +0200
@@ -54,6 +54,7 @@ enum {
 	CPU_DOTHAN_A1,
 	CPU_DOTHAN_A2,
 	CPU_DOTHAN_B0,
+	CPU_DOTHAN_C0,
 	CPU_MP4HT_D0,
 	CPU_MP4HT_E0,
 };
@@ -63,6 +64,8 @@ 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 },
 };
@@ -94,6 +97,12 @@ static struct cpufreq_driver centrino_dr
 		.frequency = (mhz) * 1000,				\
 		.index = (((mhz)/100) << 8) | ((mv - 700) / 16)		\
 	}
+/* Likewise, for processors with 133MHz FSB. */
+#define OP133(mhz, mv)							\
+	{								\
+		.frequency = (mhz) * 1000,				\
+		.index = (((mhz)/133) << 8) | ((mv - 700) / 16)		\
+	}
 
 /*
  * These voltage tables were derived from the Intel Pentium M
@@ -202,7 +211,26 @@ static struct cpufreq_frequency_table ba
 	OP(1700, 1484),
 	{ .frequency = CPUFREQ_TABLE_END }
 };
+
+/* Intel Pentium M 750, drastically undervoltaged */
+static struct cpufreq_frequency_table pentium_m_750[] =
+{
+	    /* MHz   mV */
+	OP133( 800,  700),
+	OP133(1066,  780),
+	OP133(1200,  828),
+	OP133(1333,  876),
+	OP133(1466,  924),
+	OP133(1600,  972),
+	OP133(1733, 1020),
+	OP133(1866, 1068),
+	{ .frequency = CPUFREQ_TABLE_END }
+};
+
 #undef OP
+#undef OP133
 
 #define _BANIAS(cpuid, max, name)	\
 {	.cpu_id		= cpuid,	\
@@ -225,6 +253,12 @@ static struct cpu_model models[] =
 	BANIAS(1500),
 	BANIAS(1600),
 	BANIAS(1700),
+	{
+		.cpu_id     =  &cpu_ids[CPU_DOTHAN_C0],
+		.model_name = "Intel(R) Pentium(R) M processor 1.86GHz",
+		.max_freq   = 1866000,
+		.op_points  = pentium_m_750
+	},
 
 	/* NULL model_name is a wildcard */
 	{ &cpu_ids[CPU_DOTHAN_A1], NULL, 0, NULL },