[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/2] acpi/cpufreq: Support CPU frequency driver for Zhaoxin cpu



Implementation of Zhaoxin CPU frequency is compatible with Intel.
Zhaoxin CPU also supports EST.

Signed-off-by: FionaLi-oc <fionali-oc@xxxxxxxxxxx>
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c 
b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 844ab85..9d86fa0 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -60,7 +60,8 @@ static int check_est_cpu(unsigned int cpuid)
 {
     struct cpuinfo_x86 *cpu = &cpu_data[cpuid];
 
-    if (cpu->x86_vendor != X86_VENDOR_INTEL ||
+    if ((cpu->x86_vendor != X86_VENDOR_INTEL &&
+        cpu->x86_vendor != X86_VENDOR_SHANGHAI) ||
         !cpu_has(cpu, X86_FEATURE_EIST))
         return 0;
 
@@ -600,7 +601,8 @@ acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     /* Check for APERF/MPERF support in hardware
      * also check for boost support */
-    if (c->x86_vendor == X86_VENDOR_INTEL && c->cpuid_level >= 6)
+    if ((c->x86_vendor == X86_VENDOR_INTEL && c->cpuid_level >= 6) ||
+        (c->x86_vendor == X86_VENDOR_SHANGHAI))
         on_selected_cpus(cpumask_of(cpu), feature_detect, policy, 1);
 
     /*
@@ -646,7 +648,8 @@ static int __init cpufreq_driver_init(void)
     int ret = 0;
 
     if ((cpufreq_controller == FREQCTL_xen) &&
-        (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
+        ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) ||
+         (boot_cpu_data.x86_vendor == X86_VENDOR_SHANGHAI)))
         ret = cpufreq_register_driver(&acpi_cpufreq_driver);
     else if ((cpufreq_controller == FREQCTL_xen) &&
         (boot_cpu_data.x86_vendor == X86_VENDOR_AMD))
@@ -660,9 +663,10 @@ int cpufreq_cpu_init(unsigned int cpuid)
 {
     int ret;
 
-    /* Currently we only handle Intel and AMD processor */
+    /* Currently we only handle Intel, AMD and ShangHai processor */
     if ( (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ) ||
-         (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ) )
+         (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ) ||
+         (boot_cpu_data.x86_vendor == X86_VENDOR_SHANGHAI ) )
         ret = cpufreq_add_cpu(cpuid);
     else
         ret = -EFAULT;
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.