blob: c0d2434fe69d4d809e4c2f0a1faa7424ff8c73f6 [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
Elyes HAOUASdfbe6bd2018-10-29 06:56:52 +010020#include <stdint.h>
21
Stefan Reinauerc0f2cfb2012-07-10 17:16:10 -070022/* SandyBridge/IvyBridge bus clock is fixed at 100MHz */
Stefan Reinauer5c554632012-04-04 00:09:50 +020023#define SANDYBRIDGE_BCLK 100
24
Elyes HAOUASa6a396d2019-05-26 13:25:30 +020025#define MSR_CORE_THREAD_COUNT 0x35
Stefan Reinauer5c554632012-04-04 00:09:50 +020026#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)
Duncan Laurie55632112012-07-16 12:19:00 -070030#define MSR_TEMPERATURE_TARGET 0x1a2
Stefan Reinauer5c554632012-04-04 00:09:50 +020031#define MSR_LT_LOCK_MEMORY 0x2e7
Stefan Reinauer5c554632012-04-04 00:09:50 +020032#define MSR_PIC_MSG_CONTROL 0x2e
33#define MSR_PLATFORM_INFO 0xce
34#define PLATFORM_INFO_SET_TDP (1 << 29)
Stefan Reinauer5c554632012-04-04 00:09:50 +020035
36#define MSR_MISC_PWR_MGMT 0x1aa
37#define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0)
38#define MSR_TURBO_RATIO_LIMIT 0x1ad
39#define MSR_POWER_CTL 0x1fc
40
41#define MSR_PKGC3_IRTL 0x60a
42#define MSR_PKGC6_IRTL 0x60b
43#define MSR_PKGC7_IRTL 0x60c
44#define IRTL_VALID (1 << 15)
45#define IRTL_1_NS (0 << 10)
46#define IRTL_32_NS (1 << 10)
47#define IRTL_1024_NS (2 << 10)
48#define IRTL_32768_NS (3 << 10)
49#define IRTL_1048576_NS (4 << 10)
50#define IRTL_33554432_NS (5 << 10)
51#define IRTL_RESPONSE_MASK (0x3ff)
52
53/* long duration in low dword, short duration in high dword */
54#define MSR_PKG_POWER_LIMIT 0x610
55#define PKG_POWER_LIMIT_MASK 0x7fff
56#define PKG_POWER_LIMIT_EN (1 << 15)
57#define PKG_POWER_LIMIT_CLAMP (1 << 16)
58#define PKG_POWER_LIMIT_TIME_SHIFT 17
59#define PKG_POWER_LIMIT_TIME_MASK 0x7f
60
61#define MSR_PP0_CURRENT_CONFIG 0x601
62#define PP0_CURRENT_LIMIT (112 << 3) /* 112 A */
63#define MSR_PP1_CURRENT_CONFIG 0x602
Duncan Laurie4e4320f2012-06-25 09:53:58 -070064#define PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */
65#define PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */
Stefan Reinauer5c554632012-04-04 00:09:50 +020066#define MSR_PKG_POWER_SKU_UNIT 0x606
67#define MSR_PKG_POWER_SKU 0x614
68#define MSR_PP0_POWER_LIMIT 0x638
69#define MSR_PP1_POWER_LIMIT 0x640
70
Duncan Laurie77dbbac2012-06-25 09:51:59 -070071#define IVB_CONFIG_TDP_MIN_CPUID 0x306a2
72#define MSR_CONFIG_TDP_NOMINAL 0x648
73#define MSR_CONFIG_TDP_LEVEL1 0x649
74#define MSR_CONFIG_TDP_LEVEL2 0x64a
75#define MSR_CONFIG_TDP_CONTROL 0x64b
76#define MSR_TURBO_ACTIVATION_RATIO 0x64c
77
Stefan Reinauer5c554632012-04-04 00:09:50 +020078/* P-state configuration */
79#define PSS_MAX_ENTRIES 8
80#define PSS_RATIO_STEP 2
81#define PSS_LATENCY_TRANSITION 10
82#define PSS_LATENCY_BUSMASTER 10
83
Arthur Heymans67031a52018-02-05 19:08:03 +010084/*
85 * Region of SMM space is reserved for multipurpose use. It falls below
86 * the IED region and above the SMM handler.
87 */
88#define RESERVED_SMM_SIZE CONFIG_SMM_RESERVED_SIZE
89#define RESERVED_SMM_OFFSET \
90 (CONFIG_SMM_TSEG_SIZE - CONFIG_IED_REGION_SIZE - RESERVED_SMM_SIZE)
91
92/* Sanity check config options. */
93#if (CONFIG_SMM_TSEG_SIZE <= (CONFIG_IED_REGION_SIZE + RESERVED_SMM_SIZE))
94# error "CONFIG_SMM_TSEG_SIZE <= (CONFIG_IED_REGION_SIZE + RESERVED_SMM_SIZE)"
95#endif
96#if (CONFIG_SMM_TSEG_SIZE < 0x800000)
97# error "CONFIG_SMM_TSEG_SIZE must at least be 8MiB"
98#endif
99#if ((CONFIG_SMM_TSEG_SIZE & (CONFIG_SMM_TSEG_SIZE - 1)) != 0)
100# error "CONFIG_SMM_TSEG_SIZE is not a power of 2"
101#endif
102#if ((CONFIG_IED_REGION_SIZE & (CONFIG_IED_REGION_SIZE - 1)) != 0)
103# error "CONFIG_IED_REGION_SIZE is not a power of 2"
104#endif
105
Stefan Reinauer5c554632012-04-04 00:09:50 +0200106#ifdef __SMM__
107/* Lock MSRs */
108void intel_model_206ax_finalize_smm(void);
109#else
110/* Configure power limits for turbo mode */
111void set_power_limits(u8 power_limit_1_time);
Duncan Laurie77dbbac2012-06-25 09:51:59 -0700112int cpu_config_tdp_levels(void);
Stefan Reinauer5c554632012-04-04 00:09:50 +0200113#endif
Patrick Rudolph74203de2017-11-20 11:57:01 +0100114int get_platform_id(void);
Stefan Reinauer5c554632012-04-04 00:09:50 +0200115
116#endif