diff options
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 36 | ||||
| -rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 2 | ||||
| -rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.h | 4 |
3 files changed, 31 insertions, 11 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c index 837b04166a47..ca3e1d341889 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c | |||
| @@ -341,15 +341,17 @@ static int powernow_acpi_init(void) | |||
| 341 | pc.val = (unsigned long) acpi_processor_perf->states[0].control; | 341 | pc.val = (unsigned long) acpi_processor_perf->states[0].control; |
| 342 | for (i = 0; i < number_scales; i++) { | 342 | for (i = 0; i < number_scales; i++) { |
| 343 | u8 fid, vid; | 343 | u8 fid, vid; |
| 344 | unsigned int speed; | 344 | struct acpi_processor_px *state = |
| 345 | &acpi_processor_perf->states[i]; | ||
| 346 | unsigned int speed, speed_mhz; | ||
| 345 | 347 | ||
| 346 | pc.val = (unsigned long) acpi_processor_perf->states[i].control; | 348 | pc.val = (unsigned long) state->control; |
| 347 | dprintk ("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n", | 349 | dprintk ("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n", |
| 348 | i, | 350 | i, |
| 349 | (u32) acpi_processor_perf->states[i].core_frequency, | 351 | (u32) state->core_frequency, |
| 350 | (u32) acpi_processor_perf->states[i].power, | 352 | (u32) state->power, |
| 351 | (u32) acpi_processor_perf->states[i].transition_latency, | 353 | (u32) state->transition_latency, |
| 352 | (u32) acpi_processor_perf->states[i].control, | 354 | (u32) state->control, |
| 353 | pc.bits.sgtc); | 355 | pc.bits.sgtc); |
| 354 | 356 | ||
| 355 | vid = pc.bits.vid; | 357 | vid = pc.bits.vid; |
| @@ -360,6 +362,18 @@ static int powernow_acpi_init(void) | |||
| 360 | powernow_table[i].index |= (vid << 8); /* upper 8 bits */ | 362 | powernow_table[i].index |= (vid << 8); /* upper 8 bits */ |
| 361 | 363 | ||
| 362 | speed = powernow_table[i].frequency; | 364 | speed = powernow_table[i].frequency; |
| 365 | speed_mhz = speed / 1000; | ||
| 366 | |||
| 367 | /* processor_perflib will multiply the MHz value by 1000 to | ||
| 368 | * get a KHz value (e.g. 1266000). However, powernow-k7 works | ||
| 369 | * with true KHz values (e.g. 1266768). To ensure that all | ||
| 370 | * powernow frequencies are available, we must ensure that | ||
| 371 | * ACPI doesn't restrict them, so we round up the MHz value | ||
| 372 | * to ensure that perflib's computed KHz value is greater than | ||
| 373 | * or equal to powernow's KHz value. | ||
| 374 | */ | ||
| 375 | if (speed % 1000 > 0) | ||
| 376 | speed_mhz++; | ||
| 363 | 377 | ||
| 364 | if ((fid_codes[fid] % 10)==5) { | 378 | if ((fid_codes[fid] % 10)==5) { |
| 365 | if (have_a0 == 1) | 379 | if (have_a0 == 1) |
| @@ -368,10 +382,16 @@ static int powernow_acpi_init(void) | |||
| 368 | 382 | ||
| 369 | dprintk (" FID: 0x%x (%d.%dx [%dMHz]) " | 383 | dprintk (" FID: 0x%x (%d.%dx [%dMHz]) " |
| 370 | "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, | 384 | "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, |
| 371 | fid_codes[fid] % 10, speed/1000, vid, | 385 | fid_codes[fid] % 10, speed_mhz, vid, |
| 372 | mobile_vid_table[vid]/1000, | 386 | mobile_vid_table[vid]/1000, |
| 373 | mobile_vid_table[vid]%1000); | 387 | mobile_vid_table[vid]%1000); |
| 374 | 388 | ||
| 389 | if (state->core_frequency != speed_mhz) { | ||
| 390 | state->core_frequency = speed_mhz; | ||
| 391 | dprintk(" Corrected ACPI frequency to %d\n", | ||
| 392 | speed_mhz); | ||
| 393 | } | ||
| 394 | |||
| 375 | if (latency < pc.bits.sgtc) | 395 | if (latency < pc.bits.sgtc) |
| 376 | latency = pc.bits.sgtc; | 396 | latency = pc.bits.sgtc; |
| 377 | 397 | ||
| @@ -602,7 +622,7 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy) | |||
| 602 | result = powernow_acpi_init(); | 622 | result = powernow_acpi_init(); |
| 603 | if (result) { | 623 | if (result) { |
| 604 | printk (KERN_INFO PFX "ACPI and legacy methods failed\n"); | 624 | printk (KERN_INFO PFX "ACPI and legacy methods failed\n"); |
| 605 | printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.shtml\n"); | 625 | printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.html\n"); |
| 606 | } | 626 | } |
| 607 | } else { | 627 | } else { |
| 608 | /* SGTC use the bus clock as timer */ | 628 | /* SGTC use the bus clock as timer */ |
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index 7cf3d207b6b3..4ade55c5f333 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c | |||
| @@ -521,7 +521,7 @@ static int check_supported_cpu(unsigned int cpu) | |||
| 521 | 521 | ||
| 522 | if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) { | 522 | if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) { |
| 523 | if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) || | 523 | if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) || |
| 524 | ((eax & CPUID_XMOD) > CPUID_XMOD_REV_G)) { | 524 | ((eax & CPUID_XMOD) > CPUID_XMOD_REV_MASK)) { |
| 525 | printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax); | 525 | printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax); |
| 526 | goto out; | 526 | goto out; |
| 527 | } | 527 | } |
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h index 95be5013c984..b06c812208ca 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h | |||
| @@ -46,8 +46,8 @@ struct powernow_k8_data { | |||
| 46 | #define CPUID_XFAM 0x0ff00000 /* extended family */ | 46 | #define CPUID_XFAM 0x0ff00000 /* extended family */ |
| 47 | #define CPUID_XFAM_K8 0 | 47 | #define CPUID_XFAM_K8 0 |
| 48 | #define CPUID_XMOD 0x000f0000 /* extended model */ | 48 | #define CPUID_XMOD 0x000f0000 /* extended model */ |
| 49 | #define CPUID_XMOD_REV_G 0x00060000 | 49 | #define CPUID_XMOD_REV_MASK 0x00080000 |
| 50 | #define CPUID_XFAM_10H 0x00100000 /* family 0x10 */ | 50 | #define CPUID_XFAM_10H 0x00100000 /* family 0x10 */ |
| 51 | #define CPUID_USE_XFAM_XMOD 0x00000f00 | 51 | #define CPUID_USE_XFAM_XMOD 0x00000f00 |
| 52 | #define CPUID_GET_MAX_CAPABILITIES 0x80000000 | 52 | #define CPUID_GET_MAX_CAPABILITIES 0x80000000 |
| 53 | #define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007 | 53 | #define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007 |
