Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2009 coresystems GmbH |
| 5 | * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License as |
| 9 | * published by the Free Software Foundation; version 2 of |
| 10 | * the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 20 | * MA 02110-1301 USA |
| 21 | */ |
| 22 | |
| 23 | #include <types.h> |
| 24 | #include <console/console.h> |
| 25 | #include <arch/acpi.h> |
| 26 | #include <arch/acpigen.h> |
| 27 | #include <arch/cpu.h> |
| 28 | #include <cpu/x86/msr.h> |
| 29 | #include <cpu/intel/speedstep.h> |
| 30 | #include <cpu/intel/turbo.h> |
| 31 | #include <device/device.h> |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 32 | #include "haswell.h" |
| 33 | #include "chip.h" |
| 34 | |
Duncan Laurie | 1ad5564 | 2013-03-07 14:08:04 -0800 | [diff] [blame] | 35 | #include <southbridge/intel/lynxpoint/pch.h> |
| 36 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 37 | static int get_cores_per_package(void) |
| 38 | { |
| 39 | struct cpuinfo_x86 c; |
| 40 | struct cpuid_result result; |
| 41 | int cores = 1; |
| 42 | |
| 43 | get_fms(&c, cpuid_eax(1)); |
| 44 | if (c.x86 != 6) |
| 45 | return 1; |
| 46 | |
| 47 | result = cpuid_ext(0xb, 1); |
| 48 | cores = result.ebx & 0xff; |
| 49 | |
| 50 | return cores; |
| 51 | } |
| 52 | |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 53 | static void generate_cstate_entries(acpi_cstate_t *cstates, |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 54 | int c1, int c2, int c3) |
| 55 | { |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 56 | int cstate_count = 0; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 57 | |
| 58 | /* Count number of active C-states */ |
| 59 | if (c1 > 0) |
| 60 | ++cstate_count; |
| 61 | if (c2 > 0) |
| 62 | ++cstate_count; |
| 63 | if (c3 > 0) |
| 64 | ++cstate_count; |
| 65 | if (!cstate_count) |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 66 | return; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 67 | |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 68 | acpigen_write_package(cstate_count + 1); |
| 69 | acpigen_write_byte(cstate_count); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 70 | |
| 71 | /* Add an entry if the level is enabled */ |
| 72 | if (c1 > 0) { |
| 73 | cstates[c1].ctype = 1; |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 74 | acpigen_write_CST_package_entry(&cstates[c1]); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 75 | } |
| 76 | if (c2 > 0) { |
| 77 | cstates[c2].ctype = 2; |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 78 | acpigen_write_CST_package_entry(&cstates[c2]); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 79 | } |
| 80 | if (c3 > 0) { |
| 81 | cstates[c3].ctype = 3; |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 82 | acpigen_write_CST_package_entry(&cstates[c3]); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 83 | } |
| 84 | |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 85 | acpigen_pop_len(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 86 | } |
| 87 | |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 88 | static void generate_C_state_entries(void) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 89 | { |
| 90 | struct cpu_info *info; |
| 91 | struct cpu_driver *cpu; |
Edward O'Callaghan | 2c9d2cf | 2014-10-27 23:29:29 +1100 | [diff] [blame] | 92 | struct device *lapic; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 93 | struct cpu_intel_haswell_config *conf = NULL; |
| 94 | |
| 95 | /* Find the SpeedStep CPU in the device tree using magic APIC ID */ |
| 96 | lapic = dev_find_lapic(SPEEDSTEP_APIC_MAGIC); |
| 97 | if (!lapic) |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 98 | return; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 99 | conf = lapic->chip_info; |
| 100 | if (!conf) |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 101 | return; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 102 | |
| 103 | /* Find CPU map of supported C-states */ |
| 104 | info = cpu_info(); |
| 105 | if (!info) |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 106 | return; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 107 | cpu = find_cpu_driver(info->cpu); |
| 108 | if (!cpu || !cpu->cstates) |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 109 | return; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 110 | |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 111 | acpigen_emit_byte(0x14); /* MethodOp */ |
| 112 | acpigen_write_len_f(); /* PkgLength */ |
| 113 | acpigen_emit_namestring("_CST"); |
| 114 | acpigen_emit_byte(0x00); /* No Arguments */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 115 | |
| 116 | /* If running on AC power */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 117 | acpigen_emit_byte(0xa0); /* IfOp */ |
| 118 | acpigen_write_len_f(); /* PkgLength */ |
| 119 | acpigen_emit_namestring("PWRS"); |
| 120 | acpigen_emit_byte(0xa4); /* ReturnOp */ |
| 121 | generate_cstate_entries(cpu->cstates, conf->c1_acpower, |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 122 | conf->c2_acpower, conf->c3_acpower); |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 123 | acpigen_pop_len(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 124 | |
| 125 | /* Else on battery power */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 126 | acpigen_emit_byte(0xa4); /* ReturnOp */ |
| 127 | generate_cstate_entries(cpu->cstates, conf->c1_battery, |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 128 | conf->c2_battery, conf->c3_battery); |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 129 | acpigen_pop_len(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | static acpi_tstate_t tss_table_fine[] = { |
| 133 | { 100, 1000, 0, 0x00, 0 }, |
| 134 | { 94, 940, 0, 0x1f, 0 }, |
| 135 | { 88, 880, 0, 0x1e, 0 }, |
| 136 | { 82, 820, 0, 0x1d, 0 }, |
| 137 | { 75, 760, 0, 0x1c, 0 }, |
| 138 | { 69, 700, 0, 0x1b, 0 }, |
| 139 | { 63, 640, 0, 0x1a, 0 }, |
| 140 | { 57, 580, 0, 0x19, 0 }, |
| 141 | { 50, 520, 0, 0x18, 0 }, |
| 142 | { 44, 460, 0, 0x17, 0 }, |
| 143 | { 38, 400, 0, 0x16, 0 }, |
| 144 | { 32, 340, 0, 0x15, 0 }, |
| 145 | { 25, 280, 0, 0x14, 0 }, |
| 146 | { 19, 220, 0, 0x13, 0 }, |
| 147 | { 13, 160, 0, 0x12, 0 }, |
| 148 | }; |
| 149 | |
| 150 | static acpi_tstate_t tss_table_coarse[] = { |
| 151 | { 100, 1000, 0, 0x00, 0 }, |
| 152 | { 88, 875, 0, 0x1f, 0 }, |
| 153 | { 75, 750, 0, 0x1e, 0 }, |
| 154 | { 63, 625, 0, 0x1d, 0 }, |
| 155 | { 50, 500, 0, 0x1c, 0 }, |
| 156 | { 38, 375, 0, 0x1b, 0 }, |
| 157 | { 25, 250, 0, 0x1a, 0 }, |
| 158 | { 13, 125, 0, 0x19, 0 }, |
| 159 | }; |
| 160 | |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 161 | static void generate_T_state_entries(int core, int cores_per_package) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 162 | { |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 163 | /* Indicate SW_ALL coordination for T-states */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 164 | acpigen_write_TSD_package(core, cores_per_package, SW_ALL); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 165 | |
| 166 | /* Indicate FFixedHW so OS will use MSR */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 167 | acpigen_write_empty_PTC(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 168 | |
| 169 | /* Set a T-state limit that can be modified in NVS */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 170 | acpigen_write_TPC("\\TLVL"); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 171 | |
| 172 | /* |
| 173 | * CPUID.(EAX=6):EAX[5] indicates support |
| 174 | * for extended throttle levels. |
| 175 | */ |
| 176 | if (cpuid_eax(6) & (1 << 5)) |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 177 | acpigen_write_TSS_package( |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 178 | ARRAY_SIZE(tss_table_fine), tss_table_fine); |
| 179 | else |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 180 | acpigen_write_TSS_package( |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 181 | ARRAY_SIZE(tss_table_coarse), tss_table_coarse); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | static int calculate_power(int tdp, int p1_ratio, int ratio) |
| 185 | { |
| 186 | u32 m; |
| 187 | u32 power; |
| 188 | |
| 189 | /* |
| 190 | * M = ((1.1 - ((p1_ratio - ratio) * 0.00625)) / 1.1) ^ 2 |
| 191 | * |
| 192 | * Power = (ratio / p1_ratio) * m * tdp |
| 193 | */ |
| 194 | |
| 195 | m = (110000 - ((p1_ratio - ratio) * 625)) / 11; |
| 196 | m = (m * m) / 1000; |
| 197 | |
| 198 | power = ((ratio * 100000 / p1_ratio) / 100); |
| 199 | power *= (m / 100) * (tdp / 1000); |
| 200 | power /= 1000; |
| 201 | |
| 202 | return (int)power; |
| 203 | } |
| 204 | |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 205 | static void generate_P_state_entries(int core, int cores_per_package) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 206 | { |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 207 | int ratio_min, ratio_max, ratio_turbo, ratio_step; |
| 208 | int coord_type, power_max, power_unit, num_entries; |
| 209 | int ratio, power, clock, clock_max; |
| 210 | msr_t msr; |
| 211 | |
| 212 | /* Determine P-state coordination type from MISC_PWR_MGMT[0] */ |
| 213 | msr = rdmsr(MSR_MISC_PWR_MGMT); |
| 214 | if (msr.lo & MISC_PWR_MGMT_EIST_HW_DIS) |
| 215 | coord_type = SW_ANY; |
| 216 | else |
| 217 | coord_type = HW_ALL; |
| 218 | |
| 219 | /* Get bus ratio limits and calculate clock speeds */ |
| 220 | msr = rdmsr(MSR_PLATFORM_INFO); |
| 221 | ratio_min = (msr.hi >> (40-32)) & 0xff; /* Max Efficiency Ratio */ |
| 222 | |
| 223 | /* Determine if this CPU has configurable TDP */ |
| 224 | if (cpu_config_tdp_levels()) { |
| 225 | /* Set max ratio to nominal TDP ratio */ |
| 226 | msr = rdmsr(MSR_CONFIG_TDP_NOMINAL); |
| 227 | ratio_max = msr.lo & 0xff; |
| 228 | } else { |
| 229 | /* Max Non-Turbo Ratio */ |
| 230 | ratio_max = (msr.lo >> 8) & 0xff; |
| 231 | } |
| 232 | clock_max = ratio_max * HASWELL_BCLK; |
| 233 | |
| 234 | /* Calculate CPU TDP in mW */ |
| 235 | msr = rdmsr(MSR_PKG_POWER_SKU_UNIT); |
| 236 | power_unit = 2 << ((msr.lo & 0xf) - 1); |
| 237 | msr = rdmsr(MSR_PKG_POWER_SKU); |
| 238 | power_max = ((msr.lo & 0x7fff) / power_unit) * 1000; |
| 239 | |
| 240 | /* Write _PCT indicating use of FFixedHW */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 241 | acpigen_write_empty_PCT(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 242 | |
| 243 | /* Write _PPC with no limit on supported P-state */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 244 | acpigen_write_PPC_NVS(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 245 | |
| 246 | /* Write PSD indicating configured coordination type */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 247 | acpigen_write_PSD_package(core, 1, coord_type); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 248 | |
| 249 | /* Add P-state entries in _PSS table */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 250 | acpigen_write_name("_PSS"); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 251 | |
| 252 | /* Determine ratio points */ |
| 253 | ratio_step = PSS_RATIO_STEP; |
| 254 | num_entries = (ratio_max - ratio_min) / ratio_step; |
| 255 | while (num_entries > PSS_MAX_ENTRIES-1) { |
| 256 | ratio_step <<= 1; |
| 257 | num_entries >>= 1; |
| 258 | } |
| 259 | |
| 260 | /* P[T] is Turbo state if enabled */ |
| 261 | if (get_turbo_state() == TURBO_ENABLED) { |
| 262 | /* _PSS package count including Turbo */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 263 | acpigen_write_package(num_entries + 2); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 264 | |
| 265 | msr = rdmsr(MSR_TURBO_RATIO_LIMIT); |
| 266 | ratio_turbo = msr.lo & 0xff; |
| 267 | |
| 268 | /* Add entry for Turbo ratio */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 269 | acpigen_write_PSS_package( |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 270 | clock_max + 1, /*MHz*/ |
| 271 | power_max, /*mW*/ |
| 272 | PSS_LATENCY_TRANSITION, /*lat1*/ |
| 273 | PSS_LATENCY_BUSMASTER, /*lat2*/ |
| 274 | ratio_turbo << 8, /*control*/ |
| 275 | ratio_turbo << 8); /*status*/ |
| 276 | } else { |
| 277 | /* _PSS package count without Turbo */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 278 | acpigen_write_package(num_entries + 1); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 279 | } |
| 280 | |
| 281 | /* First regular entry is max non-turbo ratio */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 282 | acpigen_write_PSS_package( |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 283 | clock_max, /*MHz*/ |
| 284 | power_max, /*mW*/ |
| 285 | PSS_LATENCY_TRANSITION, /*lat1*/ |
| 286 | PSS_LATENCY_BUSMASTER, /*lat2*/ |
| 287 | ratio_max << 8, /*control*/ |
| 288 | ratio_max << 8); /*status*/ |
| 289 | |
| 290 | /* Generate the remaining entries */ |
| 291 | for (ratio = ratio_min + ((num_entries - 1) * ratio_step); |
| 292 | ratio >= ratio_min; ratio -= ratio_step) { |
| 293 | |
| 294 | /* Calculate power at this ratio */ |
| 295 | power = calculate_power(power_max, ratio_max, ratio); |
| 296 | clock = ratio * HASWELL_BCLK; |
| 297 | |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 298 | acpigen_write_PSS_package( |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 299 | clock, /*MHz*/ |
| 300 | power, /*mW*/ |
| 301 | PSS_LATENCY_TRANSITION, /*lat1*/ |
| 302 | PSS_LATENCY_BUSMASTER, /*lat2*/ |
| 303 | ratio << 8, /*control*/ |
| 304 | ratio << 8); /*status*/ |
| 305 | } |
| 306 | |
| 307 | /* Fix package length */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 308 | acpigen_pop_len(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | void generate_cpu_entries(void) |
| 312 | { |
Duncan Laurie | 1ad5564 | 2013-03-07 14:08:04 -0800 | [diff] [blame] | 313 | int coreID, cpuID, pcontrol_blk = get_pmbase(), plen = 6; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 314 | int totalcores = dev_count_cpu(); |
| 315 | int cores_per_package = get_cores_per_package(); |
| 316 | int numcpus = totalcores/cores_per_package; |
| 317 | |
| 318 | printk(BIOS_DEBUG, "Found %d CPU(s) with %d core(s) each.\n", |
| 319 | numcpus, cores_per_package); |
| 320 | |
Martin Roth | 9944b28 | 2014-08-11 11:24:55 -0600 | [diff] [blame] | 321 | for (cpuID = 1; cpuID <= numcpus; cpuID++) { |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 322 | for (coreID=1; coreID<=cores_per_package; coreID++) { |
| 323 | if (coreID>1) { |
| 324 | pcontrol_blk = 0; |
| 325 | plen = 0; |
| 326 | } |
| 327 | |
| 328 | /* Generate processor \_PR.CPUx */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 329 | acpigen_write_processor( |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 330 | (cpuID-1)*cores_per_package+coreID-1, |
| 331 | pcontrol_blk, plen); |
| 332 | |
| 333 | /* Generate P-state tables */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 334 | generate_P_state_entries( |
Duncan Laurie | 25b8b7b | 2013-04-19 10:02:23 -0700 | [diff] [blame] | 335 | coreID-1, cores_per_package); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 336 | |
| 337 | /* Generate C-state tables */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 338 | generate_C_state_entries(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 339 | |
| 340 | /* Generate T-state tables */ |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 341 | generate_T_state_entries( |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 342 | cpuID-1, cores_per_package); |
| 343 | |
Vladimir Serbinenko | be0fd0a | 2014-11-04 21:10:59 +0100 | [diff] [blame^] | 344 | acpigen_pop_len(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 345 | } |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | struct chip_operations cpu_intel_haswell_ops = { |
| 350 | CHIP_NAME("Intel Haswell CPU") |
| 351 | }; |