diff options
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 35 |
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 ************************/ |
347 | static int byt_get_min_pstate(void) | ||
348 | { | ||
349 | u64 value; | ||
350 | rdmsrl(BYT_RATIOS, value); | ||
351 | return value & 0xFF; | ||
352 | } | ||
353 | |||
354 | static int byt_get_max_pstate(void) | ||
355 | { | ||
356 | u64 value; | ||
357 | rdmsrl(BYT_RATIOS, value); | ||
358 | return (value >> 16) & 0xFF; | ||
359 | } | ||
360 | |||
345 | static int core_get_min_pstate(void) | 361 | static 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 | ||
415 | static 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 | |||
399 | static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) | 433 | static 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) | |||
553 | static const struct x86_cpu_id intel_pstate_cpu_ids[] = { | 587 | static 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), |