blob: 64fb56301567a77c9fc1847dd4fcf56d1cb8ed21 [file] [log] [blame]
Angel Ponsf23ae0b2020-04-02 23:48:12 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Stefan Reinauer5c554632012-04-04 00:09:50 +02003
4#ifndef _CPU_INTEL_MODEL_206AX_H
5#define _CPU_INTEL_MODEL_206AX_H
6
Elyes HAOUASdfbe6bd2018-10-29 06:56:52 +01007#include <stdint.h>
8
Stefan Reinauerc0f2cfb2012-07-10 17:16:10 -07009/* SandyBridge/IvyBridge bus clock is fixed at 100MHz */
Stefan Reinauer5c554632012-04-04 00:09:50 +020010#define SANDYBRIDGE_BCLK 100
11
Elyes HAOUASa6a396d2019-05-26 13:25:30 +020012#define MSR_CORE_THREAD_COUNT 0x35
Stefan Reinauer5c554632012-04-04 00:09:50 +020013#define MSR_FEATURE_CONFIG 0x13c
Duncan Laurie22935e12012-07-09 09:58:35 -070014#define MSR_FLEX_RATIO 0x194
15#define FLEX_RATIO_LOCK (1 << 20)
16#define FLEX_RATIO_EN (1 << 16)
Duncan Laurie55632112012-07-16 12:19:00 -070017#define MSR_TEMPERATURE_TARGET 0x1a2
Stefan Reinauer5c554632012-04-04 00:09:50 +020018#define MSR_LT_LOCK_MEMORY 0x2e7
Stefan Reinauer5c554632012-04-04 00:09:50 +020019#define MSR_PIC_MSG_CONTROL 0x2e
20#define MSR_PLATFORM_INFO 0xce
21#define PLATFORM_INFO_SET_TDP (1 << 29)
Stefan Reinauer5c554632012-04-04 00:09:50 +020022
23#define MSR_MISC_PWR_MGMT 0x1aa
24#define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0)
25#define MSR_TURBO_RATIO_LIMIT 0x1ad
26#define MSR_POWER_CTL 0x1fc
27
28#define MSR_PKGC3_IRTL 0x60a
29#define MSR_PKGC6_IRTL 0x60b
30#define MSR_PKGC7_IRTL 0x60c
31#define IRTL_VALID (1 << 15)
32#define IRTL_1_NS (0 << 10)
33#define IRTL_32_NS (1 << 10)
34#define IRTL_1024_NS (2 << 10)
35#define IRTL_32768_NS (3 << 10)
36#define IRTL_1048576_NS (4 << 10)
37#define IRTL_33554432_NS (5 << 10)
38#define IRTL_RESPONSE_MASK (0x3ff)
39
40/* long duration in low dword, short duration in high dword */
41#define MSR_PKG_POWER_LIMIT 0x610
42#define PKG_POWER_LIMIT_MASK 0x7fff
43#define PKG_POWER_LIMIT_EN (1 << 15)
44#define PKG_POWER_LIMIT_CLAMP (1 << 16)
45#define PKG_POWER_LIMIT_TIME_SHIFT 17
46#define PKG_POWER_LIMIT_TIME_MASK 0x7f
47
48#define MSR_PP0_CURRENT_CONFIG 0x601
49#define PP0_CURRENT_LIMIT (112 << 3) /* 112 A */
50#define MSR_PP1_CURRENT_CONFIG 0x602
Duncan Laurie4e4320f2012-06-25 09:53:58 -070051#define PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */
52#define PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */
Stefan Reinauer5c554632012-04-04 00:09:50 +020053#define MSR_PKG_POWER_SKU_UNIT 0x606
54#define MSR_PKG_POWER_SKU 0x614
55#define MSR_PP0_POWER_LIMIT 0x638
56#define MSR_PP1_POWER_LIMIT 0x640
57
Duncan Laurie77dbbac2012-06-25 09:51:59 -070058#define IVB_CONFIG_TDP_MIN_CPUID 0x306a2
59#define MSR_CONFIG_TDP_NOMINAL 0x648
60#define MSR_CONFIG_TDP_LEVEL1 0x649
61#define MSR_CONFIG_TDP_LEVEL2 0x64a
62#define MSR_CONFIG_TDP_CONTROL 0x64b
63#define MSR_TURBO_ACTIVATION_RATIO 0x64c
64
Stefan Reinauer5c554632012-04-04 00:09:50 +020065/* P-state configuration */
66#define PSS_MAX_ENTRIES 8
67#define PSS_RATIO_STEP 2
68#define PSS_LATENCY_TRANSITION 10
69#define PSS_LATENCY_BUSMASTER 10
70
Arthur Heymans67031a52018-02-05 19:08:03 +010071/* Sanity check config options. */
Kyösti Mälkkif6c20682019-08-02 06:14:50 +030072#if (CONFIG_SMM_TSEG_SIZE <= (CONFIG_IED_REGION_SIZE + CONFIG_SMM_RESERVED_SIZE))
73# error "CONFIG_SMM_TSEG_SIZE <= (CONFIG_IED_REGION_SIZE + CONFIG_SMM_RESERVED_SIZE)"
Arthur Heymans67031a52018-02-05 19:08:03 +010074#endif
75#if (CONFIG_SMM_TSEG_SIZE < 0x800000)
76# error "CONFIG_SMM_TSEG_SIZE must at least be 8MiB"
77#endif
78#if ((CONFIG_SMM_TSEG_SIZE & (CONFIG_SMM_TSEG_SIZE - 1)) != 0)
79# error "CONFIG_SMM_TSEG_SIZE is not a power of 2"
80#endif
81#if ((CONFIG_IED_REGION_SIZE & (CONFIG_IED_REGION_SIZE - 1)) != 0)
82# error "CONFIG_IED_REGION_SIZE is not a power of 2"
83#endif
84
Stefan Reinauer5c554632012-04-04 00:09:50 +020085/* Lock MSRs */
86void intel_model_206ax_finalize_smm(void);
Kyösti Mälkki82c0e7e2019-11-05 19:06:56 +020087
Stefan Reinauer5c554632012-04-04 00:09:50 +020088/* Configure power limits for turbo mode */
89void set_power_limits(u8 power_limit_1_time);
Duncan Laurie77dbbac2012-06-25 09:51:59 -070090int cpu_config_tdp_levels(void);
Patrick Rudolph74203de2017-11-20 11:57:01 +010091int get_platform_id(void);
Stefan Reinauer5c554632012-04-04 00:09:50 +020092
93#endif