Angel Pons | f23ae0b | 2020-04-02 23:48:12 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 2 | |
| 3 | #ifndef _CPU_INTEL_MODEL_206AX_H |
| 4 | #define _CPU_INTEL_MODEL_206AX_H |
| 5 | |
Elyes HAOUAS | dfbe6bd | 2018-10-29 06:56:52 +0100 | [diff] [blame] | 6 | #include <stdint.h> |
| 7 | |
Stefan Reinauer | c0f2cfb | 2012-07-10 17:16:10 -0700 | [diff] [blame] | 8 | /* SandyBridge/IvyBridge bus clock is fixed at 100MHz */ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 9 | #define SANDYBRIDGE_BCLK 100 |
| 10 | |
Elyes HAOUAS | a6a396d | 2019-05-26 13:25:30 +0200 | [diff] [blame] | 11 | #define MSR_CORE_THREAD_COUNT 0x35 |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 12 | #define MSR_FEATURE_CONFIG 0x13c |
Duncan Laurie | 22935e1 | 2012-07-09 09:58:35 -0700 | [diff] [blame] | 13 | #define MSR_FLEX_RATIO 0x194 |
| 14 | #define FLEX_RATIO_LOCK (1 << 20) |
| 15 | #define FLEX_RATIO_EN (1 << 16) |
Duncan Laurie | 5563211 | 2012-07-16 12:19:00 -0700 | [diff] [blame] | 16 | #define MSR_TEMPERATURE_TARGET 0x1a2 |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 17 | #define MSR_LT_LOCK_MEMORY 0x2e7 |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 18 | #define MSR_PLATFORM_INFO 0xce |
| 19 | #define PLATFORM_INFO_SET_TDP (1 << 29) |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 20 | |
| 21 | #define MSR_MISC_PWR_MGMT 0x1aa |
| 22 | #define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0) |
| 23 | #define MSR_TURBO_RATIO_LIMIT 0x1ad |
| 24 | #define MSR_POWER_CTL 0x1fc |
| 25 | |
| 26 | #define MSR_PKGC3_IRTL 0x60a |
| 27 | #define MSR_PKGC6_IRTL 0x60b |
| 28 | #define MSR_PKGC7_IRTL 0x60c |
| 29 | #define IRTL_VALID (1 << 15) |
| 30 | #define IRTL_1_NS (0 << 10) |
| 31 | #define IRTL_32_NS (1 << 10) |
| 32 | #define IRTL_1024_NS (2 << 10) |
| 33 | #define IRTL_32768_NS (3 << 10) |
| 34 | #define IRTL_1048576_NS (4 << 10) |
| 35 | #define IRTL_33554432_NS (5 << 10) |
| 36 | #define IRTL_RESPONSE_MASK (0x3ff) |
| 37 | |
| 38 | /* long duration in low dword, short duration in high dword */ |
| 39 | #define MSR_PKG_POWER_LIMIT 0x610 |
| 40 | #define PKG_POWER_LIMIT_MASK 0x7fff |
| 41 | #define PKG_POWER_LIMIT_EN (1 << 15) |
| 42 | #define PKG_POWER_LIMIT_CLAMP (1 << 16) |
| 43 | #define PKG_POWER_LIMIT_TIME_SHIFT 17 |
| 44 | #define PKG_POWER_LIMIT_TIME_MASK 0x7f |
| 45 | |
| 46 | #define MSR_PP0_CURRENT_CONFIG 0x601 |
| 47 | #define PP0_CURRENT_LIMIT (112 << 3) /* 112 A */ |
| 48 | #define MSR_PP1_CURRENT_CONFIG 0x602 |
Duncan Laurie | 4e4320f | 2012-06-25 09:53:58 -0700 | [diff] [blame] | 49 | #define PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */ |
| 50 | #define PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 51 | #define MSR_PKG_POWER_SKU_UNIT 0x606 |
| 52 | #define MSR_PKG_POWER_SKU 0x614 |
| 53 | #define MSR_PP0_POWER_LIMIT 0x638 |
| 54 | #define MSR_PP1_POWER_LIMIT 0x640 |
| 55 | |
Duncan Laurie | 77dbbac | 2012-06-25 09:51:59 -0700 | [diff] [blame] | 56 | #define IVB_CONFIG_TDP_MIN_CPUID 0x306a2 |
| 57 | #define MSR_CONFIG_TDP_NOMINAL 0x648 |
| 58 | #define MSR_CONFIG_TDP_LEVEL1 0x649 |
| 59 | #define MSR_CONFIG_TDP_LEVEL2 0x64a |
| 60 | #define MSR_CONFIG_TDP_CONTROL 0x64b |
| 61 | #define MSR_TURBO_ACTIVATION_RATIO 0x64c |
| 62 | |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 63 | /* P-state configuration */ |
| 64 | #define PSS_MAX_ENTRIES 8 |
| 65 | #define PSS_RATIO_STEP 2 |
| 66 | #define PSS_LATENCY_TRANSITION 10 |
| 67 | #define PSS_LATENCY_BUSMASTER 10 |
| 68 | |
Arthur Heymans | 67031a5 | 2018-02-05 19:08:03 +0100 | [diff] [blame] | 69 | /* Sanity check config options. */ |
Kyösti Mälkki | f6c2068 | 2019-08-02 06:14:50 +0300 | [diff] [blame] | 70 | #if (CONFIG_SMM_TSEG_SIZE <= (CONFIG_IED_REGION_SIZE + CONFIG_SMM_RESERVED_SIZE)) |
| 71 | # error "CONFIG_SMM_TSEG_SIZE <= (CONFIG_IED_REGION_SIZE + CONFIG_SMM_RESERVED_SIZE)" |
Arthur Heymans | 67031a5 | 2018-02-05 19:08:03 +0100 | [diff] [blame] | 72 | #endif |
| 73 | #if (CONFIG_SMM_TSEG_SIZE < 0x800000) |
| 74 | # error "CONFIG_SMM_TSEG_SIZE must at least be 8MiB" |
| 75 | #endif |
| 76 | #if ((CONFIG_SMM_TSEG_SIZE & (CONFIG_SMM_TSEG_SIZE - 1)) != 0) |
| 77 | # error "CONFIG_SMM_TSEG_SIZE is not a power of 2" |
| 78 | #endif |
| 79 | #if ((CONFIG_IED_REGION_SIZE & (CONFIG_IED_REGION_SIZE - 1)) != 0) |
| 80 | # error "CONFIG_IED_REGION_SIZE is not a power of 2" |
| 81 | #endif |
| 82 | |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 83 | /* Lock MSRs */ |
| 84 | void intel_model_206ax_finalize_smm(void); |
Kyösti Mälkki | 82c0e7e | 2019-11-05 19:06:56 +0200 | [diff] [blame] | 85 | |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 86 | /* Configure power limits for turbo mode */ |
| 87 | void set_power_limits(u8 power_limit_1_time); |
Duncan Laurie | 77dbbac | 2012-06-25 09:51:59 -0700 | [diff] [blame] | 88 | int cpu_config_tdp_levels(void); |
Patrick Rudolph | 74203de | 2017-11-20 11:57:01 +0100 | [diff] [blame] | 89 | int get_platform_id(void); |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 90 | |
| 91 | #endif |