aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/powernow-k8.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/powernow-k8.c')
-rw-r--r--drivers/cpufreq/powernow-k8.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index 8f9b2ceeec85..c0e816468e30 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -40,6 +40,7 @@
40#include <linux/delay.h> 40#include <linux/delay.h>
41 41
42#include <asm/msr.h> 42#include <asm/msr.h>
43#include <asm/cpu_device_id.h>
43 44
44#include <linux/acpi.h> 45#include <linux/acpi.h>
45#include <linux/mutex.h> 46#include <linux/mutex.h>
@@ -520,6 +521,15 @@ static int core_voltage_post_transition(struct powernow_k8_data *data,
520 return 0; 521 return 0;
521} 522}
522 523
524static const struct x86_cpu_id powernow_k8_ids[] = {
525 /* IO based frequency switching */
526 { X86_VENDOR_AMD, 0xf },
527 /* MSR based frequency switching supported */
528 X86_FEATURE_MATCH(X86_FEATURE_HW_PSTATE),
529 {}
530};
531MODULE_DEVICE_TABLE(x86cpu, powernow_k8_ids);
532
523static void check_supported_cpu(void *_rc) 533static void check_supported_cpu(void *_rc)
524{ 534{
525 u32 eax, ebx, ecx, edx; 535 u32 eax, ebx, ecx, edx;
@@ -527,13 +537,7 @@ static void check_supported_cpu(void *_rc)
527 537
528 *rc = -ENODEV; 538 *rc = -ENODEV;
529 539
530 if (__this_cpu_read(cpu_info.x86_vendor) != X86_VENDOR_AMD)
531 return;
532
533 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); 540 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
534 if (((eax & CPUID_XFAM) != CPUID_XFAM_K8) &&
535 ((eax & CPUID_XFAM) < CPUID_XFAM_10H))
536 return;
537 541
538 if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) { 542 if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) {
539 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) || 543 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
@@ -1553,6 +1557,9 @@ static int __cpuinit powernowk8_init(void)
1553 unsigned int i, supported_cpus = 0, cpu; 1557 unsigned int i, supported_cpus = 0, cpu;
1554 int rv; 1558 int rv;
1555 1559
1560 if (!x86_match_cpu(powernow_k8_ids))
1561 return -ENODEV;
1562
1556 for_each_online_cpu(i) { 1563 for_each_online_cpu(i) {
1557 int rc; 1564 int rc;
1558 smp_call_function_single(i, check_supported_cpu, &rc, 1); 1565 smp_call_function_single(i, check_supported_cpu, &rc, 1);