All of lore.kernel.org
 help / color / mirror / Atom feed
* VRM(VRD) detection versus CPUID
@ 2005-05-19  6:25 Rudolf Marek
  2005-05-19  6:25 ` Jean Delvare
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: Rudolf Marek @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors


Hello,

I finally finished some code to detect correct VRM using CPUID.

What the code does?

If AMD
    /*Duron&Ahlon has VRM 9x*/
    if Opteron  VRM_AMD_OPTERON
If INTEL
     FOR /* P6 Family */
         ret = VRM_INTEL_8x;
         but  /* 0xB Tualatin */ and maybe  /* 0x9 ????? it has 0.13um */
         has   ret = VRM_INTEL_85;
     FOR p4 Family
         everything except model 3 has  ret = VRM_INTEL_9x;
         model 3 is prescott 90nm it has VRD 10 (my name is   ret         VRM_INTEL_10x;   /* 0x3 prescott */)
ELSE
  VRM_NONE

I belive this is correct.

You can get it here:

http://ssh.cz/~ruik/cpuidvrm.c
http://ssh.cz/~ruik/Makefile
make -C /usr/src/linux-2.6.6 SUBDIRS=$PWD modules


Cut & paste from relevant part of source will follow at the end of this
message.

What is needed now ?

0) review by people here
1) test the code for different processors, mainly see if Tualatin is
working and opteron. Simply insmod the module and see
the output VRM_NONE = 0 etc..
2) how to or who will incorporate this into the drivers? (Khali maybe?)

3) Little problem:
//Linux/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
#define CPUID_PROCESSOR_SIGNATURE             1 /* function 1
*/
#define OPTERON_XFAM_MOD             0x00000f50 /* xtended fam, fam +
model */
#define CPUID_XFAM_MOD               0x0ff00ff0 /* xtended fam, fam +
model */

I need this from that header file but dont know how to get it clever way.


Thats all for now. Comments wellcome.

Thanks

Regards

Rudolf

C0re code:

typedef enum  { VRM_NONE,VRM_INTEL_8x, VRM_INTEL_85,VRM_INTEL_9x,
VRM_INTEL_10x,,VRM_AMD_OPTERON} vrm_t;


static vrm_t whichVRM(void) {
vrm_t ret=VRM_NONE;
struct cpuinfo_x86 *c = cpu_data;
u32 eax;

 if (c->x86_vendor = X86_VENDOR_AMD) {

    if (c->x86 = 6) {
    /*Duron&Ahlon has VRM 9x*/
    ret = VRM_INTEL_9x;
    } else

    {
    eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
    if ((eax & CPUID_XFAM_MOD) = OPTERON_XFAM_MOD) {
        /* opteron */
        ret = VRM_AMD_OPTERON; }
    }
 }
 else if (c->x86_vendor = X86_VENDOR_INTEL) {

    if (c->x86=6) {
    /* P6 Family */
    ret = VRM_INTEL_8x;


    if ((c->x86_model = 0xB) || (c->x86_model = 0x9)) {
    ret = VRM_INTEL_85;   /* 0x9 ????? it has 0.13um */
                        /* 0xB Tualatin */
    }

    } else if (c->x86=0xF) {
    /*P4 family*/
    ret = VRM_INTEL_9x;
        if (c->x86_model = 3) {
            ret = VRM_INTEL_10x;   /* 0x3 prescott */
        }
    }
 } else {
 ret = VRM_NONE;
 }

return ret;
}

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

end of thread, other threads:[~2005-05-19  6:25 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-19  6:25 VRM(VRD) detection versus CPUID Rudolf Marek
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Rudolf Marek
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Rudolf Marek
2005-05-19  6:25 ` Rudolf Marek
2005-05-19  6:25 ` Greg KH
2005-05-19  6:25 ` Rudolf Marek
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Rudolf Marek
2005-05-19  6:25 ` Mark M. Hoffman
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Rudolf Marek
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Rudolf Marek
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Rudolf Marek
2005-05-19  6:25 ` Rudolf Marek
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Mark Studebaker
2005-05-19  6:25 ` Mark Studebaker
2005-05-19  6:25 ` Mark M. Hoffman

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.