Angel Pons | f5627e8 | 2020-04-05 15:46:52 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Pratik Prajapati | 9027e1b | 2017-08-23 17:37:43 -0700 | [diff] [blame] | 2 | |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 3 | #include <device/pci_ids.h> |
| 4 | #include <device/pci_ops.h> |
Pratik Prajapati | 9027e1b | 2017-08-23 17:37:43 -0700 | [diff] [blame] | 5 | #include <fsp/api.h> |
| 6 | #include <soc/ramstage.h> |
| 7 | #include <soc/vr_config.h> |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 8 | #include <console/console.h> |
| 9 | #include <intelblocks/cpulib.h> |
Pratik Prajapati | 9027e1b | 2017-08-23 17:37:43 -0700 | [diff] [blame] | 10 | |
| 11 | static const struct vr_config default_configs[NUM_VR_DOMAINS] = { |
Roy Mingi Park | 1ac2ad0 | 2019-02-13 11:10:45 -0800 | [diff] [blame] | 12 | [VR_SYSTEM_AGENT] = { |
| 13 | .vr_config_enable = 1, |
| 14 | .psi1threshold = VR_CFG_AMP(20), |
| 15 | .psi2threshold = VR_CFG_AMP(5), |
| 16 | .psi3threshold = VR_CFG_AMP(1), |
| 17 | .psi3enable = 1, |
| 18 | .psi4enable = 1, |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 19 | .imon_slope = 0, |
| 20 | .imon_offset = 0, |
| 21 | .icc_max = 0, |
Roy Mingi Park | 1ac2ad0 | 2019-02-13 11:10:45 -0800 | [diff] [blame] | 22 | .voltage_limit = 1520, |
| 23 | }, |
| 24 | [VR_IA_CORE] = { |
| 25 | .vr_config_enable = 1, |
| 26 | .psi1threshold = VR_CFG_AMP(20), |
| 27 | .psi2threshold = VR_CFG_AMP(5), |
| 28 | .psi3threshold = VR_CFG_AMP(1), |
| 29 | .psi3enable = 1, |
| 30 | .psi4enable = 1, |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 31 | .imon_slope = 0, |
| 32 | .imon_offset = 0, |
| 33 | .icc_max = 0, |
Roy Mingi Park | 1ac2ad0 | 2019-02-13 11:10:45 -0800 | [diff] [blame] | 34 | .voltage_limit = 1520, |
| 35 | }, |
| 36 | [VR_GT_UNSLICED] = { |
| 37 | .vr_config_enable = 1, |
| 38 | .psi1threshold = VR_CFG_AMP(20), |
| 39 | .psi2threshold = VR_CFG_AMP(5), |
| 40 | .psi3threshold = VR_CFG_AMP(1), |
| 41 | .psi3enable = 1, |
| 42 | .psi4enable = 1, |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 43 | .imon_slope = 0, |
| 44 | .imon_offset = 0, |
| 45 | .icc_max = 0, |
Roy Mingi Park | 1ac2ad0 | 2019-02-13 11:10:45 -0800 | [diff] [blame] | 46 | .voltage_limit = 1520, |
| 47 | }, |
| 48 | [VR_GT_SLICED] = { |
| 49 | .vr_config_enable = 1, |
| 50 | .psi1threshold = VR_CFG_AMP(20), |
| 51 | .psi2threshold = VR_CFG_AMP(5), |
| 52 | .psi3threshold = VR_CFG_AMP(1), |
| 53 | .psi3enable = 1, |
| 54 | .psi4enable = 1, |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 55 | .imon_slope = 0, |
| 56 | .imon_offset = 0, |
| 57 | .icc_max = 0, |
Roy Mingi Park | 1ac2ad0 | 2019-02-13 11:10:45 -0800 | [diff] [blame] | 58 | .voltage_limit = 1520, |
| 59 | }, |
Pratik Prajapati | 9027e1b | 2017-08-23 17:37:43 -0700 | [diff] [blame] | 60 | }; |
| 61 | |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 62 | struct vr_lookup_item { |
| 63 | uint16_t tdp_min; |
| 64 | enum chip_pl2_4_cfg pl2_4_cfg; /* Use 'value_not_set' for don't care */ |
| 65 | uint16_t conf[NUM_VR_DOMAINS]; |
| 66 | }; |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 67 | |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 68 | struct vr_lookup { |
| 69 | uint16_t mchid; |
| 70 | uint8_t num_items; |
| 71 | const struct vr_lookup_item *items; |
| 72 | }; |
| 73 | |
| 74 | #define VR_CONFIG(x, y) \ |
| 75 | static const struct vr_lookup_item vr_config_##x##_##y[] = |
| 76 | #define VR_CONFIG_ICC(x) VR_CONFIG(x, ICC) |
| 77 | #define VR_CONFIG_LL(x) VR_CONFIG(x, LL) |
| 78 | #define VR_CONFIG_TDC(x) VR_CONFIG(x, TDC) |
| 79 | |
| 80 | #define VR_REFITEM(x, y) { x, ARRAY_SIZE(vr_config_##x##_##y), vr_config_##x##_##y} |
| 81 | #define VR_REFITEM_ICC(x) VR_REFITEM(x, ICC) |
| 82 | #define VR_REFITEM_LL(x) VR_REFITEM(x, LL) |
| 83 | #define VR_REFITEM_TDC(x) VR_REFITEM(x, TDC) |
| 84 | |
| 85 | static uint16_t load_table(const struct vr_lookup *tbl, |
| 86 | const int tbl_entries, |
| 87 | const int domain, |
| 88 | const uint16_t tdp, |
| 89 | const uint16_t mch_id) |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 90 | { |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 91 | const config_t *cfg = config_of_soc(); |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 92 | |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 93 | for (size_t i = 0; i < tbl_entries; i++) { |
| 94 | if (tbl[i].mchid != mch_id) |
| 95 | continue; |
| 96 | |
| 97 | for (size_t j = 0; j < tbl[i].num_items; j++) { |
| 98 | if (tbl[i].items[j].tdp_min > tdp) |
| 99 | continue; |
| 100 | |
| 101 | if ((tbl[i].items[j].pl2_4_cfg != value_not_set) && |
| 102 | (tbl[i].items[j].pl2_4_cfg != cfg->cpu_pl2_4_cfg)) |
| 103 | continue; |
| 104 | |
| 105 | return tbl[i].items[j].conf[domain]; |
| 106 | } |
| 107 | break; |
| 108 | } |
| 109 | |
| 110 | printk(BIOS_ERR, "ERROR: Unknown MCH (0x%x) in %s\n", mch_id, __func__); |
| 111 | |
| 112 | return 0; |
| 113 | } |
| 114 | |
| 115 | /* |
| 116 | * Iccmax table from Doc #337344 Section 7.2 DC Specifications for CFL. |
| 117 | * Iccmax table from Doc #338023 Section 7.2 DC Specifications for WHL. |
| 118 | * Iccmax table from Doc #606599 Section 7.2 DC Specifications for CML. |
| 119 | * |
| 120 | * Platform Segment SA IA GT (GT/GTx) |
| 121 | * --------------------------------------------------------------------- |
| 122 | * CFL-U (28W) GT3 quad 8.5 64 64 |
| 123 | * CFL-U (28W) GT3 dual 8.5 64 64 |
| 124 | * |
| 125 | * CFL-H (45W) GT2 hex 11.1 128 0 |
| 126 | * CFL-H (45W) GT2 quad 11.1 86 0 |
| 127 | * |
| 128 | * CFL-S (95W) GT2 octa 11.1 193 45 |
| 129 | * |
| 130 | * CFL-S (95W) GT2 hex 11.1 138 45 |
| 131 | * CFL-S (65W) GT2 hex 11.1 133 45 |
| 132 | * CFL-S (80W) GT2 hex 11.1 133 45 |
| 133 | * CFL-S (35W) GT2 hex 11.1 104 35 |
| 134 | * |
| 135 | * CFL-S (91W) GT2 quad 11.1 100 45 |
| 136 | * CFL-S (83W) GT2 quad 11.1 100 45 |
| 137 | * CFL-S (71W) GT2 quad 11.1 100 45 |
| 138 | * CFL-S (65W) GT2 quad 11.1 79 45 |
| 139 | * CFL-S (62W) GT2 quad 11.1 79 45 |
| 140 | * CFL-S (35W) GT2 quad 11.1 66 35 |
| 141 | * |
| 142 | * CFL-S (58W) GT2 dual 11.1 79 45 |
| 143 | * CFL-S (54W) GT2 dual 11.1 58 45 |
| 144 | * CFL-S (35W) GT2 dual 11.1 40 35 |
| 145 | * |
| 146 | * CNL-U (15W) 13 34 0 |
| 147 | * |
| 148 | * WHL-U (15W) GT2 quad 6 70 31 |
| 149 | * WHL-U (15W) GT2 dual 6 35 31 |
| 150 | * |
| 151 | * CML-U v1/v2 (15W) GT2 hex 6 85(70) 31 |
| 152 | * CML-U v1/v2 (15W) GT2 quad 6 85(70) 31 |
| 153 | * CML-U v1/v2 (15W) GT2 dual 6 35 31 |
| 154 | * |
| 155 | * CML-H (65W) GT2 octa 11.1 192(165) 32 |
| 156 | * CML-H (45W) GT2 octa 11.1 165(140) 32 |
| 157 | * CML-H (45W) GT2 hex 11.1 140(128) 32 |
| 158 | * CML-H (45W) GT2 quad 11.1 105(86) 32 |
| 159 | * |
| 160 | * CML-S (125W)GT2 deca 11.1 245(210) 35 |
| 161 | * CML-S (125W)GT2 octa 11.1 245(210) 35 |
| 162 | * CML-S (125W)GT2 hex 11.1 140 35 |
| 163 | * CML-S XeonW (80W) GT2 deca 11.1 210 35 |
| 164 | * CML-S XeonW (80W) GT2 octa 11.1 210 35 |
| 165 | * CML-S XeonW (80W) GT2 hex 11.1 140 35 |
| 166 | * CML-S (65W) GT2 deca 11.1 210(175) 35 |
| 167 | * CML-S (65W) GT2 octa 11.1 210(175) 35 |
| 168 | * CML-S (65W) GT2 hex 11.1 140 35 |
| 169 | * CML-S (35W) GT2 deca 11.1 140(104) 35 |
| 170 | * CML-S (35W) GT2 octa 11.1 140(104) 35 |
| 171 | * CML-S (35W) GT2 hex 11.1 104 35 |
Gaggery Tsai | 8d12784 | 2020-01-08 15:35:11 -0800 | [diff] [blame] | 172 | * CML-S (65W) GT2 quad 11.1 102 35 |
| 173 | * CML-S (35W) GT2 quad 11.1 65 35 |
| 174 | * CML-S (58W) GT2 dual 11.1 60 35 |
| 175 | * CML-S (35W) GT2 dual 11.1 55 35 |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 176 | * |
| 177 | * GT0 versions are the same as GT2/GT3, but have GT/GTx set to 0. |
| 178 | * The above values in () are for baseline. |
| 179 | */ |
| 180 | |
| 181 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CNL_ID_U) { |
| 182 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(13, 34, 0, 0) }, |
| 183 | }; |
| 184 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CNL_ID_Y) { |
| 185 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(13, 34, 0, 0) }, |
| 186 | }; |
| 187 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_WHL_ID_W_4) { |
| 188 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(6, 70, 31, 31) }, |
| 189 | }; |
| 190 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_WHL_ID_W_2) { |
| 191 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(6, 35, 31, 31) }, |
| 192 | }; |
| 193 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_U) { |
| 194 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(8.5, 64, 64, 64) }, |
| 195 | }; |
| 196 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_U_2) { |
| 197 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(8.5, 64, 64, 64) }, |
| 198 | }; |
| 199 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_H_8) { /* undocumented */ |
| 200 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 128, 0, 0) }, |
| 201 | }; |
| 202 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_H) { |
| 203 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 128, 0, 0) }, |
| 204 | }; |
| 205 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_H_4) { |
| 206 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 86, 0, 0) }, |
| 207 | }; |
| 208 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_2) { |
| 209 | { 58, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 79, 35, 35) }, |
| 210 | { 54, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 58, 45, 45) }, |
| 211 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 40, 35, 35) }, |
| 212 | }; |
Angel Pons | 16c06c2 | 2020-11-11 10:39:20 +0100 | [diff] [blame] | 213 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_4) { |
| 214 | { 71, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 100, 45, 45) }, |
| 215 | { 62, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 79, 45, 45) }, |
| 216 | { 35, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 66, 35, 35) }, |
| 217 | }; |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 218 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_8) { |
Patrick Rudolph | c59d9e3 | 2020-05-22 12:13:43 +0200 | [diff] [blame] | 219 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 193, 45, 45) }, |
| 220 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 186, 45, 45) }, |
| 221 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 35, 35) }, |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 222 | }; |
| 223 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_8) { |
Patrick Rudolph | c59d9e3 | 2020-05-22 12:13:43 +0200 | [diff] [blame] | 224 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 193, 45, 45) }, |
| 225 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 186, 45, 45) }, |
| 226 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 35, 35) }, |
| 227 | }; |
| 228 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_8) { |
| 229 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 193, 45, 45) }, |
| 230 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 186, 45, 45) }, |
| 231 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 35, 35) }, |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 232 | }; |
| 233 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S) { |
| 234 | { 95, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 138, 45, 45) }, |
| 235 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 133, 45, 45) }, |
| 236 | { 54, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 45, 45) }, |
| 237 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 35, 35) }, |
| 238 | }; |
| 239 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_6) { |
| 240 | { 95, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 138, 45, 45) }, |
| 241 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 133, 45, 45) }, |
| 242 | { 54, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 45, 45) }, |
| 243 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 35, 35) }, |
| 244 | }; |
| 245 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_6) { |
| 246 | { 95, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 138, 45, 45) }, |
| 247 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 133, 45, 45) }, |
| 248 | { 54, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 45, 45) }, |
| 249 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 35, 35) }, |
| 250 | }; |
| 251 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_4) { |
| 252 | { 71, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 100, 45, 45) }, |
| 253 | { 62, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 79, 45, 45) }, |
| 254 | { 54, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 66, 45, 45) }, |
| 255 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 66, 35, 35) }, |
| 256 | }; |
| 257 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_ULT) { |
| 258 | { 0, performance, VR_CFG_ALL_DOMAINS_ICC(6, 85, 31, 31) }, |
| 259 | { 0, baseline, VR_CFG_ALL_DOMAINS_ICC(6, 70, 31, 31) }, |
| 260 | }; |
| 261 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_ULT_6_2) { |
| 262 | { 0, performance, VR_CFG_ALL_DOMAINS_ICC(6, 85, 31, 31) }, |
| 263 | { 0, baseline, VR_CFG_ALL_DOMAINS_ICC(6, 70, 31, 31) }, |
| 264 | }; |
| 265 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_ULT_2_2) { |
| 266 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(6, 35, 31, 31) }, |
| 267 | }; |
| 268 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_H_8_2) { |
| 269 | { 65, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 165, 32, 32) }, |
| 270 | { 65, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 192, 32, 32) }, |
| 271 | { 0, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 140, 32, 32) }, |
| 272 | { 0, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 165, 32, 32) }, |
| 273 | }; |
| 274 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_H) { |
| 275 | { 0, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 140, 32, 32) }, |
| 276 | { 0, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 140, 32, 32) }, |
| 277 | }; |
| 278 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_H_4_2) { |
| 279 | { 0, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 105, 32, 32) }, |
| 280 | { 0, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 86, 32, 32) }, |
| 281 | }; |
| 282 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_S_P0P1_8_2) { |
| 283 | {125, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 245, 35, 35) }, |
| 284 | {125, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 210, 35, 35) }, |
| 285 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 210, 35, 35) }, |
| 286 | { 65, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 210, 35, 35) }, |
| 287 | { 65, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 175, 35, 35) }, |
| 288 | { 0, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 140, 35, 35) }, |
| 289 | { 0, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 35, 35) }, |
| 290 | }; |
| 291 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_S_P0P1_10_2) { |
| 292 | {125, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 245, 35, 35) }, |
| 293 | {125, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 210, 35, 35) }, |
| 294 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 210, 35, 35) }, |
| 295 | { 65, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 210, 35, 35) }, |
| 296 | { 65, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 175, 35, 35) }, |
| 297 | { 0, performance, VR_CFG_ALL_DOMAINS_ICC(11.1, 140, 35, 35) }, |
| 298 | { 0, baseline, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 35, 35) }, |
| 299 | }; |
| 300 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_P0P1_6_2) { |
| 301 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 140, 35, 35) }, |
| 302 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 104, 35, 35) }, |
| 303 | }; |
Gaggery Tsai | 8d12784 | 2020-01-08 15:35:11 -0800 | [diff] [blame] | 304 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_4) { |
| 305 | { 36, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 102, 35, 35) }, |
| 306 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 65, 35, 35) }, |
| 307 | }; |
| 308 | VR_CONFIG_ICC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_2) { |
| 309 | { 36, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 60, 35, 35) }, |
| 310 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_ICC(11.1, 55, 35, 35) }, |
| 311 | }; |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 312 | |
| 313 | static const struct vr_lookup vr_config_icc[] = { |
| 314 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CNL_ID_U), |
| 315 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CNL_ID_Y), |
| 316 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_WHL_ID_W_4), |
| 317 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_WHL_ID_W_2), |
| 318 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_U), |
| 319 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_U_2), |
| 320 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_H_8), |
| 321 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_H), |
| 322 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_H_4), |
| 323 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_2), |
Angel Pons | 16c06c2 | 2020-11-11 10:39:20 +0100 | [diff] [blame] | 324 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_4), |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 325 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_8), |
| 326 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_8), |
Patrick Rudolph | c59d9e3 | 2020-05-22 12:13:43 +0200 | [diff] [blame] | 327 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_8), |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 328 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S), |
| 329 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_6), |
| 330 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_6), |
| 331 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_4), |
| 332 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_ULT), |
| 333 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_ULT_6_2), |
| 334 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_ULT_2_2), |
| 335 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_H_8_2), |
| 336 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_H), |
| 337 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_H_4_2), |
| 338 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_S_P0P1_8_2), |
| 339 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_S_P0P1_10_2), |
| 340 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_P0P1_6_2), |
Gaggery Tsai | 8d12784 | 2020-01-08 15:35:11 -0800 | [diff] [blame] | 341 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_4), |
| 342 | VR_REFITEM_ICC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_2), |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 343 | }; |
| 344 | |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 345 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CNL_ID_U) { |
| 346 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.4, 2.0, 2.0) }, |
| 347 | }; |
| 348 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CNL_ID_Y) { |
| 349 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.4, 2.0, 2.0) }, |
| 350 | }; |
| 351 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_WHL_ID_W_4) { /* unspecified */ |
| 352 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.8, 0, 0) }, |
| 353 | }; |
| 354 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_WHL_ID_W_2) { /* unspecified */ |
| 355 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.4, 0, 0) }, |
| 356 | }; |
| 357 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_U) { |
| 358 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.4, 2.0, 2.0) }, |
| 359 | }; |
| 360 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_U_2) { |
| 361 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.4, 2.0, 2.0) }, |
| 362 | }; |
| 363 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_H_8) { |
| 364 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.8, 2.7, 2.7) }, |
| 365 | }; |
| 366 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_H) { |
| 367 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.8, 2.7, 2.7) }, |
| 368 | }; |
| 369 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_H_4) { |
| 370 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.8, 2.7, 2.7) }, |
| 371 | }; |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 372 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_4) { |
| 373 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.1, 3.1, 3.1) }, |
| 374 | }; |
| 375 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_4) { |
| 376 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.1, 3.1, 3.1) }, |
| 377 | }; |
| 378 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_2) { |
| 379 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.1, 3.1, 3.1) }, |
| 380 | }; |
| 381 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_8) { |
| 382 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.6, 3.1, 3.1) }, |
| 383 | }; |
| 384 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_8) { |
| 385 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.6, 3.1, 3.1) }, |
| 386 | }; |
Patrick Rudolph | c59d9e3 | 2020-05-22 12:13:43 +0200 | [diff] [blame] | 387 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_8) { |
| 388 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.6, 3.1, 3.1) }, |
| 389 | }; |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 390 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S) { |
| 391 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.1, 3.1, 3.1) }, |
| 392 | }; |
| 393 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_6) { |
| 394 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.1, 3.1, 3.1) }, |
| 395 | }; |
| 396 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_6) { |
| 397 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.1, 3.1, 3.1) }, |
| 398 | }; |
| 399 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_4) { |
| 400 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.1, 3.1, 3.1) }, |
| 401 | }; |
| 402 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_ULT) { |
| 403 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.8, 3.1, 3.1) }, |
| 404 | }; |
| 405 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_ULT_6_2) { |
| 406 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.8, 3.1, 3.1) }, |
| 407 | }; |
| 408 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_ULT_2_2) { |
| 409 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 2.4, 3.1, 3.1) }, |
| 410 | }; |
| 411 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_H_8_2) { |
| 412 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.1, 2.7, 2.7) }, |
| 413 | }; |
| 414 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_H) { |
| 415 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.1, 2.7, 2.7) }, |
| 416 | }; |
| 417 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_H_4_2) { |
| 418 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.1, 2.7, 2.7) }, |
| 419 | }; |
| 420 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_S_P0P1_8_2) { |
| 421 | { 36, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.1, 4.0, 4.0) }, |
| 422 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.7, 4.0, 4.0) }, |
| 423 | }; |
| 424 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_S_P0P1_10_2) { |
| 425 | { 36, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.1, 4.0, 4.0) }, |
| 426 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.7, 4.0, 4.0) }, |
| 427 | }; |
| 428 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_S_G0G1_P0P1_6_2) { |
| 429 | {125, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.1, 4.0, 4.0) }, |
| 430 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.7, 4.0, 4.0) }, |
| 431 | }; |
Gaggery Tsai | 8d12784 | 2020-01-08 15:35:11 -0800 | [diff] [blame] | 432 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_S_G0G1_4) { |
| 433 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.7, 4.0, 4.0) }, |
| 434 | }; |
| 435 | VR_CONFIG_LL(PCI_DEVICE_ID_INTEL_CML_S_G0G1_2) { |
| 436 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_LOADLINE(10.3, 1.7, 4.0, 4.0) }, |
| 437 | }; |
| 438 | |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 439 | |
| 440 | static const struct vr_lookup vr_config_ll[] = { |
| 441 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CNL_ID_U), |
| 442 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CNL_ID_Y), |
| 443 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_WHL_ID_W_4), |
| 444 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_WHL_ID_W_2), |
| 445 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_U), |
| 446 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_U_2), |
| 447 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_H_8), |
| 448 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_H), |
| 449 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_H_4), |
| 450 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_4), |
| 451 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_4), |
| 452 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_2), |
| 453 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_8), |
| 454 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_8), |
Patrick Rudolph | c59d9e3 | 2020-05-22 12:13:43 +0200 | [diff] [blame] | 455 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_8), |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 456 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S), |
| 457 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_6), |
| 458 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_6), |
| 459 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_4), |
| 460 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_ULT), |
| 461 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_ULT_6_2), |
| 462 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_ULT_2_2), |
| 463 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_H_8_2), |
| 464 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_H), |
| 465 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_H_4_2), |
| 466 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_S_P0P1_8_2), |
| 467 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_S_P0P1_10_2), |
| 468 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_S_G0G1_P0P1_6_2), |
Gaggery Tsai | 8d12784 | 2020-01-08 15:35:11 -0800 | [diff] [blame] | 469 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_S_G0G1_4), |
| 470 | VR_REFITEM_LL(PCI_DEVICE_ID_INTEL_CML_S_G0G1_2), |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 471 | }; |
| 472 | |
Patrick Rudolph | c59d9e3 | 2020-05-22 12:13:43 +0200 | [diff] [blame] | 473 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S) { |
| 474 | { 58, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 33, 30, 30) }, |
| 475 | { 54, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 31, 30, 30) }, |
| 476 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 29, 25, 25) }, |
| 477 | }; |
| 478 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_2) { |
| 479 | { 58, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 33, 30, 30) }, |
| 480 | { 54, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 31, 30, 30) }, |
| 481 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 29, 25, 25) }, |
| 482 | }; |
| 483 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_4) { |
| 484 | { 71, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 70, 30, 30) }, |
| 485 | { 62, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 62, 30, 30) }, |
| 486 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 45, 25, 25) }, |
| 487 | }; |
| 488 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_4) { |
| 489 | { 71, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 70, 30, 30) }, |
| 490 | { 62, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 62, 30, 30) }, |
| 491 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 45, 25, 25) }, |
| 492 | }; |
| 493 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_4) { |
| 494 | { 71, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 70, 30, 30) }, |
| 495 | { 62, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 62, 30, 30) }, |
| 496 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 45, 25, 25) }, |
| 497 | }; |
| 498 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_6) { |
| 499 | { 95, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 100, 30, 30) }, |
| 500 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 89, 30, 30) }, |
| 501 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 91, 30, 30) }, |
| 502 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 74, 25, 25) }, |
| 503 | }; |
| 504 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_6) { |
| 505 | { 95, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 100, 30, 30) }, |
| 506 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 89, 30, 30) }, |
| 507 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 91, 30, 30) }, |
| 508 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 74, 25, 25) }, |
| 509 | }; |
| 510 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_8) { |
| 511 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 150, 30, 30) }, |
| 512 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 146, 30, 30) }, |
| 513 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 74, 25, 25) }, |
| 514 | }; |
| 515 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_8) { |
| 516 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 150, 30, 30) }, |
| 517 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 146, 30, 30) }, |
| 518 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 74, 25, 25) }, |
| 519 | }; |
| 520 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_8) { |
| 521 | { 80, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 150, 30, 30) }, |
| 522 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 146, 30, 30) }, |
| 523 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 74, 25, 25) }, |
| 524 | }; |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 525 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_ULT) { |
| 526 | { 0, baseline, VR_CFG_ALL_DOMAINS_TDC(4, 48, 22, 22) }, |
| 527 | { 0, performance, VR_CFG_ALL_DOMAINS_TDC(4, 58, 22, 22) }, |
| 528 | }; |
| 529 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_ULT_6_2) { |
| 530 | { 0, baseline, VR_CFG_ALL_DOMAINS_TDC(4, 48, 22, 22) }, |
| 531 | { 0, performance, VR_CFG_ALL_DOMAINS_TDC(4, 58, 22, 22) }, |
| 532 | }; |
| 533 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_ULT_2_2) { |
| 534 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(4, 24, 22, 22) }, |
| 535 | }; |
| 536 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_H_8_2) { |
| 537 | { 65, performance, VR_CFG_ALL_DOMAINS_TDC(10, 146, 25, 25) }, |
| 538 | { 65, baseline, VR_CFG_ALL_DOMAINS_TDC(10, 117, 25, 25) }, |
| 539 | { 0, performance, VR_CFG_ALL_DOMAINS_TDC(10, 125, 25, 25) }, |
| 540 | { 0, baseline, VR_CFG_ALL_DOMAINS_TDC(10, 86, 25, 25) }, |
| 541 | }; |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 542 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_H) { |
| 543 | { 0, performance, VR_CFG_ALL_DOMAINS_TDC(10, 92, 25, 25) }, |
| 544 | { 0, baseline, VR_CFG_ALL_DOMAINS_TDC(10, 80, 25, 25) }, |
| 545 | }; |
| 546 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_H_4_2) { |
| 547 | { 0, performance, VR_CFG_ALL_DOMAINS_TDC(10, 80, 25, 25) }, |
| 548 | { 0, baseline, VR_CFG_ALL_DOMAINS_TDC(10, 60, 25, 25) }, |
| 549 | }; |
| 550 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_S_P0P1_8_2) { |
| 551 | { 36, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 175, 28, 28) }, |
| 552 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 100, 28, 28) }, |
| 553 | }; |
| 554 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_S_P0P1_10_2) { |
| 555 | { 36, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 175, 28, 28) }, |
| 556 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 100, 28, 28) }, |
| 557 | }; |
| 558 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_P0P1_6_2) { |
| 559 | {125, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 132, 28, 28) }, |
| 560 | { 65, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 104, 28, 28) }, |
| 561 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 74, 28, 28) }, |
| 562 | }; |
Gaggery Tsai | 8d12784 | 2020-01-08 15:35:11 -0800 | [diff] [blame] | 563 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_4) { |
| 564 | { 36, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 68, 28, 28) }, |
| 565 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 42, 28, 28) }, |
| 566 | }; |
| 567 | VR_CONFIG_TDC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_2) { |
| 568 | { 36, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 38, 28, 28) }, |
| 569 | { 0, value_not_set, VR_CFG_ALL_DOMAINS_TDC(10, 25, 28, 28) }, |
| 570 | }; |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 571 | |
| 572 | static const struct vr_lookup vr_config_tdc[] = { |
Patrick Rudolph | c59d9e3 | 2020-05-22 12:13:43 +0200 | [diff] [blame] | 573 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S), |
| 574 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_2), |
| 575 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_4), |
| 576 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_4), |
| 577 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_4), |
| 578 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_6), |
| 579 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_6), |
| 580 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_S_8), |
| 581 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_WS_8), |
| 582 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CFL_ID_S_DT_8), |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 583 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_ULT), |
| 584 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_ULT_6_2), |
| 585 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_ULT_2_2), |
| 586 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_H_8_2), |
| 587 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_H), |
| 588 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_H_4_2), |
| 589 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_S_P0P1_8_2), |
| 590 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_S_P0P1_10_2), |
| 591 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_P0P1_6_2), |
Gaggery Tsai | 8d12784 | 2020-01-08 15:35:11 -0800 | [diff] [blame] | 592 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_4), |
| 593 | VR_REFITEM_TDC(PCI_DEVICE_ID_INTEL_CML_S_G0G1_2), |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 594 | }; |
| 595 | |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 596 | static uint16_t get_sku_voltagelimit(int domain) |
| 597 | { |
| 598 | return 1520; |
| 599 | } |
| 600 | |
| 601 | static uint16_t get_sku_icc_max(const int domain, |
| 602 | const uint16_t tdp, |
| 603 | const uint16_t mch_id, |
| 604 | const uint16_t igd_id) |
| 605 | { |
| 606 | if (igd_id == 0xffff && ((domain == VR_GT_SLICED) || (domain == VR_GT_UNSLICED))) |
| 607 | return 0; |
| 608 | |
| 609 | return load_table(vr_config_icc, ARRAY_SIZE(vr_config_icc), domain, tdp, mch_id); |
| 610 | } |
| 611 | |
| 612 | void fill_vr_domain_config(void *params, |
| 613 | int domain, const struct vr_config *chip_cfg) |
| 614 | { |
| 615 | FSP_S_CONFIG *vr_params = (FSP_S_CONFIG *)params; |
| 616 | const struct vr_config *cfg; |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 617 | static uint16_t mch_id = 0, igd_id = 0; |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 618 | const uint16_t tdp = cpu_get_power_max(); |
| 619 | |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 620 | if (!mch_id) { |
| 621 | struct device *dev = pcidev_path_on_root(SA_DEVFN_ROOT); |
| 622 | mch_id = dev ? pci_read_config16(dev, PCI_DEVICE_ID) : 0xffff; |
| 623 | } |
| 624 | if (!igd_id) { |
| 625 | struct device *dev = pcidev_path_on_root(SA_DEVFN_IGD); |
| 626 | igd_id = dev ? pci_read_config16(dev, PCI_DEVICE_ID) : 0xffff; |
| 627 | } |
| 628 | |
Pratik Prajapati | 9027e1b | 2017-08-23 17:37:43 -0700 | [diff] [blame] | 629 | if (domain < 0 || domain >= NUM_VR_DOMAINS) |
| 630 | return; |
| 631 | |
| 632 | /* Use device tree override if requested. */ |
| 633 | if (chip_cfg->vr_config_enable) |
| 634 | cfg = chip_cfg; |
| 635 | else |
| 636 | cfg = &default_configs[domain]; |
| 637 | |
| 638 | vr_params->VrConfigEnable[domain] = cfg->vr_config_enable; |
| 639 | vr_params->Psi1Threshold[domain] = cfg->psi1threshold; |
| 640 | vr_params->Psi2Threshold[domain] = cfg->psi2threshold; |
| 641 | vr_params->Psi3Threshold[domain] = cfg->psi3threshold; |
| 642 | vr_params->Psi3Enable[domain] = cfg->psi3enable; |
| 643 | vr_params->Psi4Enable[domain] = cfg->psi4enable; |
| 644 | vr_params->ImonSlope[domain] = cfg->imon_slope; |
| 645 | vr_params->ImonOffset[domain] = cfg->imon_offset; |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 646 | |
| 647 | /* If board provided non-zero value, use it. */ |
| 648 | if (cfg->voltage_limit) |
| 649 | vr_params->VrVoltageLimit[domain] = cfg->voltage_limit; |
| 650 | else |
| 651 | vr_params->VrVoltageLimit[domain] = get_sku_voltagelimit(domain); |
| 652 | |
| 653 | if (cfg->icc_max) |
| 654 | vr_params->IccMax[domain] = cfg->icc_max; |
| 655 | else |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 656 | vr_params->IccMax[domain] = get_sku_icc_max(domain, tdp, mch_id, igd_id); |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 657 | |
| 658 | if (cfg->ac_loadline) |
| 659 | vr_params->AcLoadline[domain] = cfg->ac_loadline; |
| 660 | else |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 661 | vr_params->AcLoadline[domain] = load_table(vr_config_ll, |
| 662 | ARRAY_SIZE(vr_config_ll), |
| 663 | domain, tdp, mch_id); |
Patrick Rudolph | 9b5447b | 2019-12-04 13:51:00 +0100 | [diff] [blame] | 664 | |
| 665 | if (cfg->dc_loadline) |
| 666 | vr_params->DcLoadline[domain] = cfg->dc_loadline; |
| 667 | else |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 668 | vr_params->DcLoadline[domain] = load_table(vr_config_ll, |
| 669 | ARRAY_SIZE(vr_config_ll), |
| 670 | domain, tdp, mch_id); |
Marx Wang | 9318d6d | 2020-02-07 16:44:14 +0800 | [diff] [blame] | 671 | |
| 672 | vr_params->TdcEnable[domain] = !cfg->tdc_disable; |
| 673 | |
| 674 | if (cfg->tdc_powerlimit) |
| 675 | vr_params->TdcPowerLimit[domain] = cfg->tdc_powerlimit; |
| 676 | else |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 677 | vr_params->TdcPowerLimit[domain] = load_table(vr_config_tdc, |
| 678 | ARRAY_SIZE(vr_config_tdc), |
| 679 | domain, tdp, mch_id); |
Pratik Prajapati | 9027e1b | 2017-08-23 17:37:43 -0700 | [diff] [blame] | 680 | } |