All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] sensor details for W83627HG-AW
Date: Mon, 20 Jun 2011 18:00:34 +0000	[thread overview]
Message-ID: <20110620200034.29685c8b@endymion.delvare> (raw)
In-Reply-To: <838315.8004.qm@web95806.mail.in.yahoo.com>

Hi Krunal,

On Sat, 4 Jun 2011 13:08:18 +0200, Jean Delvare wrote:
> Brilly, Kary, can you help us here, please? Where can we get the VID pin
> codes -> Vcore voltage conversion table for VIA CPU family 6, model 13?
> This is needed to update drivers/hwmon/hwmon-vid.c.

I received information from VIA and was able to update hwmon-vid to
support your CPU. Patch below. I couldn't test it as I don't have the
hardware. I've also made the modified hwmon-vid driver available as a
standalone driver at:
  http://khali.linux-fr.org/devel/misc/hwmon-vid/
with instructions at:
  http://khali.linux-fr.org/devel/misc/INSTALL

Please test if you can, and report.


From: Jean Delvare <khali@linux-fr.org>
Subject: hwmon-vid: Add support for VIA C7-D

The VIA C7-D CPU (Eden 90 nm) can use two different VID tables, we
have to check the value of a MSR to decide which one to use.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/hwmon/hwmon-vid.c |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

--- linux-3.0-rc3.orig/drivers/hwmon/hwmon-vid.c	2011-06-20 13:43:24.000000000 +0200
+++ linux-3.0-rc3/drivers/hwmon/hwmon-vid.c	2011-06-20 17:58:18.000000000 +0200
@@ -206,10 +206,30 @@ static struct vrm_model vrm_models[] = {
 	{X86_VENDOR_CENTAUR, 0x6, 0x9, ANY, 17},	/* C3-M, Eden-N */
 	{X86_VENDOR_CENTAUR, 0x6, 0xA, 0x7, 0},		/* No information */
 	{X86_VENDOR_CENTAUR, 0x6, 0xA, ANY, 13},	/* C7, Esther */
+	{X86_VENDOR_CENTAUR, 0x6, 0xD, ANY, 134},	/* C7-D, Eden (90 nm) */
 
 	{X86_VENDOR_UNKNOWN, ANY, ANY, ANY, 0}		/* stop here */
 };
 
+/*
+ * Special case for VIA C7-D: there are two different possible
+ * VID tables, so we have to figure out first, which one must
+ * be used.
+ */
+static u8 get_via_c7d_vrm(void)
+{
+	unsigned int eax, edx;
+
+	rdmsr(0x198, eax, edx);
+	if ((edx & 0xff) > 0x3f) {
+		pr_info("Using %d-bit VID table for VIA C7-D CPU\n", 7);
+		return 14;
+	} else {
+		pr_info("Using %d-bit VID table for VIA C7-D CPU\n", 6);
+		return 13;
+	}
+}
+
 static u8 find_vrm(u8 eff_family, u8 eff_model, u8 eff_stepping, u8 vendor)
 {
 	int i = 0;
@@ -249,6 +269,9 @@ u8 vid_which_vrm(void)
 	vrm_ret = find_vrm(eff_family, eff_model, eff_stepping, c->x86_vendor);
 	if (vrm_ret = 0)
 		pr_info("Unknown VRM version of your x86 CPU\n");
+	if (vrm_ret = 134)
+		vrm_ret = get_via_c7d_vrm();
+
 	return vrm_ret;
 }
 


-- 
Jean Delvare
http://khali.linux-fr.org/wishlist.html

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

  parent reply	other threads:[~2011-06-20 18:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-03  6:13 [lm-sensors] sensor details for W83627HG-AW krunal patel
2011-06-04 11:08 ` Jean Delvare
2011-06-08  6:32 ` BrillyWu
2011-06-08  7:45 ` Jean Delvare
2011-06-09  2:41 ` BrillyWu
2011-06-09  8:21 ` Jean Delvare
2011-06-20 18:00 ` Jean Delvare [this message]
2011-06-21  7:22 ` krunal patel
2011-06-21 11:50 ` Jean Delvare
2011-06-21 11:59 ` Guenter Roeck
2011-06-22  8:23 ` krunal patel
2011-06-22  8:34 ` krunal patel
2011-06-22 16:00 ` Jean Delvare
2011-06-24 11:31 ` krunal patel
2011-06-27 15:02 ` Jean Delvare
2011-06-29  8:17 ` krunal patel
2011-06-30 12:20 ` Jean Delvare
2011-07-02 10:53 ` krunal patel
2011-07-03  7:14 ` 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=20110620200034.29685c8b@endymion.delvare \
    --to=khali@linux-fr.org \
    --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.