diff options
| -rw-r--r-- | drivers/cpufreq/intel_pstate.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 8006d86da397..c5b81beccc8e 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
| @@ -614,6 +614,19 @@ static void core_set_pstate(struct cpudata *cpudata, int pstate) | |||
| 614 | wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val); | 614 | wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val); |
| 615 | } | 615 | } |
| 616 | 616 | ||
| 617 | static int knl_get_turbo_pstate(void) | ||
| 618 | { | ||
| 619 | u64 value; | ||
| 620 | int nont, ret; | ||
| 621 | |||
| 622 | rdmsrl(MSR_NHM_TURBO_RATIO_LIMIT, value); | ||
| 623 | nont = core_get_max_pstate(); | ||
| 624 | ret = (((value) >> 8) & 0xFF); | ||
| 625 | if (ret <= nont) | ||
| 626 | ret = nont; | ||
| 627 | return ret; | ||
| 628 | } | ||
| 629 | |||
| 617 | static struct cpu_defaults core_params = { | 630 | static struct cpu_defaults core_params = { |
| 618 | .pid_policy = { | 631 | .pid_policy = { |
| 619 | .sample_rate_ms = 10, | 632 | .sample_rate_ms = 10, |
| @@ -651,6 +664,23 @@ static struct cpu_defaults byt_params = { | |||
| 651 | }, | 664 | }, |
| 652 | }; | 665 | }; |
| 653 | 666 | ||
| 667 | static struct cpu_defaults knl_params = { | ||
| 668 | .pid_policy = { | ||
| 669 | .sample_rate_ms = 10, | ||
| 670 | .deadband = 0, | ||
| 671 | .setpoint = 97, | ||
| 672 | .p_gain_pct = 20, | ||
| 673 | .d_gain_pct = 0, | ||
| 674 | .i_gain_pct = 0, | ||
| 675 | }, | ||
| 676 | .funcs = { | ||
| 677 | .get_max = core_get_max_pstate, | ||
| 678 | .get_min = core_get_min_pstate, | ||
| 679 | .get_turbo = knl_get_turbo_pstate, | ||
| 680 | .set = core_set_pstate, | ||
| 681 | }, | ||
| 682 | }; | ||
| 683 | |||
| 654 | static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) | 684 | static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) |
| 655 | { | 685 | { |
| 656 | int max_perf = cpu->pstate.turbo_pstate; | 686 | int max_perf = cpu->pstate.turbo_pstate; |
| @@ -865,6 +895,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ids[] = { | |||
| 865 | ICPU(0x4e, core_params), | 895 | ICPU(0x4e, core_params), |
| 866 | ICPU(0x4f, core_params), | 896 | ICPU(0x4f, core_params), |
| 867 | ICPU(0x56, core_params), | 897 | ICPU(0x56, core_params), |
| 898 | ICPU(0x57, knl_params), | ||
| 868 | {} | 899 | {} |
| 869 | }; | 900 | }; |
| 870 | MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids); | 901 | MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids); |
