Advertisement
Guest User

speedstep-centrino.c patch for Banias, Dothan B0 and Dothan C0 (Sonoma) Pentium-M to make cpufreq work

a guest
Apr 28th, 2010
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 7.34 KB | None | 0 0
  1. --- speedstep-centrino_original_unpatched_2.6.32.c  2010-04-11 02:59:55.000000000 +0200
  2. +++ speedstep-centrino.c    2010-04-11 02:29:35.000000000 +0200
  3. @@ -45,6 +45,7 @@
  4.     CPU_DOTHAN_A1,
  5.     CPU_DOTHAN_A2,
  6.     CPU_DOTHAN_B0,
  7. +   CPU_DOTHAN_C0,
  8.     CPU_MP4HT_D0,
  9.     CPU_MP4HT_E0,
  10.  };
  11. @@ -54,6 +55,7 @@
  12.     [CPU_DOTHAN_A1] = { 6, 13, 1 },
  13.     [CPU_DOTHAN_A2] = { 6, 13, 2 },
  14.     [CPU_DOTHAN_B0] = { 6, 13, 6 },
  15. +   [CPU_DOTHAN_C0] = { 6, 13, 8 },
  16.     [CPU_MP4HT_D0]  = {15,  3, 4 },
  17.     [CPU_MP4HT_E0]  = {15,  4, 1 },
  18.  };
  19. @@ -196,6 +198,170 @@
  20.  };
  21.  #undef OP
  22.  
  23. +
  24. +/* Dothan processor datasheet 30218903.pdf defines 4 voltages for each
  25. +   frequency (VID#A through VID#D) - this macro allows us to define all
  26. +   of these but we only use the VID#A voltages at compile time - this may
  27. +   need some work if we want to select the voltage profile at runtime. */
  28. +
  29. +#define OP(mhz, mva, mvb, mvc, mvd)                    \
  30. +   {                               \
  31. +       .frequency = (mhz) * 1000,              \
  32. +       .index = (((mhz)/100) << 8) | ((mva - 700) / 16)        \
  33. +   }
  34. +
  35. +/* Intel Pentium M processor 715 / 1.50GHz (Dothan) */
  36. +static struct cpufreq_frequency_table dothan_1500[] =
  37. +{
  38. +   OP( 600,  988,  988,  988,  988),
  39. +   OP( 800, 1068, 1068, 1068, 1052),
  40. +   OP(1000, 1148, 1148, 1132, 1116),
  41. +   OP(1200, 1228, 1212, 1212, 1180),
  42. +   OP(1500, 1340, 1324, 1308, 1276),
  43. +   { .frequency = CPUFREQ_TABLE_END }
  44. +};
  45. +
  46. +/* Intel Pentium M processor 725 / 1.60GHz (Dothan) */
  47. +static struct cpufreq_frequency_table dothan_1600[] =
  48. +{
  49. +   OP( 600,  988,  988,  988,  988),
  50. +   OP( 800, 1068, 1068, 1052, 1052),
  51. +   OP(1000, 1132, 1132, 1116, 1116),
  52. +   OP(1200, 1212, 1196, 1180, 1164),
  53. +   OP(1400, 1276, 1260, 1244, 1228),
  54. +   OP(1600, 1340, 1324, 1308, 1276),
  55. +   { .frequency = CPUFREQ_TABLE_END }
  56. +};
  57. +
  58. +/* Intel Pentium M processor 735 / 1.70GHz (Dothan) */
  59. +static struct cpufreq_frequency_table dothan_1700[] =
  60. +{
  61. +   OP( 600,  988,  988,  988,  988),
  62. +   OP( 800, 1052, 1052, 1052, 1052),
  63. +   OP(1000, 1116, 1116, 1116, 1100),
  64. +   OP(1200, 1180, 1180, 1164, 1148),
  65. +   OP(1400, 1244, 1244, 1228, 1212),
  66. +   OP(1700, 1340, 1324, 1308, 1276),
  67. +   { .frequency = CPUFREQ_TABLE_END }
  68. +};
  69. +
  70. +/* Intel Pentium M processor 745 / 1.80GHz (Dothan) */
  71. +static struct cpufreq_frequency_table dothan_1800[] =
  72. +{
  73. +   OP( 600,  988,  988,  988,  988),
  74. +   OP( 800, 1052, 1052, 1052, 1036),
  75. +   OP(1000, 1116, 1100, 1100, 1084),
  76. +   OP(1200, 1164, 1164, 1148, 1132),
  77. +   OP(1400, 1228, 1212, 1212, 1180),
  78. +   OP(1600, 1292, 1276, 1260, 1228),
  79. +   OP(1800, 1340, 1324, 1308, 1276),
  80. +   { .frequency = CPUFREQ_TABLE_END }
  81. +};
  82. +
  83. +/* Intel Pentium M processor 755 / 2.00GHz (Dothan) */
  84. +static struct cpufreq_frequency_table dothan_2000[] =
  85. +{
  86. +   OP( 600,  988,  988,  988,  988),
  87. +   OP( 800, 1052, 1036, 1036, 1036),
  88. +   OP(1000, 1100, 1084, 1084, 1084),
  89. +   OP(1200, 1148, 1132, 1132, 1116),
  90. +   OP(1400, 1196, 1180, 1180, 1164),
  91. +   OP(1600, 1244, 1228, 1228, 1196),
  92. +   OP(1800, 1292, 1276, 1276, 1244),
  93. +   OP(2000, 1340, 1324, 1308, 1276),
  94. +   { .frequency = CPUFREQ_TABLE_END }
  95. +};
  96. +
  97. +#undef OP
  98. +
  99. +
  100. +#define OPEX(mhz, base, mva, mvb, mvc, mvd)                     \
  101. +{                                                               \
  102. +        .frequency = (mhz) * 1000,                              \
  103. +        .index = (((mhz)/(base)) << 8) | ((mva - 700) / 16)     \
  104. +}
  105. +
  106. +/* Intel Pentium M processor 730 / 1.60 GHz (Sonoma) */
  107. +static struct cpufreq_frequency_table sonoma_1596[] =
  108. +{
  109. +        OPEX( 798, 133,  988,  988,  988,  988),
  110. +        OPEX(1064, 133, 1116, 1111, 1084, 1079),
  111. +        OPEX(1330, 133, 1244, 1233, 1180, 1169),
  112. +        OPEX(1596, 133, 1356, 1356, 1260, 1260),
  113. +        { .frequency = CPUFREQ_TABLE_END }
  114. +};
  115. +
  116. +/* Intel Pentium M processor 740 / 1.73 GHz (Sonoma) */
  117. +static struct cpufreq_frequency_table sonoma_1729[] =
  118. +{
  119. +        OPEX( 798, 133,  988,  988,  988,  988),
  120. +        OPEX(1064, 133, 1100, 1093, 1068, 1066),
  121. +        OPEX(1330, 133, 1212, 1198, 1148, 1143),
  122. +        OPEX(1729, 133, 1356, 1356, 1260, 1260),
  123. +        { .frequency = CPUFREQ_TABLE_END }
  124. +};
  125. +
  126. +/* Intel Pentium M processor 750 / 1.86 GHz (Sonoma) */
  127. +static struct cpufreq_frequency_table sonoma_1862[] =
  128. +{
  129. +        OPEX( 798, 133,  988,  988,  988,  988),
  130. +        OPEX(1064, 133, 1084, 1080, 1068, 1056),
  131. +        OPEX(1330, 133, 1180, 1172, 1132, 1124),
  132. +        OPEX(1596, 133, 1276, 1264, 1196, 1192),
  133. +        OPEX(1862, 133, 1356, 1356, 1260, 1260),
  134. +        { .frequency = CPUFREQ_TABLE_END }
  135. +};
  136. +
  137. +/* Intel Pentium M processor 760 / 2.00 GHz (Sonoma) */
  138. +static struct cpufreq_frequency_table sonoma_1995[] =
  139. +{
  140. +        OPEX( 798, 133, 988, 988, 988, 988),
  141. +        OPEX(1064, 133, 1084, 1070, 1052, 1048),
  142. +        OPEX(1330, 133, 1164, 1152, 1116, 1109),
  143. +        OPEX(1596, 133, 1244, 1233, 1180, 1169),
  144. +        OPEX(1995, 133, 1356, 1356, 1260, 1260),
  145. +        { .frequency = CPUFREQ_TABLE_END }
  146. +};
  147. +/* Intel Pentium M processor 770 / 2.13 GHz (Sonoma) */
  148. +static struct cpufreq_frequency_table sonoma_2128[] =
  149. +{
  150. +        OPEX( 798, 133, 988, 988, 988, 988),
  151. +        OPEX(1064, 133, 1068, 1065, 1052, 1042),
  152. +        OPEX(1330, 133, 1148, 1142, 1100, 1097),
  153. +        OPEX(1596, 133, 1228, 1218, 1164, 1151),
  154. +        OPEX(1862, 133, 1308, 1295, 1212, 1206),
  155. +        OPEX(2128, 133, 1372, 1372, 1260, 1260),
  156. +        { .frequency = CPUFREQ_TABLE_END }
  157. +};
  158. +
  159. +/* Intel Pentium M processor 780 / 2.26 GHz (Sonoma) */
  160. +static struct cpufreq_frequency_table sonoma_2261[] =
  161. +{
  162. +        OPEX( 798, 133, 988, 988, 988, 988),
  163. +        OPEX(1064, 133, 1068, 1064, 1052, 1037),
  164. +        OPEX(1330, 133, 1148, 1139, 1100, 1087),
  165. +        OPEX(1596, 133, 1228, 1215, 1148, 1136),
  166. +        OPEX(1862, 133, 1292, 1291, 1196, 1186),
  167. +        OPEX(2261, 133, 1404, 1404, 1260, 1260),
  168. +        { .frequency = CPUFREQ_TABLE_END }
  169. +};
  170. +
  171. +#undef OPEX
  172. +
  173. +#define SONOMA(cpuid, max, base, name)  \
  174. +{       .cpu_id         = cpuid,        \
  175. +        .model_name     = "Intel(R) Pentium(R) M processor " name "GHz", \
  176. +        .max_freq       = (max)*1000,   \
  177. +        .op_points      = sonoma_##max, \
  178. +}
  179. +
  180. +#define DOTHAN(cpuid, max, name)   \
  181. +{  .cpu_id     = cpuid,    \
  182. +   .model_name = "Intel(R) Pentium(R) M processor " name "GHz", \
  183. +   .max_freq   = (max)*1000,   \
  184. +   .op_points  = dothan_##max, \
  185. +}
  186. +
  187.  #define _BANIAS(cpuid, max, name)  \
  188.  {  .cpu_id     = cpuid,    \
  189.     .model_name = "Intel(R) Pentium(R) M processor " name "MHz", \
  190. @@ -218,6 +384,21 @@
  191.     BANIAS(1600),
  192.     BANIAS(1700),
  193.  
  194. +   DOTHAN(&cpu_ids[CPU_DOTHAN_B0], 1500, "1.50"),
  195. +   DOTHAN(&cpu_ids[CPU_DOTHAN_B0], 1600, "1.60"),
  196. +   DOTHAN(&cpu_ids[CPU_DOTHAN_B0], 1700, "1.70"),
  197. +   DOTHAN(&cpu_ids[CPU_DOTHAN_B0], 1800, "1.80"),
  198. +   DOTHAN(&cpu_ids[CPU_DOTHAN_B0], 2000, "2.00"),
  199. +
  200. +        /* Builtin tables for Dothan C0 CPUs, a.k.a Sonoma */
  201. +        SONOMA(&cpu_ids[CPU_DOTHAN_C0], 1596, 133, "1.60"),
  202. +        SONOMA(&cpu_ids[CPU_DOTHAN_C0], 1729, 133, "1.73"),
  203. +        SONOMA(&cpu_ids[CPU_DOTHAN_C0], 1862, 133, "1.86"),
  204. +        SONOMA(&cpu_ids[CPU_DOTHAN_C0], 1995, 133, "2.00"),
  205. +        SONOMA(&cpu_ids[CPU_DOTHAN_C0], 2128, 133, "2.13"),
  206. +        SONOMA(&cpu_ids[CPU_DOTHAN_C0], 2261, 133, "2.26"),
  207. +
  208. +
  209.     /* NULL model_name is a wildcard */
  210.     { &cpu_ids[CPU_DOTHAN_A1], NULL, 0, NULL },
  211.     { &cpu_ids[CPU_DOTHAN_A2], NULL, 0, NULL },
  212. @@ -229,6 +410,8 @@
  213.  };
  214.  #undef _BANIAS
  215.  #undef BANIAS
  216. +#undef DOTHAN
  217. +#undef SONOMA
  218.  
  219.  static int centrino_cpu_init_table(struct cpufreq_policy *policy)
  220.  {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement