blob: a7ca04a690c4d4f256620a84e591574a7056774f [file] [log] [blame]
Stefan Reinauer5c554632012-04-04 00:09:50 +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.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19 * MA 02110-1301 USA
20 */
21
22#ifndef _CPU_INTEL_MODEL_206AX_H
23#define _CPU_INTEL_MODEL_206AX_H
24
Stefan Reinauerc0f2cfb2012-07-10 17:16:10 -070025/* SandyBridge/IvyBridge bus clock is fixed at 100MHz */
Stefan Reinauer5c554632012-04-04 00:09:50 +020026#define SANDYBRIDGE_BCLK 100
27
28#define IA32_FEATURE_CONTROL 0x3a
29#define CPUID_VMX (1 << 5)
30#define CPUID_SMX (1 << 6)
31#define MSR_FEATURE_CONFIG 0x13c
Duncan Laurie22935e12012-07-09 09:58:35 -070032#define MSR_FLEX_RATIO 0x194
33#define FLEX_RATIO_LOCK (1 << 20)
34#define FLEX_RATIO_EN (1 << 16)
Stefan Reinauer5c554632012-04-04 00:09:50 +020035#define IA32_PLATFORM_DCA_CAP 0x1f8
36#define IA32_MISC_ENABLE 0x1a0
Duncan Laurie55632112012-07-16 12:19:00 -070037#define MSR_TEMPERATURE_TARGET 0x1a2
Stefan Reinauer5c554632012-04-04 00:09:50 +020038#define IA32_PERF_CTL 0x199
39#define IA32_THERM_INTERRUPT 0x19b
40#define IA32_ENERGY_PERFORMANCE_BIAS 0x1b0
41#define ENERGY_POLICY_PERFORMANCE 0
42#define ENERGY_POLICY_NORMAL 6
43#define ENERGY_POLICY_POWERSAVE 15
44#define IA32_PACKAGE_THERM_INTERRUPT 0x1b2
45#define MSR_LT_LOCK_MEMORY 0x2e7
46#define IA32_MC0_STATUS 0x401
47
48#define MSR_PIC_MSG_CONTROL 0x2e
49#define MSR_PLATFORM_INFO 0xce
50#define PLATFORM_INFO_SET_TDP (1 << 29)
51#define MSR_PMG_CST_CONFIG_CONTROL 0xe2
52#define MSR_PMG_IO_CAPTURE_BASE 0xe4
53
54#define MSR_MISC_PWR_MGMT 0x1aa
55#define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0)
56#define MSR_TURBO_RATIO_LIMIT 0x1ad
57#define MSR_POWER_CTL 0x1fc
58
59#define MSR_PKGC3_IRTL 0x60a
60#define MSR_PKGC6_IRTL 0x60b
61#define MSR_PKGC7_IRTL 0x60c
62#define IRTL_VALID (1 << 15)
63#define IRTL_1_NS (0 << 10)
64#define IRTL_32_NS (1 << 10)
65#define IRTL_1024_NS (2 << 10)
66#define IRTL_32768_NS (3 << 10)
67#define IRTL_1048576_NS (4 << 10)
68#define IRTL_33554432_NS (5 << 10)
69#define IRTL_RESPONSE_MASK (0x3ff)
70
71/* long duration in low dword, short duration in high dword */
72#define MSR_PKG_POWER_LIMIT 0x610
73#define PKG_POWER_LIMIT_MASK 0x7fff
74#define PKG_POWER_LIMIT_EN (1 << 15)
75#define PKG_POWER_LIMIT_CLAMP (1 << 16)
76#define PKG_POWER_LIMIT_TIME_SHIFT 17
77#define PKG_POWER_LIMIT_TIME_MASK 0x7f
78
79#define MSR_PP0_CURRENT_CONFIG 0x601
80#define PP0_CURRENT_LIMIT (112 << 3) /* 112 A */
81#define MSR_PP1_CURRENT_CONFIG 0x602
Duncan Laurie4e4320f2012-06-25 09:53:58 -070082#define PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */
83#define PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */
Stefan Reinauer5c554632012-04-04 00:09:50 +020084#define MSR_PKG_POWER_SKU_UNIT 0x606
85#define MSR_PKG_POWER_SKU 0x614
86#define MSR_PP0_POWER_LIMIT 0x638
87#define MSR_PP1_POWER_LIMIT 0x640
88
Duncan Laurie77dbbac2012-06-25 09:51:59 -070089#define IVB_CONFIG_TDP_MIN_CPUID 0x306a2
90#define MSR_CONFIG_TDP_NOMINAL 0x648
91#define MSR_CONFIG_TDP_LEVEL1 0x649
92#define MSR_CONFIG_TDP_LEVEL2 0x64a
93#define MSR_CONFIG_TDP_CONTROL 0x64b
94#define MSR_TURBO_ACTIVATION_RATIO 0x64c
95
Stefan Reinauer5c554632012-04-04 00:09:50 +020096/* P-state configuration */
97#define PSS_MAX_ENTRIES 8
98#define PSS_RATIO_STEP 2
99#define PSS_LATENCY_TRANSITION 10
100#define PSS_LATENCY_BUSMASTER 10
101
Duncan Laurie22935e12012-07-09 09:58:35 -0700102#ifndef __ROMCC__
Stefan Reinauer5c554632012-04-04 00:09:50 +0200103#ifdef __SMM__
104/* Lock MSRs */
105void intel_model_206ax_finalize_smm(void);
106#else
107/* Configure power limits for turbo mode */
108void set_power_limits(u8 power_limit_1_time);
Duncan Laurie77dbbac2012-06-25 09:51:59 -0700109int cpu_config_tdp_levels(void);
Stefan Reinauer5c554632012-04-04 00:09:50 +0200110#endif
Duncan Laurie22935e12012-07-09 09:58:35 -0700111#endif
Stefan Reinauer5c554632012-04-04 00:09:50 +0200112
113#endif