All of lore.kernel.org
 help / color / mirror / Atom feed
* powernow-k8 manual voltage selection ?
@ 2004-12-19  1:15 Nebojsa Trpkovic
  2004-12-20 14:12 ` Bruno Ducrot
  0 siblings, 1 reply; 5+ messages in thread
From: Nebojsa Trpkovic @ 2004-12-19  1:15 UTC (permalink / raw)
  To: cpufreq

Hello.

I just got my new box and I'm testing it all day long :)
It's Socket754 AMD Athlon (Newcastle) 3000+. I've spotted that it can run stable (>=1h in prime95) at voltages much lover than it's by default. Default is:
1.500V @2.0GHz
1.100V @1.0GHz
And my tests show something like this (I haven't tested all frequencies yet):
1.525V @2.5GHz
1.400V @2.4GHz
1.325V @2.3GHz
1.250V @2.2GHz
1.200V @2.1GHz
1.150V @2.0GHz  <---
1.075V @1.9GHz 
... and so on.

My question is: 
Is there some way (PATCH) to specify manualy voltages for every FID my CPU can run? 
I don't care if it's command line argument while loading powernow-k8 module or it's some kind of hack within powernow-k8.c source, as long as it works :)

Thank you.
Regards,
Nebojsa

P.S. Don't worry, I wouldn't use exact "minimum" voltage, but for example 1.200 - 1.250V @2.0GHz

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

* Re: powernow-k8 manual voltage selection ?
  2004-12-19  1:15 powernow-k8 manual voltage selection ? Nebojsa Trpkovic
@ 2004-12-20 14:12 ` Bruno Ducrot
  2004-12-20 15:48   ` Nebojsa Trpkovic
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Ducrot @ 2004-12-20 14:12 UTC (permalink / raw)
  To: Nebojsa Trpkovic; +Cc: cpufreq

Hi,

On Sun, Dec 19, 2004 at 04:15:31AM +0300, Nebojsa Trpkovic wrote:
> Hello.
> 
> I just got my new box and I'm testing it all day long :)
> It's Socket754 AMD Athlon (Newcastle) 3000+. I've spotted that it can run stable (>=1h in prime95) at voltages much lover than it's by default. Default is:
> 1.500V @2.0GHz
> 1.100V @1.0GHz
> And my tests show something like this (I haven't tested all frequencies yet):
> 1.525V @2.5GHz
> 1.400V @2.4GHz
> 1.325V @2.3GHz
> 1.250V @2.2GHz
> 1.200V @2.1GHz
> 1.150V @2.0GHz  <---
> 1.075V @1.9GHz 
> ... and so on.

How you have done this?  By powernow-k8 or via BIOS setting?  If the
latter, I will not trust this input yet. You can verify this is OK via
cpufrequtils at
http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-0.1.tar.bz2
then go to cpufrequtils-0.1/debug/x86_64 and issue a make, then ./powernow-k8-decode
as root.  You must have the msr kernel driver loaded to get it working.

> My question is: 
> Is there some way (PATCH) to specify manualy voltages for every FID my CPU can run? 

This has been discussed some times ago.  You have to do it yourself (or
maybe ask someone to give you some advice or browse the cpufreq archive,
etc).
Such patch will never reach mainline (but may be posted to this list for
reference purpose only).

Cheers,

-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

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

* Re: powernow-k8 manual voltage selection ?
  2004-12-20 14:12 ` Bruno Ducrot
@ 2004-12-20 15:48   ` Nebojsa Trpkovic
  2004-12-20 16:45     ` Bruno Ducrot
  0 siblings, 1 reply; 5+ messages in thread
From: Nebojsa Trpkovic @ 2004-12-20 15:48 UTC (permalink / raw)
  To: cpufreq

Bruno Ducrot wrote:

