You are not logged in.

#1 2006-07-01 08:52:19

Kin
Member
From: Oberfranken / Europe
Registered: 2004-01-23
Posts: 137

"RMClock Linux" for AMD K8, change voltage manual

Hi,

when modprobe powernow-k8  a list with multiplicators and their voltages appear:

powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.60.2)
powernow-k8:    0 : fid 0xa (1800 MHz), vid 0xa (1300 mV)
powernow-k8:    1 : fid 0x8 (1600 MHz), vid 0xc (1250 mV)
powernow-k8:    2 : fid 0x0 (800 MHz), vid 0x13 (1075 mV)
cpu_init done, current fid 0xa, vid 0x8
powernow-k8: ph2 null fid transition 0xa


Well, in my case, I have an AMD Mobile Sempron 3000+ which normally has lower voltages. In general those voltages are way too high.
Within Windows I could use RMClock to lower the voltages to 0.975V @800MHz to 1.175V @ 1800MHz. Those voltages are stable.


So, I looked and found a patch at
http://planet3dnow.de/vbulletinshowthre … owernow-k8

The patch itself is at
http://www.i-hasser.net/host_linux/powernow_k8.patch.gz


This patch enables you to change the voltages for the given multiplicator while modprobing the powernow-k8 module
The vid is calculated by t he following function: 1.55V-VID*0.025V
So, a

modprobe powernow_k8 fix_fid1=0xa fix_vid1=0x10 fix_fid2=0x8 fix_vid2=0x14 fix_fid3=0x0 fix_vid3=0x1e


would give you 1.15V, 1.05V und 0.8V for fid1, fid2, fid3
(just examples, don´t try 0.8V, It won´t run)


Really nice thing. My problem is that this patch has been written against an older version of powernow-k8.c
I tried to change the patch (deleted the 2 last diff part) and patched the powernow-k8.c
Don´t know whether this is such easy. I´m currently comiling the whole new kernel. Is there a faster way for compiling that specific module ?

Is that patch applyable to the current powernow-k8.c?

It would be great if we could make a runnableversion out of it.

Kin

Offline

#2 2006-07-01 11:28:59

Kin
Member
From: Oberfranken / Europe
Registered: 2004-01-23
Posts: 137

Re: "RMClock Linux" for AMD K8, change voltage manual

It seems to work big_smile

With

modprobe powernow-k8 fix_fid1=0x0a fix_vid1=0x0f fix_fid2=0x8 fix_vid2=0x10 fix_fid3=0x0 fix_vid3=0x17


I get:

powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.60.2)
powernow-k8:    overridding fid 0xa (1800 MHz) to vid 0xf (1175 mV)
powernow-k8:    overridding fid 0x8 (1600 MHz) to vid 0x10 (1150 mV)
powernow-k8:    overridding fid 0x0 (800 MHz) to vid 0x17 (975 mV)
powernow-k8:    0 : fid 0xa (1800 MHz), vid 0xf (1175 mV)
powernow-k8:    1 : fid 0x8 (1600 MHz), vid 0x10 (1150 mV)
powernow-k8:    2 : fid 0x0 (800 MHz), vid 0x17 (975 mV)
cpu_init done, current fid 0x0, vid 0x13

Here is the patch. I just deleted the last two diff parts and patched it against powernow-k8.c


--- powernow-k8_old.c    2004-07-06 16:31:50.000000000 +0200
+++ powernow-k8.c    2004-07-06 16:30:41.000000000 +0200
@@ -19,6 +19,13 @@
  *  of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD
  *  Opteron Processors" available for download from www.amd.com
  */
+
+ /*  Patched by Johannes Uhlemann (private@jfuhlemann.de)
+  *  Patch allows to specify different vids for detected fids.
+  *  Parameters are: fix_fid[1..3] and fix_vid[1..3] 
+  *
+  *  Use at own risc
+  */

#include <linux>
#include <linux>
@@ -28,6 +35,9 @@
#include <linux>
#include <linux>

+// own addition
+#include <linux>
+
#include <asm>
#include <asm>
#include <asm>
@@ -42,6 +52,23 @@
#define VERSION "version 1.00.09b"
#include "powernow-k8.h"

+// BOH
+// get Parameters
+static int fix_fid1=255;
+static int fix_vid1=255;
+static int fix_fid2=255;
+static int fix_vid2=255;
+static int fix_fid3=255;
+static int fix_vid3=255;
+
+module_param(fix_fid1, int, 0);
+module_param(fix_vid1, int, 0);
+module_param(fix_fid2, int, 0);
+module_param(fix_vid2, int, 0);
+module_param(fix_fid3, int, 0);
+module_param(fix_vid3, int, 0);
+// EOH
+
/* serialize freq changes  */
static DECLARE_MUTEX(fidvid_sem);

@@ -520,6 +547,23 @@
static void print_basics(struct powernow_k8_data *data)
{
    int j;
+   
+    // BOH
+    // Print Overridders if given:
+    if((fix_fid1!=255) && (fix_vid1!=255))
+            printk(KERN_INFO PFX "   overridding fid 0x%x (%d MHz) to vid 0x%x (%d mV)n",
+                fix_fid1, find_freq_from_fid(fix_fid1),
+                fix_vid1, find_millivolts_from_vid(data, fix_vid1));
+    if((fix_fid2!=255) && (fix_vid2!=255))
+            printk(KERN_INFO PFX "   overridding fid 0x%x (%d MHz) to vid 0x%x (%d mV)n",
+                fix_fid2, find_freq_from_fid(fix_fid2),
+                fix_vid2, find_millivolts_from_vid(data, fix_vid2));
+    if((fix_fid3!=255) && (fix_vid3!=255))
+            printk(KERN_INFO PFX "   overridding fid 0x%x (%d MHz) to vid 0x%x (%d mV)n",
+                fix_fid3, find_freq_from_fid(fix_fid3),
+                fix_vid3, find_millivolts_from_vid(data, fix_vid3));
+    // EOH          
+   
    for (j = 0; j <data>numps; j++) {
        if (data->powernow_table[j].frequency != CPUFREQ_ENTRY_INVALID)
            printk(KERN_INFO PFX "   %d : fid 0x%x (%d MHz), vid 0x%x (%d mV)n", j,
@@ -567,6 +611,18 @@
    for (j = 0; j <data>numps; j++) {
        powernow_table[j].index = pst[j].fid; /* lower 8 bits */
        powernow_table[j].index |= (pst[j].vid << 8); /* upper 8 bits */
+       
+        // BOH - Begin Of Hack
+        // Overridde fid/vid combinations here (note: there is another powernow_table
+        // fill routine about line 770
+        if( (fix_fid1==pst[j].fid) && (fix_vid1!=255) )
+            powernow_table[j].index=(fix_fid1&0xFF)| ((fix_vid1&0xFF)<<8);
+        if( (fix_fid2==pst[j].fid) && (fix_vid2!=255) )
+            powernow_table[j].index=(fix_fid2&0xFF)| ((fix_vid2&0xFF)<<8);
+        if( (fix_fid3==pst[j].fid) && (fix_vid3!=255) )
+            powernow_table[j].index=(fix_fid3&0xFF)| ((fix_vid3&0xFF)<<8>numps].frequency = CPUFREQ_TABLE_END;
@@ -716,6 +772,19 @@

        powernow_table[i].index = fid; /* lower 8 bits */
        powernow_table[i].index |= (vid << 8); /* upper 8 bits */
+       
+        // BOH - Begin Of Hack
+        // Overridde fid/vid combinations here (note: there is another powernow_table
+        // fill routine about line 600
+        if( (fix_fid1==fid) && (fix_vid1!=255) )
+            powernow_table[i].index=(fix_fid1&0xFF)| ((fix_vid1&0xFF)<<8);
+        if( (fix_fid2==fid) && (fix_vid2!=255) )
+            powernow_table[i].index=(fix_fid2&0xFF)| ((fix_vid2&0xFF)<<8);
+        if( (fix_fid3==fid) && (fix_vid3!=255) )
+            powernow_table[i].index=(fix_fid3&0xFF)| ((fix_vid3&0xFF)<<8);
+        // EOH - End Of Hack wink       
+       
+       
        powernow_table[i].frequency = find_khz_freq_from_fid(fid);

Offline

#3 2006-07-01 11:52:42

Kin
Member
From: Oberfranken / Europe
Registered: 2004-01-23
Posts: 137

Re: "RMClock Linux" for AMD K8, change voltage manual

Strange, while the cpu changes the frequency with the ondemand governor, I get failure messages. It seems it tries to revert the vids back. Where could I check which voltage is currently set ?


cpu_init done, current fid 0x0, vid 0x13
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed
powernow-k8: vid trans failed, vid 0x17, curr 0x13
powernow-k8: transition frequency failed

Offline

Board footer

Powered by FluxBB