From: Philippe Longepe <philippe.longepe@linux.intel.com>
To: linux-pm@vger.kernel.org
Cc: srinivas.pandruvada@linux.intel.com,
Stephane Gasparini <stephane.gasparini@linux.intel.com>
Subject: [PATCH v8 2/2] cpufreq: intel_pstate: Fix the FSB feq for Airmont
Date: Fri, 30 Oct 2015 19:28:18 +0100 [thread overview]
Message-ID: <1446229698-21391-2-git-send-email-philippe.longepe@linux.intel.com> (raw)
In-Reply-To: <1446229698-21391-1-git-send-email-philippe.longepe@linux.intel.com>
Include the Airmont support in the get_scaling function.
There are two flavors of Atom cores to be supported by intel_pstate,
Silvermont and Airmont, so make the driver distinguish between them by
adding separate frequency tables.
Separate the cpu defaults params for each of them and match the CPU IDs
against them as appropriate.
Signed-off-by: Philippe Longepe <philippe.longepe@linux.intel.com>
Signed-off-by: Stephane Gasparini <stephane.gasparini@linux.intel.com>
---
drivers/cpufreq/intel_pstate.c | 56 +++++++++++++++++++++++++++++++++---------
1 file changed, 45 insertions(+), 11 deletions(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 8618b02..4cdf97a 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -551,20 +551,35 @@ static void atom_set_pstate(struct cpudata *cpudata, int pstate)
wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val);
}
-#define ATOM_BCLK_FREQS 5
-static int atom_freq_table[ATOM_BCLK_FREQS] = { 833, 1000, 1333, 1167, 800};
-
-static int atom_get_scaling(void)
+static int silvermont_get_scaling(void)
{
u64 value;
int i;
+ /* Defined in Table 35-6 from SDM (Sept 2015) */
+ static int silvermont_freq_table[] = {
+ 83300, 100000, 133300, 116700, 80000};
rdmsrl(MSR_FSB_FREQ, value);
- i = value & 0x3;
+ i = value & 0x7;
+ BUG_ON(i > 4);
- BUG_ON(i > ATOM_BCLK_FREQS);
+ return silvermont_freq_table[i];
+}
- return atom_freq_table[i] * 100;
+static int airmont_get_scaling(void)
+{
+ u64 value;
+ int i;
+ /* Defined in Table 35-10 from SDM (Sept 2015) */
+ static int airmont_freq_table[] = {
+ 83300, 100000, 133300, 116700, 80000,
+ 93300, 90000, 88900, 87500};
+
+ rdmsrl(MSR_FSB_FREQ, value);
+ i = value & 0xF;
+ BUG_ON(i > 8);
+
+ return airmont_freq_table[i];
}
static void atom_get_vid(struct cpudata *cpudata)
@@ -659,7 +674,26 @@ static struct cpu_defaults core_params = {
},
};
-static struct cpu_defaults atom_params = {
+static struct cpu_defaults silvermont_params = {
+ .pid_policy = {
+ .sample_rate_ms = 10,
+ .deadband = 0,
+ .setpoint = 60,
+ .p_gain_pct = 14,
+ .d_gain_pct = 0,
+ .i_gain_pct = 4,
+ },
+ .funcs = {
+ .get_max = atom_get_max_pstate,
+ .get_min = atom_get_min_pstate,
+ .get_turbo = atom_get_turbo_pstate,
+ .set = atom_set_pstate,
+ .get_scaling = silvermont_get_scaling,
+ .get_vid = atom_get_vid,
+ },
+};
+
+static struct cpu_defaults airmont_params = {
.pid_policy = {
.sample_rate_ms = 10,
.deadband = 0,
@@ -673,7 +707,7 @@ static struct cpu_defaults atom_params = {
.get_min = atom_get_min_pstate,
.get_turbo = atom_get_turbo_pstate,
.set = atom_set_pstate,
- .get_scaling = atom_get_scaling,
+ .get_scaling = airmont_get_scaling,
.get_vid = atom_get_vid,
},
};
@@ -912,7 +946,7 @@ static void intel_pstate_timer_func(unsigned long __data)
static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
ICPU(0x2a, core_params),
ICPU(0x2d, core_params),
- ICPU(0x37, atom_params),
+ ICPU(0x37, silvermont_params),
ICPU(0x3a, core_params),
ICPU(0x3c, core_params),
ICPU(0x3d, core_params),
@@ -921,7 +955,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
ICPU(0x45, core_params),
ICPU(0x46, core_params),
ICPU(0x47, core_params),
- ICPU(0x4c, atom_params),
+ ICPU(0x4c, airmont_params),
ICPU(0x4e, core_params),
ICPU(0x4f, core_params),
ICPU(0x5e, core_params),
--
1.9.1
next prev parent reply other threads:[~2015-10-30 18:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 18:28 [PATCH v8 1/2] cpufreq: intel_pstate: Replace BYT by ATOM Philippe Longepe
2015-10-30 18:28 ` Philippe Longepe [this message]
2015-10-30 19:31 ` Srinivas Pandruvada
-- strict thread matches above, loose matches on Subject: below --
2015-10-29 16:31 Philippe Longepe
2015-10-29 16:31 ` [PATCH v8 2/2] cpufreq: intel_pstate: Fix the FSB feq for Airmont Philippe Longepe
2015-10-27 10:38 Philippe Longepe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1446229698-21391-2-git-send-email-philippe.longepe@linux.intel.com \
--to=philippe.longepe@linux.intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=stephane.gasparini@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).