1 /*
2  * From Coreboot file of the same name
3  *
4  * Copyright (C) 2011 The ChromiumOS Authors.
5  *
6  * SPDX-License-Identifier:	GPL-2.0
7  */
8 
9 #ifndef _ASM_ARCH_MODEL_206AX_H
10 #define _ASM_ARCH_MODEL_206AX_H
11 
12 /* SandyBridge/IvyBridge bus clock is fixed at 100MHz */
13 #define SANDYBRIDGE_BCLK		100
14 
15 #define  CPUID_VMX			(1 << 5)
16 #define  CPUID_SMX			(1 << 6)
17 #define MSR_FEATURE_CONFIG		0x13c
18 #define MSR_FLEX_RATIO			0x194
19 #define  FLEX_RATIO_LOCK		(1 << 20)
20 #define  FLEX_RATIO_EN			(1 << 16)
21 #define IA32_PLATFORM_DCA_CAP		0x1f8
22 #define IA32_MISC_ENABLE		0x1a0
23 #define MSR_TEMPERATURE_TARGET		0x1a2
24 #define IA32_PERF_CTL			0x199
25 #define IA32_THERM_INTERRUPT		0x19b
26 #define IA32_ENERGY_PERFORMANCE_BIAS	0x1b0
27 #define  ENERGY_POLICY_PERFORMANCE	0
28 #define  ENERGY_POLICY_NORMAL		6
29 #define  ENERGY_POLICY_POWERSAVE	15
30 #define IA32_PACKAGE_THERM_INTERRUPT	0x1b2
31 #define MSR_LT_LOCK_MEMORY		0x2e7
32 #define IA32_MC0_STATUS		0x401
33 
34 #define MSR_PIC_MSG_CONTROL		0x2e
35 #define  PLATFORM_INFO_SET_TDP		(1 << 29)
36 
37 #define MSR_MISC_PWR_MGMT		0x1aa
38 #define  MISC_PWR_MGMT_EIST_HW_DIS	(1 << 0)
39 #define MSR_TURBO_RATIO_LIMIT		0x1ad
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  PKG_POWER_LIMIT_MASK		0x7fff
55 #define  PKG_POWER_LIMIT_EN		(1 << 15)
56 #define  PKG_POWER_LIMIT_CLAMP		(1 << 16)
57 #define  PKG_POWER_LIMIT_TIME_SHIFT	17
58 #define  PKG_POWER_LIMIT_TIME_MASK	0x7f
59 
60 #define MSR_PP0_CURRENT_CONFIG		0x601
61 #define  PP0_CURRENT_LIMIT		(112 << 3) /* 112 A */
62 #define MSR_PP1_CURRENT_CONFIG		0x602
63 #define  PP1_CURRENT_LIMIT_SNB		(35 << 3) /* 35 A */
64 #define  PP1_CURRENT_LIMIT_IVB		(50 << 3) /* 50 A */
65 #define MSR_PKG_POWER_SKU		0x614
66 
67 #define IVB_CONFIG_TDP_MIN_CPUID	0x306a2
68 #define MSR_CONFIG_TDP_NOMINAL		0x648
69 #define MSR_CONFIG_TDP_LEVEL1		0x649
70 #define MSR_CONFIG_TDP_LEVEL2		0x64a
71 #define MSR_CONFIG_TDP_CONTROL		0x64b
72 #define MSR_TURBO_ACTIVATION_RATIO	0x64c
73 
74 /* P-state configuration */
75 #define PSS_MAX_ENTRIES			8
76 #define PSS_RATIO_STEP			2
77 #define PSS_LATENCY_TRANSITION		10
78 #define PSS_LATENCY_BUSMASTER		10
79 
80 /* Configure power limits for turbo mode */
81 void set_power_limits(u8 power_limit_1_time);
82 int cpu_config_tdp_levels(void);
83 
84 #endif
85