Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 1 | /* |
| 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 Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #ifndef _CPU_INTEL_MODEL_206AX_H |
| 18 | #define _CPU_INTEL_MODEL_206AX_H |
| 19 | |
Elyes HAOUAS | dfbe6bd | 2018-10-29 06:56:52 +0100 | [diff] [blame] | 20 | #include <stdint.h> |
| 21 | |
Stefan Reinauer | c0f2cfb | 2012-07-10 17:16:10 -0700 | [diff] [blame] | 22 | /* SandyBridge/IvyBridge bus clock is fixed at 100MHz */ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 23 | #define SANDYBRIDGE_BCLK 100 |
| 24 | |
Elyes HAOUAS | a6a396d | 2019-05-26 13:25:30 +0200 | [diff] [blame] | 25 | #define MSR_CORE_THREAD_COUNT 0x35 |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 26 | #define MSR_FEATURE_CONFIG 0x13c |
Duncan Laurie | 22935e1 | 2012-07-09 09:58:35 -0700 | [diff] [blame] | 27 | #define MSR_FLEX_RATIO 0x194 |
| 28 | #define FLEX_RATIO_LOCK (1 << 20) |
| 29 | #define FLEX_RATIO_EN (1 << 16) |
Duncan Laurie | 5563211 | 2012-07-16 12:19:00 -0700 | [diff] [blame] | 30 | #define MSR_TEMPERATURE_TARGET 0x1a2 |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 31 | #define MSR_LT_LOCK_MEMORY 0x2e7 |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 32 | #define MSR_PIC_MSG_CONTROL 0x2e |
| 33 | #define MSR_PLATFORM_INFO 0xce |
| 34 | #define PLATFORM_INFO_SET_TDP (1 << 29) |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 35 | |
| 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 Laurie | 4e4320f | 2012-06-25 09:53:58 -0700 | [diff] [blame] | 64 | #define PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */ |
| 65 | #define PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 66 | #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 Laurie | 77dbbac | 2012-06-25 09:51:59 -0700 | [diff] [blame] | 71 | #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 Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 78 | /* 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 Heymans | 67031a5 | 2018-02-05 19:08:03 +0100 | [diff] [blame] | 84 | /* |
| 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 Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 106 | #ifdef __SMM__ |
| 107 | /* Lock MSRs */ |
| 108 | void intel_model_206ax_finalize_smm(void); |
| 109 | #else |
| 110 | /* Configure power limits for turbo mode */ |
| 111 | void set_power_limits(u8 power_limit_1_time); |
Duncan Laurie | 77dbbac | 2012-06-25 09:51:59 -0700 | [diff] [blame] | 112 | int cpu_config_tdp_levels(void); |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 113 | #endif |
Patrick Rudolph | 74203de | 2017-11-20 11:57:01 +0100 | [diff] [blame] | 114 | int get_platform_id(void); |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 115 | |
| 116 | #endif |