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 | |
Stefan Reinauer | c0f2cfb | 2012-07-10 17:16:10 -0700 | [diff] [blame] | 20 | /* SandyBridge/IvyBridge bus clock is fixed at 100MHz */ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 21 | #define SANDYBRIDGE_BCLK 100 |
| 22 | |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 23 | #define MSR_FEATURE_CONFIG 0x13c |
Duncan Laurie | 22935e1 | 2012-07-09 09:58:35 -0700 | [diff] [blame] | 24 | #define MSR_FLEX_RATIO 0x194 |
| 25 | #define FLEX_RATIO_LOCK (1 << 20) |
| 26 | #define FLEX_RATIO_EN (1 << 16) |
Duncan Laurie | 5563211 | 2012-07-16 12:19:00 -0700 | [diff] [blame] | 27 | #define MSR_TEMPERATURE_TARGET 0x1a2 |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 28 | #define MSR_LT_LOCK_MEMORY 0x2e7 |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 29 | #define MSR_PIC_MSG_CONTROL 0x2e |
| 30 | #define MSR_PLATFORM_INFO 0xce |
| 31 | #define PLATFORM_INFO_SET_TDP (1 << 29) |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 32 | |
| 33 | #define MSR_MISC_PWR_MGMT 0x1aa |
| 34 | #define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0) |
| 35 | #define MSR_TURBO_RATIO_LIMIT 0x1ad |
| 36 | #define MSR_POWER_CTL 0x1fc |
| 37 | |
| 38 | #define MSR_PKGC3_IRTL 0x60a |
| 39 | #define MSR_PKGC6_IRTL 0x60b |
| 40 | #define MSR_PKGC7_IRTL 0x60c |
| 41 | #define IRTL_VALID (1 << 15) |
| 42 | #define IRTL_1_NS (0 << 10) |
| 43 | #define IRTL_32_NS (1 << 10) |
| 44 | #define IRTL_1024_NS (2 << 10) |
| 45 | #define IRTL_32768_NS (3 << 10) |
| 46 | #define IRTL_1048576_NS (4 << 10) |
| 47 | #define IRTL_33554432_NS (5 << 10) |
| 48 | #define IRTL_RESPONSE_MASK (0x3ff) |
| 49 | |
| 50 | /* long duration in low dword, short duration in high dword */ |
| 51 | #define MSR_PKG_POWER_LIMIT 0x610 |
| 52 | #define PKG_POWER_LIMIT_MASK 0x7fff |
| 53 | #define PKG_POWER_LIMIT_EN (1 << 15) |
| 54 | #define PKG_POWER_LIMIT_CLAMP (1 << 16) |
| 55 | #define PKG_POWER_LIMIT_TIME_SHIFT 17 |
| 56 | #define PKG_POWER_LIMIT_TIME_MASK 0x7f |
| 57 | |
| 58 | #define MSR_PP0_CURRENT_CONFIG 0x601 |
| 59 | #define PP0_CURRENT_LIMIT (112 << 3) /* 112 A */ |
| 60 | #define MSR_PP1_CURRENT_CONFIG 0x602 |
Duncan Laurie | 4e4320f | 2012-06-25 09:53:58 -0700 | [diff] [blame] | 61 | #define PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */ |
| 62 | #define PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */ |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 63 | #define MSR_PKG_POWER_SKU_UNIT 0x606 |
| 64 | #define MSR_PKG_POWER_SKU 0x614 |
| 65 | #define MSR_PP0_POWER_LIMIT 0x638 |
| 66 | #define MSR_PP1_POWER_LIMIT 0x640 |
| 67 | |
Duncan Laurie | 77dbbac | 2012-06-25 09:51:59 -0700 | [diff] [blame] | 68 | #define IVB_CONFIG_TDP_MIN_CPUID 0x306a2 |
| 69 | #define MSR_CONFIG_TDP_NOMINAL 0x648 |
| 70 | #define MSR_CONFIG_TDP_LEVEL1 0x649 |
| 71 | #define MSR_CONFIG_TDP_LEVEL2 0x64a |
| 72 | #define MSR_CONFIG_TDP_CONTROL 0x64b |
| 73 | #define MSR_TURBO_ACTIVATION_RATIO 0x64c |
| 74 | |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 75 | /* P-state configuration */ |
| 76 | #define PSS_MAX_ENTRIES 8 |
| 77 | #define PSS_RATIO_STEP 2 |
| 78 | #define PSS_LATENCY_TRANSITION 10 |
| 79 | #define PSS_LATENCY_BUSMASTER 10 |
| 80 | |
Arthur Heymans | 67031a5 | 2018-02-05 19:08:03 +0100 | [diff] [blame] | 81 | /* |
| 82 | * Region of SMM space is reserved for multipurpose use. It falls below |
| 83 | * the IED region and above the SMM handler. |
| 84 | */ |
| 85 | #define RESERVED_SMM_SIZE CONFIG_SMM_RESERVED_SIZE |
| 86 | #define RESERVED_SMM_OFFSET \ |
| 87 | (CONFIG_SMM_TSEG_SIZE - CONFIG_IED_REGION_SIZE - RESERVED_SMM_SIZE) |
| 88 | |
| 89 | /* Sanity check config options. */ |
| 90 | #if (CONFIG_SMM_TSEG_SIZE <= (CONFIG_IED_REGION_SIZE + RESERVED_SMM_SIZE)) |
| 91 | # error "CONFIG_SMM_TSEG_SIZE <= (CONFIG_IED_REGION_SIZE + RESERVED_SMM_SIZE)" |
| 92 | #endif |
| 93 | #if (CONFIG_SMM_TSEG_SIZE < 0x800000) |
| 94 | # error "CONFIG_SMM_TSEG_SIZE must at least be 8MiB" |
| 95 | #endif |
| 96 | #if ((CONFIG_SMM_TSEG_SIZE & (CONFIG_SMM_TSEG_SIZE - 1)) != 0) |
| 97 | # error "CONFIG_SMM_TSEG_SIZE is not a power of 2" |
| 98 | #endif |
| 99 | #if ((CONFIG_IED_REGION_SIZE & (CONFIG_IED_REGION_SIZE - 1)) != 0) |
| 100 | # error "CONFIG_IED_REGION_SIZE is not a power of 2" |
| 101 | #endif |
| 102 | |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 103 | #ifdef __SMM__ |
| 104 | /* Lock MSRs */ |
| 105 | void intel_model_206ax_finalize_smm(void); |
| 106 | #else |
| 107 | /* Configure power limits for turbo mode */ |
| 108 | void set_power_limits(u8 power_limit_1_time); |
Duncan Laurie | 77dbbac | 2012-06-25 09:51:59 -0700 | [diff] [blame] | 109 | int cpu_config_tdp_levels(void); |
Arthur Heymans | 68f6888 | 2018-04-11 13:03:34 +0200 | [diff] [blame] | 110 | void smm_relocate(void); |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 111 | #endif |
Patrick Rudolph | 74203de | 2017-11-20 11:57:01 +0100 | [diff] [blame] | 112 | int get_platform_id(void); |
Stefan Reinauer | 5c55463 | 2012-04-04 00:09:50 +0200 | [diff] [blame] | 113 | |
| 114 | #endif |