X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Fkernel%2Fcpu%2Fcpufreq%2Flongrun.c;h=e3868de4dc2e9c6bdb1a0ab74fef819b926ea195;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=ab3cfc3cdee949f4d94bc780d29c309909599755;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c index ab3cfc3cd..e3868de4d 100644 --- a/arch/i386/kernel/cpu/cpufreq/longrun.c +++ b/arch/i386/kernel/cpu/cpufreq/longrun.c @@ -16,6 +16,8 @@ #include #include +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) + static struct cpufreq_driver longrun_driver; /** @@ -38,12 +40,14 @@ static void __init longrun_get_policy(struct cpufreq_policy *policy) u32 msr_lo, msr_hi; rdmsr(MSR_TMTA_LONGRUN_FLAGS, msr_lo, msr_hi); + dprintk("longrun flags are %x - %x\n", msr_lo, msr_hi); if (msr_lo & 0x01) policy->policy = CPUFREQ_POLICY_PERFORMANCE; else policy->policy = CPUFREQ_POLICY_POWERSAVE; rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi); + dprintk("longrun ctrl is %x - %x\n", msr_lo, msr_hi); msr_lo &= 0x0000007F; msr_hi &= 0x0000007F; @@ -146,6 +150,7 @@ static unsigned int longrun_get(unsigned int cpu) return 0; cpuid(0x80860007, &eax, &ebx, &ecx, &edx); + dprintk("cpuid eax is %u\n", eax); return (eax * 1000); } @@ -191,6 +196,8 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq, rdmsr(MSR_TMTA_LRTI_VOLT_MHZ, msr_lo, msr_hi); *high_freq = msr_lo * 1000; /* to kHz */ + dprintk("longrun table interface told %u - %u kHz\n", *low_freq, *high_freq); + if (*low_freq > *high_freq) *low_freq = *high_freq; return 0; @@ -199,6 +206,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq, /* set the upper border to the value determined during TSC init */ *high_freq = (cpu_khz / 1000); *high_freq = *high_freq * 1000; + dprintk("high frequency is %u kHz\n", *high_freq); /* get current borders */ rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi); @@ -225,6 +233,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq, /* restore values */ wrmsr(MSR_TMTA_LONGRUN_CTRL, save_lo, save_hi); } + dprintk("percentage is %u %%, freq is %u MHz\n", ecx, eax); /* performance_pctg = (current_freq - low_freq)/(high_freq - low_freq) * eqals @@ -240,6 +249,8 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq, edx = (eax - ebx) / (100 - ecx); *low_freq = edx * 1000; /* back to kHz */ + dprintk("low frequency is %u kHz\n", *low_freq); + if (*low_freq > *high_freq) *low_freq = *high_freq; @@ -308,7 +319,7 @@ static void __exit longrun_exit(void) MODULE_AUTHOR ("Dominik Brodowski "); -MODULE_DESCRIPTION ("LongRun driver for Transmeta Crusoe processors."); +MODULE_DESCRIPTION ("LongRun driver for Transmeta Crusoe and Efficeon processors."); MODULE_LICENSE ("GPL"); module_init(longrun_init);