aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorDirk Brandewie <dirk.j.brandewie@intel.com>2013-10-21 12:20:35 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-25 17:46:10 -0400
commit19e77c28dbf1972305da0dfeb92a62f83df3a91d (patch)
tree48348ff456ca427844e4e162bc1329b08b140a03 /drivers/cpufreq
parent016c815084d5b89f7c1a24b1a3a0b796512a91bc (diff)
intel_pstate: Add Baytrail support
Add support for the Baytrail processor. Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/intel_pstate.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 6b37c9ff1d64..27c2753909fe 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -33,6 +33,8 @@
33 33
34#define SAMPLE_COUNT 3 34#define SAMPLE_COUNT 3
35 35
36#define BYT_RATIOS 0x66a
37
36#define FRAC_BITS 8 38#define FRAC_BITS 8
37#define int_tofp(X) ((int64_t)(X) << FRAC_BITS) 39#define int_tofp(X) ((int64_t)(X) << FRAC_BITS)
38#define fp_toint(X) ((X) >> FRAC_BITS) 40#define fp_toint(X) ((X) >> FRAC_BITS)
@@ -342,6 +344,20 @@ static void intel_pstate_sysfs_expose_params(void)
342} 344}
343 345
344/************************** sysfs end ************************/ 346/************************** sysfs end ************************/
347static int byt_get_min_pstate(void)
348{
349 u64 value;
350 rdmsrl(BYT_RATIOS, value);
351 return value & 0xFF;
352}
353
354static int byt_get_max_pstate(void)
355{
356 u64 value;
357 rdmsrl(BYT_RATIOS, value);
358 return (value >> 16) & 0xFF;
359}
360
345static int core_get_min_pstate(void) 361static int core_get_min_pstate(void)
346{ 362{
347 u64 value; 363 u64 value;
@@ -396,6 +412,24 @@ static struct cpu_defaults core_params = {
396 }, 412 },
397}; 413};
398 414
415static struct cpu_defaults byt_params = {
416 .pid_policy = {
417 .sample_rate_ms = 10,
418 .deadband = 0,
419 .setpoint = 97,
420 .p_gain_pct = 14,
421 .d_gain_pct = 0,
422 .i_gain_pct = 4,
423 },
424 .funcs = {
425 .get_max = byt_get_max_pstate,
426 .get_min = byt_get_min_pstate,
427 .get_turbo = byt_get_max_pstate,
428 .set = core_set_pstate,
429 },
430};
431
432
399static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) 433static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max)
400{ 434{
401 int max_perf = cpu->pstate.turbo_pstate; 435 int max_perf = cpu->pstate.turbo_pstate;
@@ -553,6 +587,7 @@ static void intel_pstate_timer_func(unsigned long __data)
553static const struct x86_cpu_id intel_pstate_cpu_ids[] = { 587static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
554 ICPU(0x2a, core_params), 588 ICPU(0x2a, core_params),
555 ICPU(0x2d, core_params), 589 ICPU(0x2d, core_params),
590 ICPU(0x37, byt_params),
556 ICPU(0x3a, core_params), 591 ICPU(0x3a, core_params),
557 ICPU(0x3c, core_params), 592 ICPU(0x3c, core_params),
558 ICPU(0x3e, core_params), 593 ICPU(0x3e, core_params),