aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/idle/intel_idle.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2013-01-31 14:40:49 -0500
committerLen Brown <len.brown@intel.com>2013-02-08 19:25:48 -0500
commit85a4d2d41dc6d1c0296326204a857a9fab864a31 (patch)
treead5f4e94901f5549a08ccd06d22c6bc188deefac /drivers/idle/intel_idle.c
parentb1beab48f6148d50fee4a56d741cc3168fe1b995 (diff)
intel_idle: support Haswell
This patch enables intel_idle to run on the next-generation Intel(R) Microarchitecture code named "Haswell". Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/idle/intel_idle.c')
-rw-r--r--drivers/idle/intel_idle.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index b2cf489ba3e1..fa714774b960 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -212,6 +212,38 @@ static struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = {
212 .enter = &intel_idle }, 212 .enter = &intel_idle },
213}; 213};
214 214
215static struct cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] = {
216 { /* MWAIT C0 */ },
217 { /* MWAIT C1 */
218 .name = "C1-HSW",
219 .desc = "MWAIT 0x00",
220 .flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_TIME_VALID,
221 .exit_latency = 2,
222 .target_residency = 2,
223 .enter = &intel_idle },
224 { /* MWAIT C2 */
225 .name = "C3-HSW",
226 .desc = "MWAIT 0x10",
227 .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
228 .exit_latency = 33,
229 .target_residency = 100,
230 .enter = &intel_idle },
231 { /* MWAIT C3 */
232 .name = "C6-HSW",
233 .desc = "MWAIT 0x20",
234 .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
235 .exit_latency = 133,
236 .target_residency = 400,
237 .enter = &intel_idle },
238 { /* MWAIT C4 */
239 .name = "C7s-HSW",
240 .desc = "MWAIT 0x32",
241 .flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
242 .exit_latency = 166,
243 .target_residency = 500,
244 .enter = &intel_idle },
245};
246
215static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { 247static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
216 { /* MWAIT C0 */ }, 248 { /* MWAIT C0 */ },
217 { /* MWAIT C1 */ 249 { /* MWAIT C1 */
@@ -365,6 +397,10 @@ static const struct idle_cpu idle_cpu_ivb = {
365 .state_table = ivb_cstates, 397 .state_table = ivb_cstates,
366}; 398};
367 399
400static const struct idle_cpu idle_cpu_hsw = {
401 .state_table = hsw_cstates,
402};
403
368#define ICPU(model, cpu) \ 404#define ICPU(model, cpu) \
369 { X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu } 405 { X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu }
370 406
@@ -382,6 +418,9 @@ static const struct x86_cpu_id intel_idle_ids[] = {
382 ICPU(0x2d, idle_cpu_snb), 418 ICPU(0x2d, idle_cpu_snb),
383 ICPU(0x3a, idle_cpu_ivb), 419 ICPU(0x3a, idle_cpu_ivb),
384 ICPU(0x3e, idle_cpu_ivb), 420 ICPU(0x3e, idle_cpu_ivb),
421 ICPU(0x3c, idle_cpu_hsw),
422 ICPU(0x3f, idle_cpu_hsw),
423 ICPU(0x45, idle_cpu_hsw),
385 {} 424 {}
386}; 425};
387MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids); 426MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids);