@@ -21,10 +21,6 @@ static bool __ro_after_init feature_hdc;
static bool __ro_after_init opt_cpufreq_hdc = true;
-#define HWP_ENERGY_PERF_MAX_PERFORMANCE 0
-#define HWP_ENERGY_PERF_BALANCE 0x80
-#define HWP_ENERGY_PERF_MAX_POWERSAVE 0xff
-
union hwp_request
{
struct
@@ -597,7 +593,7 @@ int set_hwp_para(struct cpufreq_policy *policy,
data->minimum = data->hw.lowest;
data->maximum = data->hw.lowest;
data->activity_window = 0;
- data->energy_perf = HWP_ENERGY_PERF_MAX_POWERSAVE;
+ data->energy_perf = CPPC_ENERGY_PERF_MAX_POWERSAVE;
data->desired = 0;
break;
@@ -605,7 +601,7 @@ int set_hwp_para(struct cpufreq_policy *policy,
data->minimum = data->hw.highest;
data->maximum = data->hw.highest;
data->activity_window = 0;
- data->energy_perf = HWP_ENERGY_PERF_MAX_PERFORMANCE;
+ data->energy_perf = CPPC_ENERGY_PERF_MAX_PERFORMANCE;
data->desired = 0;
break;
@@ -613,7 +609,7 @@ int set_hwp_para(struct cpufreq_policy *policy,
data->minimum = data->hw.lowest;
data->maximum = data->hw.highest;
data->activity_window = 0;
- data->energy_perf = HWP_ENERGY_PERF_BALANCE;
+ data->energy_perf = CPPC_ENERGY_PERF_BALANCE;
data->desired = 0;
break;
@@ -253,6 +253,16 @@ void cpufreq_dbs_timer_resume(void);
void intel_feature_detect(struct cpufreq_policy *policy);
+/*
+ * If Energy Performance Preference(epp) is supported in the platform,
+ * OSPM may write a range of values from 0(performance preference)
+ * to 0xFF(energy efficiency perference) to control the platform's
+ * energy efficiency and performance optimization policies
+ */
+#define CPPC_ENERGY_PERF_MAX_PERFORMANCE 0
+#define CPPC_ENERGY_PERF_BALANCE 0x80
+#define CPPC_ENERGY_PERF_MAX_POWERSAVE 0xff
+
int hwp_cmdline_parse(const char *s, const char *e);
int hwp_register_driver(void);
#ifdef CONFIG_INTEL
Intel's hwp Energy Performance Preference value is compatible with CPPC's Energy Performance Preference value, so this commit abstracts the value and re-place it in common header file cpufreq.h, to be used not only for hwp in the future. Signed-off-by: Penny Zheng <Penny.Zheng@amd.com> --- v1 -> v2: - new commit --- xen/arch/x86/acpi/cpufreq/hwp.c | 10 +++------- xen/include/acpi/cpufreq/cpufreq.h | 10 ++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-)