[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221009071033.21170-7-Perry.Yuan@amd.com>
Date: Sun, 9 Oct 2022 15:10:30 +0800
From: Perry Yuan <Perry.Yuan@....com>
To: <rafael.j.wysocki@...el.com>, <ray.huang@....com>,
<viresh.kumar@...aro.org>
CC: <Deepak.Sharma@....com>, <Mario.Limonciello@....com>,
<Nathan.Fontenot@....com>, <Alexander.Deucher@....com>,
<Shimmer.Huang@....com>, <Xiaojian.Du@....com>, <Li.Meng@....com>,
<linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Perry Yuan <Perry.Yuan@....com>
Subject: [PATCH v2 6/9] cpufreq: amd_pstate: add AMD pstate EPP support for shared memory type processor
Add Energy Performance Preference support for AMD SOCs which do not
contain a designated MSR for CPPC support. A shared memory interface
is used for CPPC on these SOCs and the ACPI PCC channel is used to
enable EPP and reset the desired performance.
Signed-off-by: Perry Yuan <Perry.Yuan@....com>
---
drivers/cpufreq/amd-pstate.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 14a275c22aff..4c24fe391a55 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -135,12 +135,25 @@ static inline int pstate_enable(bool enable)
static int cppc_enable(bool enable)
{
+ struct cppc_perf_ctrls perf_ctrls;
int cpu, ret = 0;
for_each_present_cpu(cpu) {
ret = cppc_set_enable(cpu, enable);
if (ret)
return ret;
+ if (epp_enabled) {
+ /* Enable autonomous mode for EPP */
+ ret = cppc_set_auto_epp(cpu, enable);
+ if (ret)
+ return ret;
+
+ /* Set desired perf as zero to allow EPP firmware control */
+ perf_ctrls.desired_perf = 0;
+ ret = cppc_set_perf(cpu, &perf_ctrls);
+ if (ret)
+ return ret;
+ }
}
return ret;
--
2.34.1
Powered by blists - more mailing lists