blob: 594dde143ca0d862b60515ddc09e9dfc3238663b [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.
Stefan Reinauer5c554632012-04-04 00:09:50 +020015 */
16
17#ifndef _CPU_INTEL_MODEL_206AX_H
18#define _CPU_INTEL_MODEL_206AX_H
19
Stefan Reinauerc0f2cfb2012-07-10 17:16:10 -070020/* SandyBridge/IvyBridge bus clock is fixed at 100MHz */
Stefan Reinauer5c554632012-04-04 00:09:50 +020021#define SANDYBRIDGE_BCLK 100
22
23#define IA32_FEATURE_CONTROL 0x3a
24#define CPUID_VMX (1 << 5)
25#define CPUID_SMX (1 << 6)
26#define MSR_FEATURE_CONFIG 0x13c
Duncan Laurie22935e12012-07-09 09:58:35 -070027#define MSR_FLEX_RATIO 0x194
28#define FLEX_RATIO_LOCK (1 << 20)
29#define FLEX_RATIO_EN (1 << 16)
Stefan Reinauer5c554632012-04-04 00:09:50 +020030#define IA32_PLATFORM_DCA_CAP 0x1f8
31#define IA32_MISC_ENABLE 0x1a0
Duncan Laurie55632112012-07-16 12:19:00 -070032#define MSR_TEMPERATURE_TARGET 0x1a2
Lee Leahy7b5f12b92017-03-15 17:16:59 -070033#define IA32_PERF_CTL 0x199
Stefan Reinauer5c554632012-04-04 00:09:50 +020034#define IA32_THERM_INTERRUPT 0x19b
35#define IA32_ENERGY_PERFORMANCE_BIAS 0x1b0
36#define ENERGY_POLICY_PERFORMANCE 0
37#define ENERGY_POLICY_NORMAL 6
38#define ENERGY_POLICY_POWERSAVE 15
39#define IA32_PACKAGE_THERM_INTERRUPT 0x1b2
40#define MSR_LT_LOCK_MEMORY 0x2e7
Lee Leahy7b5f12b92017-03-15 17:16:59 -070041#define IA32_MC0_STATUS 0x401
Stefan Reinauer5c554632012-04-04 00:09:50 +020042
43#define MSR_PIC_MSG_CONTROL 0x2e
44#define MSR_PLATFORM_INFO 0xce
45#define PLATFORM_INFO_SET_TDP (1 << 29)
Stefan Reinauer5c554632012-04-04 00:09:50 +020046
47#define MSR_MISC_PWR_MGMT 0x1aa
48#define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0)
49#define MSR_TURBO_RATIO_LIMIT 0x1ad
50#define MSR_POWER_CTL 0x1fc
51
52#define MSR_PKGC3_IRTL 0x60a
53#define MSR_PKGC6_IRTL 0x60b
54#define MSR_PKGC7_IRTL 0x60c
55#define IRTL_VALID (1 << 15)
56#define IRTL_1_NS (0 << 10)
57#define IRTL_32_NS (1 << 10)
58#define IRTL_1024_NS (2 << 10)
59#define IRTL_32768_NS (3 << 10)
60#define IRTL_1048576_NS (4 << 10)
61#define IRTL_33554432_NS (5 << 10)
62#define IRTL_RESPONSE_MASK (0x3ff)
63
64/* long duration in low dword, short duration in high dword */
65#define MSR_PKG_POWER_LIMIT 0x610
66#define PKG_POWER_LIMIT_MASK 0x7fff
67#define PKG_POWER_LIMIT_EN (1 << 15)
68#define PKG_POWER_LIMIT_CLAMP (1 << 16)
69#define PKG_POWER_LIMIT_TIME_SHIFT 17
70#define PKG_POWER_LIMIT_TIME_MASK 0x7f
71
72#define MSR_PP0_CURRENT_CONFIG 0x601
73#define PP0_CURRENT_LIMIT (112 << 3) /* 112 A */
74#define MSR_PP1_CURRENT_CONFIG 0x602
Duncan Laurie4e4320f2012-06-25 09:53:58 -070075#define PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */
76#define PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */
Stefan Reinauer5c554632012-04-04 00:09:50 +020077#define MSR_PKG_POWER_SKU_UNIT 0x606
78#define MSR_PKG_POWER_SKU 0x614
79#define MSR_PP0_POWER_LIMIT 0x638
80#define MSR_PP1_POWER_LIMIT 0x640
81
Duncan Laurie77dbbac2012-06-25 09:51:59 -070082#define IVB_CONFIG_TDP_MIN_CPUID 0x306a2
83#define MSR_CONFIG_TDP_NOMINAL 0x648
84#define MSR_CONFIG_TDP_LEVEL1 0x649
85#define MSR_CONFIG_TDP_LEVEL2 0x64a
86#define MSR_CONFIG_TDP_CONTROL 0x64b
87#define MSR_TURBO_ACTIVATION_RATIO 0x64c
88
Stefan Reinauer5c554632012-04-04 00:09:50 +020089/* P-state configuration */
90#define PSS_MAX_ENTRIES 8
91#define PSS_RATIO_STEP 2
92#define PSS_LATENCY_TRANSITION 10
93#define PSS_LATENCY_BUSMASTER 10
94
95#ifdef __SMM__
96/* Lock MSRs */
97void intel_model_206ax_finalize_smm(void);
98#else
99/* Configure power limits for turbo mode */
100void set_power_limits(u8 power_limit_1_time);
Duncan Laurie77dbbac2012-06-25 09:51:59 -0700101int cpu_config_tdp_levels(void);
Vladimir Serbinenkoa3e41c02015-05-28 16:04:17 +0200102void smm_relocate(void);
Stefan Reinauer5c554632012-04-04 00:09:50 +0200103#endif
Stefan Reinauer5c554632012-04-04 00:09:50 +0200104
105#endif