blob: 3a581e34f2b5f4c3d6d02e71314f54ff0ba9272d [file] [log] [blame]
Vladimir Serbinenko22dcdd92013-06-06 22:10:45 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Vladimir Serbinenko22dcdd92013-06-06 22:10:45 +020015 */
16
17#ifndef _CPU_INTEL_MODEL_2065X_H
18#define _CPU_INTEL_MODEL_2065X_H
19
Vladimir Serbinenko71f35eb2013-11-12 23:32:52 +010020/* Nehalem bus clock is fixed at 133MHz */
21#define NEHALEM_BCLK 133
Vladimir Serbinenko22dcdd92013-06-06 22:10:45 +020022
23#define IA32_FEATURE_CONTROL 0x3a
24#define CPUID_VMX (1 << 5)
25#define CPUID_SMX (1 << 6)
26#define MSR_FEATURE_CONFIG 0x13c
27#define MSR_FLEX_RATIO 0x194
28#define FLEX_RATIO_LOCK (1 << 20)
29#define FLEX_RATIO_EN (1 << 16)
30#define IA32_PLATFORM_DCA_CAP 0x1f8
31#define IA32_MISC_ENABLE 0x1a0
32#define MSR_TEMPERATURE_TARGET 0x1a2
Alexander Couzensed48dfd2015-02-24 03:07:02 +010033#define IA32_FERR_CAPABILITY 0x1f1
34#define FERR_ENABLE (1 << 0)
Vladimir Serbinenko22dcdd92013-06-06 22:10:45 +020035#define IA32_PERF_CTL 0x199
36#define IA32_THERM_INTERRUPT 0x19b
37#define IA32_ENERGY_PERFORMANCE_BIAS 0x1b0
38#define ENERGY_POLICY_PERFORMANCE 0
39#define ENERGY_POLICY_NORMAL 6
40#define ENERGY_POLICY_POWERSAVE 15
41#define IA32_PACKAGE_THERM_INTERRUPT 0x1b2
42#define MSR_LT_LOCK_MEMORY 0x2e7
43#define IA32_MC0_STATUS 0x401
44
45#define MSR_PIC_MSG_CONTROL 0x2e
46#define MSR_PLATFORM_INFO 0xce
47#define PLATFORM_INFO_SET_TDP (1 << 29)
48
49#define MSR_MISC_PWR_MGMT 0x1aa
50#define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0)
51#define MSR_TURBO_RATIO_LIMIT 0x1ad
52#define MSR_POWER_CTL 0x1fc
53
54#define MSR_PKGC3_IRTL 0x60a
55#define MSR_PKGC6_IRTL 0x60b
56#define MSR_PKGC7_IRTL 0x60c
57#define IRTL_VALID (1 << 15)
58#define IRTL_1_NS (0 << 10)
59#define IRTL_32_NS (1 << 10)
60#define IRTL_1024_NS (2 << 10)
61#define IRTL_32768_NS (3 << 10)
62#define IRTL_1048576_NS (4 << 10)
63#define IRTL_33554432_NS (5 << 10)
64#define IRTL_RESPONSE_MASK (0x3ff)
65
66/* long duration in low dword, short duration in high dword */
67#define MSR_PKG_POWER_LIMIT 0x610
68#define PKG_POWER_LIMIT_MASK 0x7fff
69#define PKG_POWER_LIMIT_EN (1 << 15)
70#define PKG_POWER_LIMIT_CLAMP (1 << 16)
71#define PKG_POWER_LIMIT_TIME_SHIFT 17
72#define PKG_POWER_LIMIT_TIME_MASK 0x7f
73
Vladimir Serbinenko22dcdd92013-06-06 22:10:45 +020074#define IVB_CONFIG_TDP_MIN_CPUID 0x306a2
75#define MSR_CONFIG_TDP_NOMINAL 0x648
76#define MSR_CONFIG_TDP_LEVEL1 0x649
77#define MSR_CONFIG_TDP_LEVEL2 0x64a
78#define MSR_CONFIG_TDP_CONTROL 0x64b
79#define MSR_TURBO_ACTIVATION_RATIO 0x64c
80
81/* P-state configuration */
82#define PSS_MAX_ENTRIES 16
83#define PSS_RATIO_STEP 1
84#define PSS_LATENCY_TRANSITION 10
85#define PSS_LATENCY_BUSMASTER 10
86
87#ifdef __SMM__
88/* Lock MSRs */
89void intel_model_2065x_finalize_smm(void);
90#else
91/* Configure power limits for turbo mode */
92void set_power_limits(u8 power_limit_1_time);
93int cpu_config_tdp_levels(void);
Vladimir Serbinenko456f4952015-05-28 20:42:32 +020094void smm_relocate(void);
Vladimir Serbinenko22dcdd92013-06-06 22:10:45 +020095#endif
96
97#endif