All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Provide support for 6 bit FID codes
@ 2005-06-23 22:39 Langsdorf, Mark
  2005-07-29  3:08 ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Langsdorf, Mark @ 2005-06-23 22:39 UTC (permalink / raw)
  To: cpufreq

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

Opteron revision F will support higher frequencies than
can be encoded in the current driver's 4 bit frequency
field.  This patch updates the driver to support Rev F
including 6 bit FIDs and processor ID updates.

This should apply cleanly whether or not the dual-core
bugfix I sent out last week is applied.  I'd prefer 
that both get applied, of course.

Signed-off-by: David Keck <david.keck@amd.com>
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>

-Mark Langsdorf
AMD, Inc.

[-- Attachment #2: rfpn-2.6.12.patch --]
[-- Type: application/octet-stream, Size: 6638 bytes --]

--- linux-2.6.12.1/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2005-06-22 14:33:05.000000000 -0500
+++ linux-rfpn/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2005-06-23 17:41:59.000000000 -0500
@@ -1,5 +1,5 @@
 /*
- *   (c) 2003, 2004 Advanced Micro Devices, Inc.
+ *   (c) 2003, 2004, 2005 Advanced Micro Devices, Inc.
  *  Your use of this code is subject to the terms and conditions of the
  *  GNU general public license version 2. See "COPYING" or
  *  http://www.gnu.org/licenses/gpl.html
@@ -44,7 +44,7 @@
 
 #define PFX "powernow-k8: "
 #define BFX PFX "BIOS error: "
-#define VERSION "version 1.40.2"
+#define VERSION "version 1.50.3"
 #include "powernow-k8.h"
 
 /* serialize freq changes  */
@@ -232,7 +232,7 @@
 /*
  * Reduce the vid by the max of step or reqvid.
  * Decreasing vid codes represent increasing voltages:
- * vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of 0x1f is off.
+ * vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of VID_OFF is off.
  */
 static int decrease_vid_code_by_step(struct powernow_k8_data *data, u32 reqvid, u32 step)
 {
@@ -467,7 +467,7 @@
 	eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
 	if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
 	    ((eax & CPUID_XFAM) != CPUID_XFAM_K8) ||
-	    ((eax & CPUID_XMOD) > CPUID_XMOD_REV_E)) {
+	    ((eax & CPUID_XMOD) > CPUID_XMOD_REV_F)) {
 		printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax);
 		goto out;
 	}
@@ -696,6 +696,7 @@
 
 	data->irt = (data->acpi_data.states[index].control >> IRT_SHIFT) & IRT_MASK;
 	data->rvo = (data->acpi_data.states[index].control >> RVO_SHIFT) & RVO_MASK;
+	data->exttype = (data->acpi_data.states[index].control >> EXT_TYPE_SHIFT) & EXT_TYPE_MASK;
 	data->plllock = (data->acpi_data.states[index].control >> PLL_L_SHIFT) & PLL_L_MASK;
 	data->vidmvs = 1 << ((data->acpi_data.states[index].control >> MVS_SHIFT) & MVS_MASK);
 	data->vstable = (data->acpi_data.states[index].control >> VST_SHIFT) & VST_MASK;
