Subject: Re: Please test POWERNOW_K[78]
To: Eric Schnoebelen <eric@cirr.com>
From: Juan RP <juan@xtrarom.org>
List: port-amd64
Date: 09/02/2006 11:48:46
On Fri, 01 Sep 2006 18:14:45 -0500
eric@cirr.com (Eric Schnoebelen) wrote:

> - Can you please rebuild your kernel with "options POWERNOW_DEBUG"?
> 
> 	Done.  No additional output.. :(

Ok, I've found the problem... looks like AMD_ERRATA_A0_CPUSIG is not
matching your CPU and needs to match it because your CPU is the one
that has the errata.

Linux checks for a x86_mask member to see if it's a K7 660[A0] CPU, but I
don't know what x86_mask is, so I think the following patch should work too:


Index: x86/include/powernow.h
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/include/powernow.h,v
retrieving revision 1.5
diff -u -p -r1.5 powernow.h
--- x86/include/powernow.h      27 Aug 2006 10:10:55 -0000      1.5
+++ x86/include/powernow.h      2 Sep 2006 09:46:49 -0000
@@ -71,7 +71,8 @@
 #define MSR_AMDK7_FIDVID_CTL           0xc0010041
 #define MSR_AMDK7_FIDVID_STATUS                0xc0010042
 #define AMD_PN_FID_VID                 0x06
-#define AMD_ERRATA_A0_CPUSIG           0x660
+#define AMD_ERRATA_660_CPUSIG          0x660
+#define AMD_ERRATA_660A0_CPUSIG        0x6a0

 #define PN7_FLAG_ERRATA_A0             0x01
 #define PN7_FLAG_DESKTOP_VRM           0x02
Index: i386/i386/powernow_k7.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/powernow_k7.c,v
retrieving revision 1.17
diff -u -p -r1.17 powernow_k7.c
--- i386/i386/powernow_k7.c     24 Aug 2006 16:28:22 -0000      1.17
+++ i386/i386/powernow_k7.c     2 Sep 2006 09:46:49 -0000
@@ -324,7 +324,8 @@ k7_powernow_init(void)
        }

        k7pnow_flag = 0;
-       if (ci->ci_signature == AMD_ERRATA_A0_CPUSIG)
+       if (ci->ci_signature == AMD_ERRATA_660_CPUSIG ||
+           ci->ci_signature == AMD_ERRATA_660A0_CPUSIG)
                k7pnow_flag |= PN7_FLAG_ERRATA_A0;

        status = rdmsr(MSR_AMDK7_FIDVID_STATUS);