diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-08-15 04:58:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-15 14:50:15 -0400 |
commit | cebd7709d396b59ff53b95fa3c4d9febbd4c010f (patch) | |
tree | f9a91fd48867990f80f7ac5c8faeb7b66e3ad544 /drivers/hwmon/hwmon-vid.c | |
parent | cd98a04a59e2f94fa64d5bf1e26498d27427d5e7 (diff) |
hwmon-vid: Fix AMD K8 VID decoding
Not all AMD K8 have 6 VID pins, contrary to what was assumed in
commit 116d0486bdefc11f71e567cadf0c47f788b4dd06. This commit broke
support of older CPU models which have only 5 VID pins:
http://bugzilla.kernel.org/show_bug.cgi?id=11329
We need two entries in the hwmon-vid table, one for 5-bit VID models
(K8 revision <= E) and one for 6-bit VID models (K8 revision >= F).
This fixes bug #11329.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Frank Myhr <fmyhr@fhmtech.com>
Tested-by: Jean-Luc Coulon <jean.luc.coulon@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon/hwmon-vid.c')
-rw-r--r-- | drivers/hwmon/hwmon-vid.c | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index 7b0a32c4dcf..c54eff92be4 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c | |||
@@ -37,13 +37,21 @@ | |||
37 | * For VRD 10.0 and up, "VRD x.y Design Guide", | 37 | * For VRD 10.0 and up, "VRD x.y Design Guide", |
38 | * available at http://developer.intel.com/. | 38 | * available at http://developer.intel.com/. |
39 | * | 39 | * |
40 | * AMD NPT 0Fh (Athlon64 & Opteron), AMD Publication 32559, | 40 | * AMD Athlon 64 and AMD Opteron Processors, AMD Publication 26094, |
41 | * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/26094.PDF | ||
42 | * Table 74. VID Code Voltages | ||
43 | * This corresponds to an arbitrary VRM code of 24 in the functions below. | ||
44 | * These CPU models (K8 revision <= E) have 5 VID pins. See also: | ||
45 | * Revision Guide for AMD Athlon 64 and AMD Opteron Processors, AMD Publication 25759, | ||
46 | * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25759.pdf | ||
47 | * | ||
48 | * AMD NPT Family 0Fh Processors, AMD Publication 32559, | ||
41 | * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf | 49 | * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf |
42 | * Table 71. VID Code Voltages | 50 | * Table 71. VID Code Voltages |
43 | * AMD Opteron processors don't follow the Intel specifications. | 51 | * This corresponds to an arbitrary VRM code of 25 in the functions below. |
44 | * I'm going to "make up" 2.4 as the spec number for the Opterons. | 52 | * These CPU models (K8 revision >= F) have 6 VID pins. See also: |
45 | * No good reason just a mnemonic for the 24x Opteron processor | 53 | * Revision Guide for AMD NPT Family 0Fh Processors, AMD Publication 33610, |
46 | * series. | 54 | * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/33610.pdf |
47 | * | 55 | * |
48 | * The 17 specification is in fact Intel Mobile Voltage Positioning - | 56 | * The 17 specification is in fact Intel Mobile Voltage Positioning - |
49 | * (IMVP-II). You can find more information in the datasheet of Max1718 | 57 | * (IMVP-II). You can find more information in the datasheet of Max1718 |
@@ -95,7 +103,12 @@ int vid_from_reg(int val, u8 vrm) | |||
95 | return 0; | 103 | return 0; |
96 | return((1600000 - (val - 2) * 6250 + 500) / 1000); | 104 | return((1600000 - (val - 2) * 6250 + 500) / 1000); |
97 | 105 | ||
98 | case 24: /* AMD NPT 0Fh (Athlon64 & Opteron) */ | 106 | case 24: /* Athlon64 & Opteron */ |
107 | val &= 0x1f; | ||
108 | if (val == 0x1f) | ||
109 | return 0; | ||
110 | /* fall through */ | ||
111 | case 25: /* AMD NPT 0Fh */ | ||
99 | val &= 0x3f; | 112 | val &= 0x3f; |
100 | return (val < 32) ? 1550 - 25 * val | 113 | return (val < 32) ? 1550 - 25 * val |
101 | : 775 - (25 * (val - 31)) / 2; | 114 | : 775 - (25 * (val - 31)) / 2; |
@@ -157,11 +170,16 @@ struct vrm_model { | |||
157 | 170 | ||
158 | #ifdef CONFIG_X86 | 171 | #ifdef CONFIG_X86 |
159 | 172 | ||
160 | /* the stepping parameter is highest acceptable stepping for current line */ | 173 | /* |
174 | * The stepping parameter is highest acceptable stepping for current line. | ||
175 | * The model match must be exact for 4-bit values. For model values 0x10 | ||
176 | * and above (extended model), all models below the parameter will match. | ||
177 | */ | ||
161 | 178 | ||
162 | static struct vrm_model vrm_models[] = { | 179 | static struct vrm_model vrm_models[] = { |
163 | {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ | 180 | {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ |
164 | {X86_VENDOR_AMD, 0xF, ANY, ANY, 24}, /* Athlon 64, Opteron and above VRM 24 */ | 181 | {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24}, /* Athlon 64, Opteron */ |
182 | {X86_VENDOR_AMD, 0xF, ANY, ANY, 25}, /* NPT family 0Fh */ | ||
165 | {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ | 183 | {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ |
166 | {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ | 184 | {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ |
167 | {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ | 185 | {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ |
@@ -189,6 +207,8 @@ static u8 find_vrm(u8 eff_family, u8 eff_model, u8 eff_stepping, u8 vendor) | |||
189 | if (vrm_models[i].vendor==vendor) | 207 | if (vrm_models[i].vendor==vendor) |
190 | if ((vrm_models[i].eff_family==eff_family) | 208 | if ((vrm_models[i].eff_family==eff_family) |
191 | && ((vrm_models[i].eff_model==eff_model) || | 209 | && ((vrm_models[i].eff_model==eff_model) || |
210 | (vrm_models[i].eff_model >= 0x10 && | ||
211 | eff_model <= vrm_models[i].eff_model) || | ||
192 | (vrm_models[i].eff_model==ANY)) && | 212 | (vrm_models[i].eff_model==ANY)) && |
193 | (eff_stepping <= vrm_models[i].eff_stepping)) | 213 | (eff_stepping <= vrm_models[i].eff_stepping)) |
194 | return vrm_models[i].vrm_type; | 214 | return vrm_models[i].vrm_type; |