@@ -735,8 +736,13 @@
 	}
 
 	for (i = 0; i < data->acpi_data.state_count; i++) {
-		u32 fid = data->acpi_data.states[i].control & FID_MASK;
-		u32 vid = (data->acpi_data.states[i].control >> VID_SHIFT) & VID_MASK;
+	    	if (data->exttype) {
+		    	u32 fid = data->acpi_data.states[i].status & FID_MASK;
+			u32 vid = (data->acpi_data.states[i].status >> VID_SHIFT) & VID_MASK;
+		} else {
+		    	u32 fid = data->acpi_data.states[i].control & FID_MASK;
+			u32 vid = (data->acpi_data.states[i].control >> VID_SHIFT) & VID_MASK;
+		}
 
 		dprintk("   %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
 
@@ -753,7 +759,7 @@
 		}
 
 		/* verify voltage is OK - BIOSs are using "off" to indicate invalid */
-		if (vid == 0x1f) {
+		if (vid == VID_OFF) {
 			dprintk("invalid vid %u, ignoring\n", vid);
 			powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
 			continue;
@@ -930,15 +936,6 @@
 
 	down(&fidvid_sem);
 
-	for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
-		/* make sure the sibling is initialized */
-		if (!powernow_data[i]) {
-                        ret = 0;
-                        up(&fidvid_sem);
-                        goto err_out;
-                }
-	}
-
 	powernow_k8_acpi_pst_values(data, newstate);
 
 	if (transition_frequency(data, newstate)) {
--- linux-2.6.12.1/arch/i386/kernel/cpu/cpufreq/powernow-k8.h	2005-06-22 14:33:05.000000000 -0500
+++ linux-rfpn/arch/i386/kernel/cpu/cpufreq/powernow-k8.h	2005-06-23 17:44:10.000000000 -0500
@@ -1,5 +1,5 @@
 /*
- *  (c) 2003, 2004 Advanced Micro Devices, Inc.
+ *  (c) 2003, 2004, 2005 Advanced Micro Devices, Inc.
  *  Your use of this code is subject to the terms and conditions of the
  *  GNU general public license version 2. See "COPYING" or
  *  http://www.gnu.org/licenses/gpl.html
@@ -19,6 +19,7 @@
 	u32 vidmvs;  /* usable value calculated from mvs */
 	u32 vstable; /* voltage stabilization time, units 20 us */
 	u32 plllock; /* pll lock time, units 1 us */
+        u32 exttype; /* extended interface = 1 */
 
 	/* keep track of the current fid / vid */
 	u32 currvid, currfid;
@@ -41,7 +42,7 @@
 #define CPUID_XFAM			0x0ff00000	/* extended family */
 #define CPUID_XFAM_K8			0
 #define CPUID_XMOD			0x000f0000	/* extended model */
-#define CPUID_XMOD_REV_E		0x00020000
+#define CPUID_XMOD_REV_F		0x00040000
 #define CPUID_USE_XFAM_XMOD		0x00000f00
 #define CPUID_GET_MAX_CAPABILITIES	0x80000000
 #define CPUID_FREQ_VOLT_CAPABILITIES	0x80000007
@@ -57,25 +58,26 @@
 
 /* Field definitions within the FID VID Low Control MSR : */
 #define MSR_C_LO_INIT_FID_VID     0x00010000
-#define MSR_C_LO_NEW_VID          0x00001f00
-#define MSR_C_LO_NEW_FID          0x0000002f
+#define MSR_C_LO_NEW_VID          0x00003f00
+#define MSR_C_LO_NEW_FID          0x0000003f
 #define MSR_C_LO_VID_SHIFT        8
 
 /* Field definitions within the FID VID High Control MSR : */
-#define MSR_C_HI_STP_GNT_TO       0x000fffff
+#define MSR_C_HI_STP_GNT_TO 	  0x000fffff
 
 /* Field definitions within the FID VID Low Status MSR : */
-#define MSR_S_LO_CHANGE_PENDING   0x80000000	/* cleared when completed */
-#define MSR_S_LO_MAX_RAMP_VID     0x1f000000
+#define MSR_S_LO_CHANGE_PENDING   0x80000000   /* cleared when completed */
+#define MSR_S_LO_MAX_RAMP_VID     0x3f000000
 #define MSR_S_LO_MAX_FID          0x003f0000
 #define MSR_S_LO_START_FID        0x00003f00
 #define MSR_S_LO_CURRENT_FID      0x0000003f
 
 /* Field definitions within the FID VID High Status MSR : */
-#define MSR_S_HI_MAX_WORKING_VID  0x001f0000
-#define MSR_S_HI_START_VID        0x00001f00
-#define MSR_S_HI_CURRENT_VID      0x0000001f
-#define MSR_C_HI_STP_GNT_BENIGN   0x00000001
+#define MSR_S_HI_MIN_WORKING_VID  0x3f000000
+#define MSR_S_HI_MAX_WORKING_VID  0x003f0000
+#define MSR_S_HI_START_VID        0x00003f00
+#define MSR_S_HI_CURRENT_VID      0x0000003f
+#define MSR_C_HI_STP_GNT_BENIGN	  0x00000001
 
 /*
  * There are restrictions frequencies have to follow:
@@ -99,13 +101,15 @@
 #define MIN_FREQ_RESOLUTION  200 /* fids jump by 2 matching freq jumps by 200 */
 
 #define MAX_FID 0x2a	/* Spec only gives FID values as far as 5 GHz */
-#define LEAST_VID 0x1e	/* Lowest (numerically highest) useful vid value */
+#define LEAST_VID 0x3e	/* Lowest (numerically highest) useful vid value */
 
 #define MIN_FREQ 800	/* Min and max freqs, per spec */
 #define MAX_FREQ 5000
 
 #define INVALID_FID_MASK 0xffffffc1  /* not a valid fid if these bits are set */
-#define INVALID_VID_MASK 0xffffffe0  /* not a valid vid if these bits are set */
+#define INVALID_VID_MASK 0xffffffc0  /* not a valid vid if these bits are set */
+
+#define VID_OFF 0x3f
 
 #define STOP_GRANT_5NS 1 /* min poss memory access latency for voltage change */
 

[-- Attachment #3: Type: text/plain, Size: 147 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] Provide support for 6 bit FID codes
  2005-06-23 22:39 Langsdorf, Mark
@ 2005-07-29  3:08 ` Dave Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Jones @ 2005-07-29  3:08 UTC (permalink / raw)
  To: Langsdorf, Mark; +Cc: cpufreq

On Thu, Jun 23, 2005 at 05:39:04PM -0500, Langsdorf, Mark wrote:
 > Opteron revision F will support higher frequencies than
 > can be encoded in the current driver's 4 bit frequency
 > field.  This patch updates the driver to support Rev F
 > including 6 bit FIDs and processor ID updates.
 > 
 > This should apply cleanly whether or not the dual-core
 > bugfix I sent out last week is applied.  I'd prefer 
 > that both get applied, of course.
 > 
 > Signed-off-by: David Keck <david.keck@amd.com>
 > Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
 > 
 > -Mark Langsdorf
 > AMD, Inc.

arch/i386/kernel/cpu/cpufreq/powernow-k8.c: In function `powernow_k8_acpi_pst_values':
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:698: `EXT_TYPE_SHIFT' undeclared (first use in this function)
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:698: (Each undeclared identifier is reported only once
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:698: for each function it appears in.)
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:698: `EXT_TYPE_MASK' undeclared (first use in this function)
arch/i386/kernel/cpu/cpufreq/powernow-k8.c: In function `powernow_k8_cpu_init_acpi':
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:740: warning: unused variable `vid'
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:739: warning: unused variable `fid'
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:743: warning: unused variable `vid'
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:742: warning: unused variable `fid'
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:746: `fid' undeclared (first use in this function)
arch/i386/kernel/cpu/cpufreq/powernow-k8.c:746: `vid' undeclared (first use in this function)
make[1]: *** [arch/i386/kernel/cpu/cpufreq/powernow-k8.o] Error 1
make: *** [arch/i386/kernel/cpu/cpufreq/powernow-k8.o] Error 2

Looks like there's a chunk of this missing ? Can you send an incremental
fixing this up please ?  I'll leave the previous diff in the cpufreq git
tree, and just send the fix along with it when Linus pulls.

Thanks,

		Dave

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] Provide support for 6 bit FID codes
@ 2005-07-29 15:16 Langsdorf, Mark
  2005-07-29 16:58 ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Langsdorf, Mark @ 2005-07-29 15:16 UTC (permalink / raw)
  To: Dave Jones; +Cc: cpufreq

[-- Attachment #1: Type: text/plain, Size: 2441 bytes --]



> -----Original Message-----
> From: Dave Jones [mailto:davej@redhat.com] 
> Sent: Thursday, July 28, 2005 10:08 PM
> To: Langsdorf, Mark
> Cc: cpufreq@lists.linux.org.uk
> Subject: Re: [PATCH 1/1] Provide support for 6 bit FID codes
> 
> 
> On Thu, Jun 23, 2005 at 05:39:04PM -0500, Langsdorf, Mark 
> wrote:  > Opteron revision F will support higher frequencies 
> than  > can be encoded in the current driver's 4 bit 
> frequency  > field.  This patch updates the driver to support 
> Rev F  > including 6 bit FIDs and processor ID updates.  > 
>  > This should apply cleanly whether or not the dual-core
>  > bugfix I sent out last week is applied.  I'd prefer 
>  > that both get applied, of course.
>  > 
>  > Signed-off-by: David Keck <david.keck@amd.com>
>  > Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
>  > 
>  > -Mark Langsdorf
>  > AMD, Inc.
> 
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c: In function 
> `powernow_k8_acpi_pst_values':
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:698: 
> `EXT_TYPE_SHIFT' undeclared (first use in this function)
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:698: (Each 
> undeclared identifier is reported only once
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:698: for each 
> function it appears in.)
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:698: 
> `EXT_TYPE_MASK' undeclared (first use in this function)
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c: In function 
> `powernow_k8_cpu_init_acpi':
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:740: warning: 
> unused variable `vid'
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:739: warning: 
> unused variable `fid'
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:743: warning: 
> unused variable `vid'
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:742: warning: 
> unused variable `fid'
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:746: `fid' 
> undeclared (first use in this function)
> arch/i386/kernel/cpu/cpufreq/powernow-k8.c:746: `vid' 
> undeclared (first use in this function)
> make[1]: *** [arch/i386/kernel/cpu/cpufreq/powernow-k8.o] Error 1
> make: *** [arch/i386/kernel/cpu/cpufreq/powernow-k8.o] Error 2
> 
> Looks like there's a chunk of this missing ? Can you send an 
> incremental fixing this up please ?  I'll leave the previous 
> diff in the cpufreq git tree, and just send the fix along 
> with it when Linus pulls.
> 
> Thanks,
> 
> 		Dave
> 
> 

[-- Attachment #2: rfpn2-2.6.12.patch --]
[-- Type: application/octet-stream, Size: 668 bytes --]

--- linux-rfpn/arch/i386/kernel/cpu/cpufreq/powernow-k8.h.orig	2005-07-15 00:12:08.000000000 -0600
+++ linux-rfpn/arch/i386/kernel/cpu/cpufreq/powernow-k8.h	2005-07-15 00:14:52.000000000 -0600
@@ -125,12 +125,14 @@
                                                                                                     
 #define IRT_SHIFT      30
 #define RVO_SHIFT      28
+#define EXT_TYPE_SHIFT 27
 #define PLL_L_SHIFT    20
 #define MVS_SHIFT      18
 #define VST_SHIFT      11
 #define VID_SHIFT       6
 #define IRT_MASK        3
 #define RVO_MASK        3
+#define EXT_TYPE_MASK   1
 #define PLL_L_MASK   0x7f
 #define MVS_MASK        3
 #define VST_MASK     0x7f

[-- Attachment #3: Type: text/plain, Size: 147 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] Provide support for 6 bit FID codes
  2005-07-29 15:16 [PATCH 1/1] Provide support for 6 bit FID codes Langsdorf, Mark
@ 2005-07-29 16:58 ` Dave Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Jones @ 2005-07-29 16:58 UTC (permalink / raw)
  To: Langsdorf, Mark; +Cc: cpufreq

On Fri, Jul 29, 2005 at 10:16:35AM -0500, Langsdorf, Mark wrote:

 > > Looks like there's a chunk of this missing ? Can you send an 
 > > incremental fixing this up please ?  I'll leave the previous 
 > > diff in the cpufreq git tree, and just send the fix along 
 > > with it when Linus pulls.
 > > 

Thanks Mark,  applied to cpufreq-git, and req sent to Linus to pull.

		Dave

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-29 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-29 15:16 [PATCH 1/1] Provide support for 6 bit FID codes Langsdorf, Mark
2005-07-29 16:58 ` Dave Jones
  -- strict thread matches above, loose matches on Subject: below --
2005-06-23 22:39 Langsdorf, Mark
2005-07-29  3:08 ` Dave Jones

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.