>How you have done this?  By powernow-k8 or via BIOS setting?  If the
>latter, I will not trust this input yet. You can verify this is OK via
>cpufrequtils at
>http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-0.1.tar.bz2
>then go to cpufrequtils-0.1/debug/x86_64 and issue a make, then ./powernow-k8-decode
>as root.  You must have the msr kernel driver loaded to get it working.
>  
>
I've done that by some software tool in window$ (I just didn't want to 
lock up system several times in my Gentoo :) ). By that tool (can't 
remember name) I was able to change multiplicators and voltages. I was 
monitoring voltages by other 2 tools and I could saw that my mobo 
overvolts CPU a little bit under heavy load, but it's about ~0.000V 
@0.800V, ~0.025V @1.100V and ~0.050V @1.5V
I've tried to undervolt in BIOS and it worked, too. But, my BIOS allows 
only 0.9V and by software I was able to go under that voltage. Here you 
can see results (all of them passed few hours in prime):

http://www.aaen.edu.yu/~tnt/graf.png

Now, I'm running at 2.385MHz at 1.425V and under full load my lm_sensors 
show VCore = 1.46V

I'll try to play a little bit more when I get 1 x 512MB module, as my 
mobo would lock up every time I try to change something on the fly with 
2 modules. It's comon issue with Socket 754 boards.

>Such patch will never reach mainline (but may be posted to this list for
>reference purpose only).
>  
>
Yes... I guess so... I'm a little bit sad because linux becomes such 
conservative...

Regards,
Nebojsa

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

* Re: powernow-k8 manual voltage selection ?
  2004-12-20 15:48   ` Nebojsa Trpkovic
@ 2004-12-20 16:45     ` Bruno Ducrot
  2004-12-20 16:58       ` Bruno Ducrot
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Ducrot @ 2004-12-20 16:45 UTC (permalink / raw)
  To: Nebojsa Trpkovic; +Cc: cpufreq

On Mon, Dec 20, 2004 at 04:48:15PM +0100, Nebojsa Trpkovic wrote:
> Bruno Ducrot wrote:
> 
> >How you have done this?  By powernow-k8 or via BIOS setting?  If the
> >latter, I will not trust this input yet. You can verify this is OK via
> >cpufrequtils at
> >http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-0.1.tar.bz2
> >then go to cpufrequtils-0.1/debug/x86_64 and issue a make, then 
> >./powernow-k8-decode
> >as root.  You must have the msr kernel driver loaded to get it working.
> > 
> >
> I've done that by some software tool in window$ (I just didn't want to 
> lock up system several times in my Gentoo :) ). By that tool (can't 
> remember name) I was able to change multiplicators and voltages. I was 
> monitoring voltages by other 2 tools and I could saw that my mobo 
> overvolts CPU a little bit under heavy load, but it's about ~0.000V 
> @0.800V, ~0.025V @1.100V and ~0.050V @1.5V
> I've tried to undervolt in BIOS and it worked, too. But, my BIOS allows 
> only 0.9V and by software I was able to go under that voltage. Here you 
> can see results (all of them passed few hours in prime):
> 
> http://www.aaen.edu.yu/~tnt/graf.png
> 
> Now, I'm running at 2.385MHz at 1.425V and under full load my lm_sensors 
> show VCore = 1.46V

Could you please ./powernow-k8-decode in this case (nb:
powernow-k8-decode do not need powernow-k8).

> I'll try to play a little bit more when I get 1 x 512MB module, as my 
> mobo would lock up every time I try to change something on the fly with 
> 2 modules. It's comon issue with Socket 754 boards.
> 
> >Such patch will never reach mainline (but may be posted to this list for
> >reference purpose only).
> > 
> >
> Yes... I guess so... I'm a little bit sad because linux becomes such 
> conservative...

linux have been always conservative in mainline if running hardware
out-of-spec AFAIK.

Cheers,

-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

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

* Re: powernow-k8 manual voltage selection ?
  2004-12-20 16:45     ` Bruno Ducrot
