diff options
Diffstat (limited to 'drivers/hwmon/hwmon-vid.c')
-rw-r--r-- | drivers/hwmon/hwmon-vid.c | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index a74a44f16f51..a6764ff00803 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c | |||
@@ -58,11 +58,20 @@ | |||
58 | doesn't seem to be any named specification for these. The conversion | 58 | doesn't seem to be any named specification for these. The conversion |
59 | tables are detailed directly in the various Pentium M datasheets: | 59 | tables are detailed directly in the various Pentium M datasheets: |
60 | http://www.intel.com/design/intarch/pentiumm/docs_pentiumm.htm | 60 | http://www.intel.com/design/intarch/pentiumm/docs_pentiumm.htm |
61 | |||
62 | The 14 specification corresponds to Intel Core series. There | ||
63 | doesn't seem to be any named specification for these. The conversion | ||
64 | tables are detailed directly in the various Pentium Core datasheets: | ||
65 | http://www.intel.com/design/mobile/datashts/309221.htm | ||
66 | |||
67 | The 110 (VRM 11) specification corresponds to Intel Conroe based series. | ||
68 | http://www.intel.com/design/processor/applnots/313214.htm | ||
61 | */ | 69 | */ |
62 | 70 | ||
63 | /* vrm is the VRM/VRD document version multiplied by 10. | 71 | /* vrm is the VRM/VRD document version multiplied by 10. |
64 | val is the 4-, 5- or 6-bit VID code. | 72 | val is the 4-bit or more VID code. |
65 | Returned value is in mV to avoid floating point in the kernel. */ | 73 | Returned value is in mV to avoid floating point in the kernel. |
74 | Some VID have some bits in uV scale, this is rounded to mV */ | ||
66 | int vid_from_reg(int val, u8 vrm) | 75 | int vid_from_reg(int val, u8 vrm) |
67 | { | 76 | { |
68 | int vid; | 77 | int vid; |
@@ -70,26 +79,36 @@ int vid_from_reg(int val, u8 vrm) | |||
70 | switch(vrm) { | 79 | switch(vrm) { |
71 | 80 | ||
72 | case 100: /* VRD 10.0 */ | 81 | case 100: /* VRD 10.0 */ |
82 | /* compute in uV, round to mV */ | ||
83 | val &= 0x3f; | ||
73 | if((val & 0x1f) == 0x1f) | 84 | if((val & 0x1f) == 0x1f) |
74 | return 0; | 85 | return 0; |
75 | if((val & 0x1f) <= 0x09 || val == 0x0a) | 86 | if((val & 0x1f) <= 0x09 || val == 0x0a) |
76 | vid = 10875 - (val & 0x1f) * 250; | 87 | vid = 1087500 - (val & 0x1f) * 25000; |
77 | else | 88 | else |
78 | vid = 18625 - (val & 0x1f) * 250; | 89 | vid = 1862500 - (val & 0x1f) * 25000; |
79 | if(val & 0x20) | 90 | if(val & 0x20) |
80 | vid -= 125; | 91 | vid -= 12500; |
81 | vid /= 10; /* only return 3 dec. places for now */ | 92 | return((vid + 500) / 1000); |
82 | return vid; | ||
83 | 93 | ||
94 | case 110: /* Intel Conroe */ | ||
95 | /* compute in uV, round to mV */ | ||
96 | val &= 0xff; | ||
97 | if(((val & 0x7e) == 0xfe) || (!(val & 0x7e))) | ||
98 | return 0; | ||
99 | return((1600000 - (val - 2) * 6250 + 500) / 1000); | ||
84 | case 24: /* Opteron processor */ | 100 | case 24: /* Opteron processor */ |
101 | val &= 0x1f; | ||
85 | return(val == 0x1f ? 0 : 1550 - val * 25); | 102 | return(val == 0x1f ? 0 : 1550 - val * 25); |
86 | 103 | ||
87 | case 91: /* VRM 9.1 */ | 104 | case 91: /* VRM 9.1 */ |
88 | case 90: /* VRM 9.0 */ | 105 | case 90: /* VRM 9.0 */ |
106 | val &= 0x1f; | ||
89 | return(val == 0x1f ? 0 : | 107 | return(val == 0x1f ? 0 : |
90 | 1850 - val * 25); | 108 | 1850 - val * 25); |
91 | 109 | ||
92 | case 85: /* VRM 8.5 */ | 110 | case 85: /* VRM 8.5 */ |
111 | val &= 0x1f; | ||
93 | return((val & 0x10 ? 25 : 0) + | 112 | return((val & 0x10 ? 25 : 0) + |
94 | ((val & 0x0f) > 0x04 ? 2050 : 1250) - | 113 | ((val & 0x0f) > 0x04 ? 2050 : 1250) - |
95 | ((val & 0x0f) * 50)); | 114 | ((val & 0x0f) * 50)); |
@@ -98,14 +117,21 @@ int vid_from_reg(int val, u8 vrm) | |||
98 | val &= 0x0f; | 117 | val &= 0x0f; |
99 | /* fall through */ | 118 | /* fall through */ |
100 | case 82: /* VRM 8.2 */ | 119 | case 82: /* VRM 8.2 */ |
120 | val &= 0x1f; | ||
101 | return(val == 0x1f ? 0 : | 121 | return(val == 0x1f ? 0 : |
102 | val & 0x10 ? 5100 - (val) * 100 : | 122 | val & 0x10 ? 5100 - (val) * 100 : |
103 | 2050 - (val) * 50); | 123 | 2050 - (val) * 50); |
104 | case 17: /* Intel IMVP-II */ | 124 | case 17: /* Intel IMVP-II */ |
125 | val &= 0x1f; | ||
105 | return(val & 0x10 ? 975 - (val & 0xF) * 25 : | 126 | return(val & 0x10 ? 975 - (val & 0xF) * 25 : |
106 | 1750 - val * 50); | 127 | 1750 - val * 50); |
107 | case 13: | 128 | case 13: |
108 | return(1708 - (val & 0x3f) * 16); | 129 | val &= 0x3f; |
130 | return(1708 - val * 16); | ||
131 | case 14: /* Intel Core */ | ||
132 | /* compute in uV, round to mV */ | ||
133 | val &= 0x7f; | ||
134 | return(val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000); | ||
109 | default: /* report 0 for unknown */ | 135 | default: /* report 0 for unknown */ |
110 | printk(KERN_INFO "hwmon-vid: requested unknown VRM version\n"); | 136 | printk(KERN_INFO "hwmon-vid: requested unknown VRM version\n"); |
111 | return 0; | 137 | return 0; |
@@ -138,6 +164,8 @@ static struct vrm_model vrm_models[] = { | |||
138 | {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ | 164 | {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ |
139 | {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ | 165 | {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ |
140 | {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ | 166 | {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ |
167 | {X86_VENDOR_INTEL, 0x6, 0xE, ANY, 14}, /* Intel Core (65 nm) */ | ||
168 | {X86_VENDOR_INTEL, 0x6, 0xF, ANY, 110}, /* Intel Conroe */ | ||
141 | {X86_VENDOR_INTEL, 0x6, ANY, ANY, 82}, /* any P6 */ | 169 | {X86_VENDOR_INTEL, 0x6, ANY, ANY, 82}, /* any P6 */ |
142 | {X86_VENDOR_INTEL, 0x7, ANY, ANY, 0}, /* Itanium */ | 170 | {X86_VENDOR_INTEL, 0x7, ANY, ANY, 0}, /* Itanium */ |
143 | {X86_VENDOR_INTEL, 0xF, 0x0, ANY, 90}, /* P4 */ | 171 | {X86_VENDOR_INTEL, 0xF, 0x0, ANY, 90}, /* P4 */ |