All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Myhr <fmyhr@fhmtech.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH 2/2] hwmon (hwmon-vid): add 6-bit vid codes for
Date: Thu, 12 Jun 2008 02:45:02 +0000	[thread overview]
Message-ID: <48508DAE.8040401@fhmtech.com> (raw)

AMD NPT 0Fh cpus use 6 bit VID codes. Successive codes with msb 0
describe 25mV decrements, while those with msb 1 describe 12.5mV decrements.
Existing hwmon-vid.c is correct only for codes with msb 0; this patch adds
support for the codes with msb 1.

Ref:
p 309, Table 71
AMD Publication 32559, BIOS and Kernel Developer's Guide for AMD NPT Family 0Fh Processors
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf

Signed-off-by: Frank Myhr <fmyhr@fhmtech.com>
---

--- linux-2.6.26-rc5_before/drivers/hwmon/hwmon-vid.c   2008-06-11 18:09:26.000000000 -0400
+++ linux-2.6.26-rc5_after/drivers/hwmon/hwmon-vid.c    2008-06-11 18:35:55.000000000 -0400
@@ -37,17 +37,26 @@
  * For VRD 10.0 and up, "VRD x.y Design Guide",
  * available at http://developer.intel.com/.
  *
+ * AMD NPT 0Fh (Athlon64 & Opteron), AMD Publication 32559,
+ * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
  * AMD Opteron processors don't follow the Intel specifications.
  * I'm going to "make up" 2.4 as the spec number for the Opterons.
  * No good reason just a mnemonic for the 24x Opteron processor
  * series.
  *
- * Opteron VID encoding is:
- *    00000  =  1.550 V
- *    00001  =  1.525 V
- *     . . . .
- *    11110  =  0.800 V
- *    11111  =  0.000 V (off)
+ * AMD NPT 0Fh VID encoding is:
+ *     VID[5:0]    Voltage [V]  Delta [mV]
+ *     --------    -----------  ---------
+ *     00 0000         1.550
+ *     00 0001         1.525   -25
+ *     . . . .
+ *     01 1110         0.800
+ *     01 1111         0.775   -25
+ *     10 0000         0.7625  -12.5
+ *     10 0001         0.7500  -12.5
+ *     . . . .
+ *     11 1110         0.3875
+ *     11 1111         0.3750  -12.5
  *
  * The 17 specification is in fact Intel Mobile Voltage Positioning -
  * (IMVP-II). You can find more information in the datasheet of Max1718
@@ -98,9 +107,11 @@ int vid_from_reg(int val, u8 vrm)
                if (val < 0x02 || val > 0xb2)
                        return 0;
                return((1600000 - (val - 2) * 6250 + 500) / 1000);
-       case 24:                /* Opteron processor */
-               val &= 0x1f;
-               return(val = 0x1f ? 0 : 1550 - val * 25);
+
+       case 24:                /* AMD NPT 0Fh (Athlon64 & Opteron) */
+               val &= 0x3f;
+               return((val < 32) ? 1550 - 25 * val
+                       : 775 - (25 * (val - 31)) / 2);

        case 91:                /* VRM 9.1 */
        case 90:                /* VRM 9.0 */


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

             reply	other threads:[~2008-06-12  2:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12  2:45 Frank Myhr [this message]
2008-06-16  8:47 ` [lm-sensors] [PATCH 2/2] hwmon (hwmon-vid): add 6-bit vid codes Jean Delvare
2008-06-23 16:06 ` Frank Myhr
2008-06-23 16:18 ` Jean Delvare
2008-08-14 11:43 ` Jean Delvare
2008-08-14 23:59 ` Frank Myhr
2008-08-15  7:48 ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48508DAE.8040401@fhmtech.com \
    --to=fmyhr@fhmtech.com \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.