@ 2004-12-20 16:58       ` Bruno Ducrot
  0 siblings, 0 replies; 5+ messages in thread
From: Bruno Ducrot @ 2004-12-20 16:58 UTC (permalink / raw)
  To: Nebojsa Trpkovic; +Cc: cpufreq

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

On Mon, Dec 20, 2004 at 05:45:04PM +0100, Bruno Ducrot wrote:
> 
> linux have been always conservative in mainline if running hardware
> out-of-spec AFAIK.

I forgot to attach this patch.  You have to modify it to suit your
needs, though.


-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

[-- Attachment #2: powernow-k8.diff --]
[-- Type: text/plain, Size: 3028 bytes --]

--- linux-2.6/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2004/08/24 13:49:16	1.1
+++ linux-2.6/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2004/08/25 11:01:56
@@ -47,6 +47,9 @@
 
 static struct powernow_k8_data *powernow_data[NR_CPUS];
 
+
+#define OVERRIDE_MAX (3)
+
 /* Return a frequency in MHz, given an input fid */
 static u32 find_freq_from_fid(u32 fid)
 {
@@ -794,6 +797,68 @@
 static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index) { return; }
 #endif /* CONFIG_X86_POWERNOW_K8_ACPI */
 
+static int powernow_k8_cpu_init_override(struct powernow_k8_data *data)
+{
+	struct cpufreq_frequency_table *powernow_table;
+	u32 fid, vid;
+
+	/* fill in data->powernow_table */
+	powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table)
+		* (OVERRIDE_MAX + 1)), GFP_KERNEL);
+	if (!powernow_table) {
+		dprintk(KERN_ERR PFX "powernow_table memory alloc failure\n");
+		goto err_out;
+	}
+
+	/* 2200 GHz  1.50V */
+	fid = 0xe;
+	vid = 2;
+	dprintk(KERN_INFO PFX "   %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
+	powernow_table[0].index = fid; /* lower 8 bits */
+	powernow_table[0].index |= (vid << 8); /* upper 8 bits */
+	powernow_table[0].frequency = find_khz_freq_from_fid(fid);
+
+	/* 2000 GHz  1.40V */
+	fid = 0xc;
+	vid = 6;
+	dprintk(KERN_INFO PFX "   %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
+	powernow_table[1].index = fid; /* lower 8 bits */
+	powernow_table[1].index |= (vid << 8); /* upper 8 bits */
+	powernow_table[1].frequency = find_khz_freq_from_fid(fid);
+
+	/* 1000 GHz  1.10V */
+	fid = 0x2;
+	vid = 0x12;
+	dprintk(KERN_INFO PFX "   %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
+	powernow_table[2].index = fid; /* lower 8 bits */
+	powernow_table[2].index |= (vid << 8); /* upper 8 bits */
+	powernow_table[2].frequency = find_khz_freq_from_fid(fid);
+
+	powernow_table[3].index = 0;
+	powernow_table[3].frequency = CPUFREQ_TABLE_END;
+
+	data->powernow_table = powernow_table;
+
+	/* fill in data */
+	data->numps = 3;
+	data->irt = 3;
+	data->rvo = 2;
+	data->plllock = 2;
+	data->vidmvs = 1;
+	data->vstable = 5;
+	data->acpi_data.state_count = 0;
+	print_basics(data);
+	return 0;
+
+err_out:
+	/*acpi_processor_unregister_performance(&data->acpi_data, data->cpu);*/
+
+	/* data->acpi_data.state_count informs us at ->exit() whether ACPI was used */
+	data->acpi_data.state_count = 0;
+
+	return -ENODEV;
+}
+
 /* Take a frequency, and issue the fid/vid transition command */
 static int transition_frequency(struct powernow_k8_data *data, unsigned int index)
 {
@@ -942,6 +1007,13 @@
 
 	data->cpu = pol->cpu;
 
+	if (powernow_k8_cpu_init_override(data)) {
+		printk(KERN_ERR PFX "Oops, can't override the powernow table for cpu %d\n", pol->cpu);
+		kfree(data);
+		return -ENODEV;
+	} else
+		goto the_next;
+
 	if (powernow_k8_cpu_init_acpi(data)) {
 		/*
 		 * Use the PSB BIOS structure. This is only availabe on
@@ -964,6 +1036,7 @@
 			return -ENODEV;
 		}
 	}
+the_next:
 
 	/* only run on specific CPU from here on */
 	oldmask = current->cpus_allowed;

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

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

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

end of thread, other threads:[~2004-12-20 16:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-19  1:15 powernow-k8 manual voltage selection ? Nebojsa Trpkovic
2004-12-20 14:12 ` Bruno Ducrot
2004-12-20 15:48   ` Nebojsa Trpkovic
2004-12-20 16:45     ` Bruno Ducrot
2004-12-20 16:58       ` Bruno Ducrot

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.