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. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 19 | * MA 02110-1301 USA |
| 20 | */ |
| 21 | |
| 22 | #ifndef _CPU_INTEL_MODEL_206AX_H |
| 23 | #define _CPU_INTEL_MODEL_206AX_H |
| 24 | |
Stefan Reinauer | c0f2cfb | 2012-07-10 17:16:10 -0700 | [diff] [blame] | 25 | /* SandyBridge/IvyBridge bus clock is fixed at 100MHz */ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 26 | #define SANDYBRIDGE_BCLK 100 |
| 27 | |
| 28 | #define IA32_FEATURE_CONTROL 0x3a |
| 29 | #define CPUID_VMX (1 << 5) |
| 30 | #define CPUID_SMX (1 << 6) |
| 31 | #define MSR_FEATURE_CONFIG 0x13c |
Duncan Laurie | 22935e1 | 2012-07-09 09:58:35 -0700 | [diff] [blame] | 32 | #define MSR_FLEX_RATIO 0x194 |
| 33 | #define FLEX_RATIO_LOCK (1 << 20) |
| 34 | #define FLEX_RATIO_EN (1 << 16) |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 35 | #define IA32_PLATFORM_DCA_CAP 0x1f8 |
| 36 | #define IA32_MISC_ENABLE 0x1a0 |
| 37 | #define IA32_PERF_CTL 0x199 |
| 38 | #define IA32_THERM_INTERRUPT 0x19b |
| 39 | #define IA32_ENERGY_PERFORMANCE_BIAS 0x1b0 |
| 40 | #define ENERGY_POLICY_PERFORMANCE 0 |
| 41 | #define ENERGY_POLICY_NORMAL 6 |
| 42 | #define ENERGY_POLICY_POWERSAVE 15 |
| 43 | #define IA32_PACKAGE_THERM_INTERRUPT 0x1b2 |
| 44 | #define MSR_LT_LOCK_MEMORY 0x2e7 |
| 45 | #define IA32_MC0_STATUS 0x401 |
| 46 | |
| 47 | #define MSR_PIC_MSG_CONTROL 0x2e |
| 48 | #define MSR_PLATFORM_INFO 0xce |
| 49 | #define PLATFORM_INFO_SET_TDP (1 << 29) |
| 50 | #define MSR_PMG_CST_CONFIG_CONTROL 0xe2 |
| 51 | #define MSR_PMG_IO_CAPTURE_BASE 0xe4 |
| 52 | |
| 53 | #define MSR_MISC_PWR_MGMT 0x1aa |
| 54 | #define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0) |
| 55 | #define MSR_TURBO_RATIO_LIMIT 0x1ad |
| 56 | #define MSR_POWER_CTL 0x1fc |
| 57 | |
| 58 | #define MSR_PKGC3_IRTL 0x60a |
| 59 | #define MSR_PKGC6_IRTL 0x60b |
| 60 | #define MSR_PKGC7_IRTL 0x60c |
| 61 | #define IRTL_VALID (1 << 15) |
| 62 | #define IRTL_1_NS (0 << 10) |
| 63 | #define IRTL_32_NS (1 << 10) |
| 64 | #define IRTL_1024_NS (2 << 10) |
| 65 | #define IRTL_32768_NS (3 << 10) |
| 66 | #define IRTL_1048576_NS (4 << 10) |
| 67 | #define IRTL_33554432_NS (5 << 10) |
| 68 | #define IRTL_RESPONSE_MASK (0x3ff) |
| 69 | |
| 70 | /* long duration in low dword, short duration in high dword */ |
| 71 | #define MSR_PKG_POWER_LIMIT 0x610 |
| 72 | #define PKG_POWER_LIMIT_MASK 0x7fff |
| 73 | #define PKG_POWER_LIMIT_EN (1 << 15) |
| 74 | #define PKG_POWER_LIMIT_CLAMP (1 << 16) |
| 75 | #define PKG_POWER_LIMIT_TIME_SHIFT 17 |
| 76 | #define PKG_POWER_LIMIT_TIME_MASK 0x7f |
| 77 | |
| 78 | #define MSR_PP0_CURRENT_CONFIG 0x601 |
| 79 | #define PP0_CURRENT_LIMIT (112 << 3) /* 112 A */ |
| 80 | #define MSR_PP1_CURRENT_CONFIG 0x602 |
Duncan Laurie | 4e4320f | 2012-06-25 09:53:58 -0700 | [diff] [blame] | 81 | #define PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */ |
| 82 | #define PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 83 | #define MSR_PKG_POWER_SKU_UNIT 0x606 |
| 84 | #define MSR_PKG_POWER_SKU 0x614 |
| 85 | #define MSR_PP0_POWER_LIMIT 0x638 |
| 86 | #define MSR_PP1_POWER_LIMIT 0x640 |
| 87 | |
Duncan Laurie | 77dbbac | 2012-06-25 09:51:59 -0700 | [diff] [blame] | 88 | #define IVB_CONFIG_TDP_MIN_CPUID 0x306a2 |
| 89 | #define MSR_CONFIG_TDP_NOMINAL 0x648 |
| 90 | #define MSR_CONFIG_TDP_LEVEL1 0x649 |
| 91 | #define MSR_CONFIG_TDP_LEVEL2 0x64a |
| 92 | #define MSR_CONFIG_TDP_CONTROL 0x64b |
| 93 | #define MSR_TURBO_ACTIVATION_RATIO 0x64c |
| 94 | |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 95 | /* P-state configuration */ |
| 96 | #define PSS_MAX_ENTRIES 8 |
| 97 | #define PSS_RATIO_STEP 2 |
| 98 | #define PSS_LATENCY_TRANSITION 10 |
| 99 | #define PSS_LATENCY_BUSMASTER 10 |
| 100 | |
Duncan Laurie | 22935e1 | 2012-07-09 09:58:35 -0700 | [diff] [blame] | 101 | #ifndef __ROMCC__ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 102 | #ifdef __SMM__ |
| 103 | /* Lock MSRs */ |
| 104 | void intel_model_206ax_finalize_smm(void); |
| 105 | #else |
| 106 | /* Configure power limits for turbo mode */ |
| 107 | void set_power_limits(u8 power_limit_1_time); |
Duncan Laurie | 77dbbac | 2012-06-25 09:51:59 -0700 | [diff] [blame] | 108 | int cpu_config_tdp_levels(void); |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 109 | #endif |
Duncan Laurie | 22935e1 | 2012-07-09 09:58:35 -0700 | [diff] [blame] | 110 | #endif |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 111 | |
| 112 | #endif |