blob: 47c770754857dd1d510f33d217f03d36f2487d8c [file] [log] [blame]
Stefan Reinauer5c554632012-04-04 00:09:50 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2007-2009 coresystems GmbH
5 * Copyright (C) 2011 The ChromiumOS 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 <console/console.h>
24#include <device/device.h>
25#include <device/pci.h>
26#include <string.h>
27#include <arch/acpi.h>
28#include <cpu/cpu.h>
29#include <cpu/x86/mtrr.h>
30#include <cpu/x86/msr.h>
31#include <cpu/x86/lapic.h>
32#include <cpu/intel/microcode.h>
33#include <cpu/intel/speedstep.h>
34#include <cpu/intel/turbo.h>
35#include <cpu/x86/cache.h>
36#include <cpu/x86/name.h>
37#include <pc80/mc146818rtc.h>
38#include <usbdebug.h>
39#include "model_206ax.h"
Duncan Laurie55632112012-07-16 12:19:00 -070040#include "chip.h"
Stefan Reinauer5c554632012-04-04 00:09:50 +020041
42/*
43 * List of suported C-states in this processor
44 *
45 * Latencies are typical worst-case package exit time in uS
46 * taken from the SandyBridge BIOS specification.
47 */
48static acpi_cstate_t cstate_map[] = {
49 { /* 0: C0 */
50 },{ /* 1: C1 */
51 .latency = 1,
52 .power = 1000,
53 .resource = {
54 .addrl = 0x00, /* MWAIT State 0 */
55 .space_id = ACPI_ADDRESS_SPACE_FIXED,
56 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
57 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
58 .resv = ACPI_FFIXEDHW_FLAG_HW_COORD,
59 }
60 },
61 { /* 2: C1E */
62 .latency = 1,
63 .power = 1000,
64 .resource = {
65 .addrl = 0x01, /* MWAIT State 0 Sub-state 1 */
66 .space_id = ACPI_ADDRESS_SPACE_FIXED,
67 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
68 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
69 .resv = ACPI_FFIXEDHW_FLAG_HW_COORD,
70 }
71 },
72 { /* 3: C3 */
73 .latency = 63,
74 .power = 500,
75 .resource = {
76 .addrl = 0x10, /* MWAIT State 1 */
77 .space_id = ACPI_ADDRESS_SPACE_FIXED,
78 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
79 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
80 .resv = ACPI_FFIXEDHW_FLAG_HW_COORD,
81 }
82 },
83 { /* 4: C6 */
84 .latency = 87,
85 .power = 350,
86 .resource = {
87 .addrl = 0x20, /* MWAIT State 2 */
88 .space_id = ACPI_ADDRESS_SPACE_FIXED,
89 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
90 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
91 .resv = ACPI_FFIXEDHW_FLAG_HW_COORD,
92 }
93 },
94 { /* 5: C7 */
95 .latency = 90,
96 .power = 200,
97 .resource = {
98 .addrl = 0x30, /* MWAIT State 3 */
99 .space_id = ACPI_ADDRESS_SPACE_FIXED,
100 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
101 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
102 .resv = ACPI_FFIXEDHW_FLAG_HW_COORD,
103 }
104 },
105 { /* 6: C7S */
106 .latency = 90,
107 .power = 200,
108 .resource = {
109 .addrl = 0x31, /* MWAIT State 3 Sub-state 1 */
110 .space_id = ACPI_ADDRESS_SPACE_FIXED,
111 .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,
112 .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,
113 .resv = ACPI_FFIXEDHW_FLAG_HW_COORD,
114 }
115 },
116 { 0 }
117};
118
Marc Jones5986eda2012-10-25 09:37:19 -0600119static void enable_vmx(void)
120{
121 struct cpuid_result regs;
122 msr_t msr;
123 int enable = CONFIG_ENABLE_VMX;
124
125 msr = rdmsr(IA32_FEATURE_CONTROL);
126
127 if (msr.lo & (1 << 0)) {
128 printk(BIOS_ERR, "VMX is locked, so enable_vmx will do nothing\n");
129 /* VMX locked. If we set it again we get an illegal
130 * instruction
131 */
132 return;
133 }
134
135 regs = cpuid(1);
136 printk(BIOS_DEBUG, "%s VMX\n", enable ? "Enabling" : "Disabling");
137 if (regs.ecx & CPUID_VMX) {
138 if (enable)
139 msr.lo |= (1 << 2);
140 else
141 msr.lo &= ~(1 << 2);
142
143 if (regs.ecx & CPUID_SMX) {
144 if (enable)
145 msr.lo |= (1 << 1);
146 else
147 msr.lo &= ~(1 << 1);
148 }
149 }
150
151 wrmsr(IA32_FEATURE_CONTROL, msr);
152}
153
Stefan Reinauer5c554632012-04-04 00:09:50 +0200154/* Convert time in seconds to POWER_LIMIT_1_TIME MSR value */
155static const u8 power_limit_time_sec_to_msr[] = {
156 [0] = 0x00,
157 [1] = 0x0a,
158 [2] = 0x0b,
159 [3] = 0x4b,
160 [4] = 0x0c,
161 [5] = 0x2c,
162 [6] = 0x4c,
163 [7] = 0x6c,
164 [8] = 0x0d,
165 [10] = 0x2d,
166 [12] = 0x4d,
167 [14] = 0x6d,
168 [16] = 0x0e,
169 [20] = 0x2e,
170 [24] = 0x4e,
171 [28] = 0x6e,
172 [32] = 0x0f,
173 [40] = 0x2f,
174 [48] = 0x4f,
175 [56] = 0x6f,
176 [64] = 0x10,
177 [80] = 0x30,
178 [96] = 0x50,
179 [112] = 0x70,
180 [128] = 0x11,
181};
182
183/* Convert POWER_LIMIT_1_TIME MSR value to seconds */
184static const u8 power_limit_time_msr_to_sec[] = {
185 [0x00] = 0,
186 [0x0a] = 1,
187 [0x0b] = 2,
188 [0x4b] = 3,
189 [0x0c] = 4,
190 [0x2c] = 5,
191 [0x4c] = 6,
192 [0x6c] = 7,
193 [0x0d] = 8,
194 [0x2d] = 10,
195 [0x4d] = 12,
196 [0x6d] = 14,
197 [0x0e] = 16,
198 [0x2e] = 20,
199 [0x4e] = 24,
200 [0x6e] = 28,
201 [0x0f] = 32,
202 [0x2f] = 40,
203 [0x4f] = 48,
204 [0x6f] = 56,
205 [0x10] = 64,
206 [0x30] = 80,
207 [0x50] = 96,
208 [0x70] = 112,
209 [0x11] = 128,
210};
211
Duncan Laurie77dbbac2012-06-25 09:51:59 -0700212int cpu_config_tdp_levels(void)
213{
214 msr_t platform_info;
215
216 /* Minimum CPU revision */
217 if (cpuid_eax(1) < IVB_CONFIG_TDP_MIN_CPUID)
218 return 0;
219
220 /* Bits 34:33 indicate how many levels supported */
221 platform_info = rdmsr(MSR_PLATFORM_INFO);
222 return (platform_info.hi >> 1) & 3;
223}
224
Stefan Reinauer5c554632012-04-04 00:09:50 +0200225/*
226 * Configure processor power limits if possible
227 * This must be done AFTER set of BIOS_RESET_CPL
228 */
229void set_power_limits(u8 power_limit_1_time)
230{
231 msr_t msr = rdmsr(MSR_PLATFORM_INFO);
232 msr_t limit;
233 unsigned power_unit;
234 unsigned tdp, min_power, max_power, max_time;
235 u8 power_limit_1_val;
236
237 if (power_limit_1_time > ARRAY_SIZE(power_limit_time_sec_to_msr))
238 return;
239
240 if (!(msr.lo & PLATFORM_INFO_SET_TDP))
241 return;
242
243 /* Get units */
244 msr = rdmsr(MSR_PKG_POWER_SKU_UNIT);
245 power_unit = 2 << ((msr.lo & 0xf) - 1);
246
247 /* Get power defaults for this SKU */
248 msr = rdmsr(MSR_PKG_POWER_SKU);
249 tdp = msr.lo & 0x7fff;
250 min_power = (msr.lo >> 16) & 0x7fff;
251 max_power = msr.hi & 0x7fff;
252 max_time = (msr.hi >> 16) & 0x7f;
253
254 printk(BIOS_DEBUG, "CPU TDP: %u Watts\n", tdp / power_unit);
255
256 if (power_limit_time_msr_to_sec[max_time] > power_limit_1_time)
257 power_limit_1_time = power_limit_time_msr_to_sec[max_time];
258
259 if (min_power > 0 && tdp < min_power)
260 tdp = min_power;
261
262 if (max_power > 0 && tdp > max_power)
263 tdp = max_power;
264
265 power_limit_1_val = power_limit_time_sec_to_msr[power_limit_1_time];
266
267 /* Set long term power limit to TDP */
268 limit.lo = 0;
269 limit.lo |= tdp & PKG_POWER_LIMIT_MASK;
270 limit.lo |= PKG_POWER_LIMIT_EN;
271 limit.lo |= (power_limit_1_val & PKG_POWER_LIMIT_TIME_MASK) <<
272 PKG_POWER_LIMIT_TIME_SHIFT;
273
274 /* Set short term power limit to 1.25 * TDP */
275 limit.hi = 0;
276 limit.hi |= ((tdp * 125) / 100) & PKG_POWER_LIMIT_MASK;
277 limit.hi |= PKG_POWER_LIMIT_EN;
278 /* Power limit 2 time is only programmable on SNB EP/EX */
279
280 wrmsr(MSR_PKG_POWER_LIMIT, limit);
Duncan Laurie77dbbac2012-06-25 09:51:59 -0700281
282 /* Use nominal TDP values for CPUs with configurable TDP */
283 if (cpu_config_tdp_levels()) {
284 msr = rdmsr(MSR_CONFIG_TDP_NOMINAL);
285 limit.hi = 0;
286 limit.lo = msr.lo & 0xff;
287 wrmsr(MSR_TURBO_ACTIVATION_RATIO, limit);
288 }
Stefan Reinauer5c554632012-04-04 00:09:50 +0200289}
290
291static void configure_c_states(void)
292{
293 msr_t msr;
294
295 msr = rdmsr(MSR_PMG_CST_CONFIG_CONTROL);
296 msr.lo |= (1 << 28); // C1 Auto Undemotion Enable
297 msr.lo |= (1 << 27); // C3 Auto Undemotion Enable
298 msr.lo |= (1 << 26); // C1 Auto Demotion Enable
299 msr.lo |= (1 << 25); // C3 Auto Demotion Enable
300 msr.lo &= ~(1 << 10); // Disable IO MWAIT redirection
301 msr.lo |= 7; // No package C-state limit
302 wrmsr(MSR_PMG_CST_CONFIG_CONTROL, msr);
303
304 msr = rdmsr(MSR_PMG_IO_CAPTURE_BASE);
305 msr.lo &= ~0x7ffff;
306 msr.lo |= (PMB0_BASE + 4); // LVL_2 base address
307 msr.lo |= (2 << 16); // CST Range: C7 is max C-state
308 wrmsr(MSR_PMG_IO_CAPTURE_BASE, msr);
309
310 msr = rdmsr(MSR_MISC_PWR_MGMT);
311 msr.lo &= ~(1 << 0); // Enable P-state HW_ALL coordination
312 wrmsr(MSR_MISC_PWR_MGMT, msr);
313
314 msr = rdmsr(MSR_POWER_CTL);
315 msr.lo |= (1 << 18); // Enable Energy Perf Bias MSR 0x1b0
316 msr.lo |= (1 << 1); // C1E Enable
317 msr.lo |= (1 << 0); // Bi-directional PROCHOT#
318 wrmsr(MSR_POWER_CTL, msr);
319
320 /* C3 Interrupt Response Time Limit */
321 msr.hi = 0;
322 msr.lo = IRTL_VALID | IRTL_1024_NS | 0x50;
323 wrmsr(MSR_PKGC3_IRTL, msr);
324
325 /* C6 Interrupt Response Time Limit */
326 msr.hi = 0;
327 msr.lo = IRTL_VALID | IRTL_1024_NS | 0x68;
328 wrmsr(MSR_PKGC6_IRTL, msr);
329
330 /* C7 Interrupt Response Time Limit */
331 msr.hi = 0;
332 msr.lo = IRTL_VALID | IRTL_1024_NS | 0x6D;
333 wrmsr(MSR_PKGC7_IRTL, msr);
334
335 /* Primary Plane Current Limit */
336 msr = rdmsr(MSR_PP0_CURRENT_CONFIG);
337 msr.lo &= ~0x1fff;
338 msr.lo |= PP0_CURRENT_LIMIT;
339 wrmsr(MSR_PP0_CURRENT_CONFIG, msr);
340
341 /* Secondary Plane Current Limit */
342 msr = rdmsr(MSR_PP1_CURRENT_CONFIG);
343 msr.lo &= ~0x1fff;
Duncan Laurie4e4320f2012-06-25 09:53:58 -0700344 if (cpuid_eax(1) >= 0x30600)
345 msr.lo |= PP1_CURRENT_LIMIT_IVB;
346 else
347 msr.lo |= PP1_CURRENT_LIMIT_SNB;
Stefan Reinauer5c554632012-04-04 00:09:50 +0200348 wrmsr(MSR_PP1_CURRENT_CONFIG, msr);
349}
350
Duncan Laurie55632112012-07-16 12:19:00 -0700351static void configure_thermal_target(void)
352{
353 struct cpu_intel_model_206ax_config *conf;
354 device_t lapic;
355 msr_t msr;
356
357 /* Find pointer to CPU configuration */
358 lapic = dev_find_lapic(SPEEDSTEP_APIC_MAGIC);
359 if (!lapic || !lapic->chip_info)
360 return;
361 conf = lapic->chip_info;
362
363 /* Set TCC activaiton offset if supported */
364 msr = rdmsr(MSR_PLATFORM_INFO);
365 if ((msr.lo & (1 << 30)) && conf->tcc_offset) {
366 msr = rdmsr(MSR_TEMPERATURE_TARGET);
367 msr.lo &= ~(0xf << 24); /* Bits 27:24 */
368 msr.lo |= (conf->tcc_offset & 0xf) << 24;
369 wrmsr(MSR_TEMPERATURE_TARGET, msr);
370 }
371}
372
Stefan Reinauer5c554632012-04-04 00:09:50 +0200373static void configure_misc(void)
374{
375 msr_t msr;
376
377 msr = rdmsr(IA32_MISC_ENABLE);
378 msr.lo |= (1 << 0); /* Fast String enable */
379 msr.lo |= (1 << 3); /* TM1/TM2/EMTTM enable */
380 msr.lo |= (1 << 16); /* Enhanced SpeedStep Enable */
381 wrmsr(IA32_MISC_ENABLE, msr);
382
383 /* Disable Thermal interrupts */
384 msr.lo = 0;
385 msr.hi = 0;
386 wrmsr(IA32_THERM_INTERRUPT, msr);
387
388 /* Enable package critical interrupt only */
389 msr.lo = 1 << 4;
390 msr.hi = 0;
391 wrmsr(IA32_PACKAGE_THERM_INTERRUPT, msr);
392}
393
394static void enable_lapic_tpr(void)
395{
396 msr_t msr;
397
398 msr = rdmsr(MSR_PIC_MSG_CONTROL);
399 msr.lo &= ~(1 << 10); /* Enable APIC TPR updates */
400 wrmsr(MSR_PIC_MSG_CONTROL, msr);
401}
402
403static void configure_dca_cap(void)
404{
405 struct cpuid_result cpuid_regs;
406 msr_t msr;
407
408 /* Check feature flag in CPUID.(EAX=1):ECX[18]==1 */
409 cpuid_regs = cpuid(1);
410 if (cpuid_regs.ecx & (1 << 18)) {
411 msr = rdmsr(IA32_PLATFORM_DCA_CAP);
412 msr.lo |= 1;
413 wrmsr(IA32_PLATFORM_DCA_CAP, msr);
414 }
415}
416
417static void set_max_ratio(void)
418{
Duncan Laurie77dbbac2012-06-25 09:51:59 -0700419 msr_t msr, perf_ctl;
Stefan Reinauer5c554632012-04-04 00:09:50 +0200420
Duncan Laurie77dbbac2012-06-25 09:51:59 -0700421 perf_ctl.hi = 0;
422
423 /* Check for configurable TDP option */
424 if (cpu_config_tdp_levels()) {
425 /* Set to nominal TDP ratio */
426 msr = rdmsr(MSR_CONFIG_TDP_NOMINAL);
427 perf_ctl.lo = (msr.lo & 0xff) << 8;
428 } else {
429 /* Platform Info bits 15:8 give max ratio */
430 msr = rdmsr(MSR_PLATFORM_INFO);
431 perf_ctl.lo = msr.lo & 0xff00;
432 }
433 wrmsr(IA32_PERF_CTL, perf_ctl);
Stefan Reinauer5c554632012-04-04 00:09:50 +0200434
435 printk(BIOS_DEBUG, "model_x06ax: frequency set to %d\n",
Duncan Laurie77dbbac2012-06-25 09:51:59 -0700436 ((perf_ctl.lo >> 8) & 0xff) * SANDYBRIDGE_BCLK);
Stefan Reinauer5c554632012-04-04 00:09:50 +0200437}
438
439static void set_energy_perf_bias(u8 policy)
440{
441 msr_t msr;
442
443 /* Energy Policy is bits 3:0 */
444 msr = rdmsr(IA32_ENERGY_PERFORMANCE_BIAS);
445 msr.lo &= ~0xf;
446 msr.lo |= policy & 0xf;
447 wrmsr(IA32_ENERGY_PERFORMANCE_BIAS, msr);
448
449 printk(BIOS_DEBUG, "model_x06ax: energy policy set to %u\n",
450 policy);
451}
452
453static void configure_mca(void)
454{
455 msr_t msr;
456 int i;
457
458 msr.lo = msr.hi = 0;
459 /* This should only be done on a cold boot */
460 for (i = 0; i < 7; i++)
461 wrmsr(IA32_MC0_STATUS + (i * 4), msr);
462}
463
464#if CONFIG_USBDEBUG
465static unsigned ehci_debug_addr;
466#endif
467
Sven Schnelle51676b12012-07-29 19:18:03 +0200468/*
469 * Initialize any extra cores/threads in this package.
470 */
471static void intel_cores_init(device_t cpu)
472{
473 struct cpuid_result result;
Stefan Reinauerbb9dff52012-10-15 13:45:11 -0700474 unsigned threads_per_package, threads_per_core, i;
Sven Schnelle51676b12012-07-29 19:18:03 +0200475
Stefan Reinauerbb9dff52012-10-15 13:45:11 -0700476 /* Logical processors (threads) per core */
477 result = cpuid_ext(0xb, 0);
478 threads_per_core = result.ebx & 0xffff;
Sven Schnelle51676b12012-07-29 19:18:03 +0200479
Stefan Reinauerbb9dff52012-10-15 13:45:11 -0700480 /* Logical processors (threads) per package */
481 result = cpuid_ext(0xb, 1);
482 threads_per_package = result.ebx & 0xffff;
Sven Schnelle51676b12012-07-29 19:18:03 +0200483
484 /* Only initialize extra cores from BSP */
485 if (cpu->path.apic.apic_id)
486 return;
487
Stefan Reinauerbb9dff52012-10-15 13:45:11 -0700488 printk(BIOS_DEBUG, "CPU: %u has %u cores, %u threads per core\n",
489 cpu->path.apic.apic_id, threads_per_package/threads_per_core,
490 threads_per_core);
Sven Schnelle51676b12012-07-29 19:18:03 +0200491
Stefan Reinauerbb9dff52012-10-15 13:45:11 -0700492 for (i = 1; i < threads_per_package; ++i) {
Sven Schnelle51676b12012-07-29 19:18:03 +0200493 struct device_path cpu_path;
494 device_t new;
495
496 /* Build the cpu device path */
497 cpu_path.type = DEVICE_PATH_APIC;
498 cpu_path.apic.apic_id =
499 cpu->path.apic.apic_id + i;
500
501 /* Update APIC ID if no hyperthreading */
Stefan Reinauerbb9dff52012-10-15 13:45:11 -0700502 if (threads_per_core == 1)
Sven Schnelle51676b12012-07-29 19:18:03 +0200503 cpu_path.apic.apic_id <<= 1;
504
505 /* Allocate the new cpu device structure */
506 new = alloc_dev(cpu->bus, &cpu_path);
507 if (!new)
508 continue;
509
510 printk(BIOS_DEBUG, "CPU: %u has core %u\n",
511 cpu->path.apic.apic_id,
512 new->path.apic.apic_id);
513
514 /* Start the new cpu */
515 if (!start_cpu(new)) {
516 /* Record the error in cpu? */
517 printk(BIOS_ERR, "CPU %u would not start!\n",
518 new->path.apic.apic_id);
519 }
520 }
521}
522
Stefan Reinauer5c554632012-04-04 00:09:50 +0200523static void model_206ax_init(device_t cpu)
524{
525 char processor_name[49];
526 struct cpuid_result cpuid_regs;
527
528 /* Turn on caching if we haven't already */
529 x86_enable_cache();
530
Vadim Bendebury537b4e02012-06-19 12:56:57 -0700531 intel_update_microcode_from_cbfs();
Stefan Reinauer5c554632012-04-04 00:09:50 +0200532
533 /* Clear out pending MCEs */
534 configure_mca();
535
536 /* Print processor name */
537 fill_processor_name(processor_name);
538 printk(BIOS_INFO, "CPU: %s.\n", processor_name);
539
540#if CONFIG_USBDEBUG
541 // Is this caution really needed?
542 if(!ehci_debug_addr)
543 ehci_debug_addr = get_ehci_debug();
544 set_ehci_debug(0);
545#endif
546
547 /* Setup MTRRs based on physical address size */
548 cpuid_regs = cpuid(0x80000008);
549 x86_setup_fixed_mtrrs();
550 x86_setup_var_mtrrs(cpuid_regs.eax & 0xff, 2);
551 x86_mtrr_check();
552
553 /* Setup Page Attribute Tables (PAT) */
554 // TODO set up PAT
555
556#if CONFIG_USBDEBUG
557 set_ehci_debug(ehci_debug_addr);
558#endif
559
560 /* Enable the local cpu apics */
561 enable_lapic_tpr();
562 setup_lapic();
563
Marc Jones5986eda2012-10-25 09:37:19 -0600564 /* Enable virtualization if enabled in CMOS */
565 enable_vmx();
566
Stefan Reinauer5c554632012-04-04 00:09:50 +0200567 /* Configure C States */
568 configure_c_states();
569
570 /* Configure Enhanced SpeedStep and Thermal Sensors */
571 configure_misc();
572
Duncan Laurie55632112012-07-16 12:19:00 -0700573 /* Thermal throttle activation offset */
574 configure_thermal_target();
575
Stefan Reinauer5c554632012-04-04 00:09:50 +0200576 /* Enable Direct Cache Access */
577 configure_dca_cap();
578
579 /* Set energy policy */
580 set_energy_perf_bias(ENERGY_POLICY_NORMAL);
581
582 /* Set Max Ratio */
583 set_max_ratio();
584
585 /* Enable Turbo */
586 enable_turbo();
Sven Schnelle51676b12012-07-29 19:18:03 +0200587
588 /* Start up extra cores */
589 intel_cores_init(cpu);
Stefan Reinauer5c554632012-04-04 00:09:50 +0200590}
591
592static struct device_operations cpu_dev_ops = {
593 .init = model_206ax_init,
594};
595
596static struct cpu_device_id cpu_table[] = {
597 { X86_VENDOR_INTEL, 0x206a0 }, /* Intel Sandybridge */
598 { X86_VENDOR_INTEL, 0x206a6 }, /* Intel Sandybridge D1 */
599 { X86_VENDOR_INTEL, 0x206a7 }, /* Intel Sandybridge D2/J1 */
600 { X86_VENDOR_INTEL, 0x306a2 }, /* Intel IvyBridge */
601 { X86_VENDOR_INTEL, 0x306a4 }, /* Intel IvyBridge */
602 { X86_VENDOR_INTEL, 0x306a5 }, /* Intel IvyBridge */
603 { X86_VENDOR_INTEL, 0x306a6 }, /* Intel IvyBridge */
604 { X86_VENDOR_INTEL, 0x306a8 }, /* Intel IvyBridge */
605 { X86_VENDOR_INTEL, 0x306a9 }, /* Intel IvyBridge */
606 { 0, 0 },
607};
608
609static const struct cpu_driver driver __cpu_driver = {
610 .ops = &cpu_dev_ops,
611 .id_table = cpu_table,
612 .cstates = cstate_map,
613};
614