| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <cpu/cpu.h> |
| 6 |
#include <cpu/x86/mtrr.h> |
| 7 |
#include <cpu/x86/msr.h> |
| 8 |
#include <cpu/x86/mp.h> |
| 9 |
#include <cpu/intel/microcode.h> |
| 10 |
#include <cpu/intel/speedstep.h> |
| 11 |
#include <cpu/intel/turbo.h> |
| 12 |
#include <cpu/x86/cache.h> |
| 13 |
#include <cpu/x86/name.h> |
| 14 |
#include "commonlib/bsd/helpers.h" |
| 15 |
#include "model_206ax.h" |
| 16 |
#include "chip.h" |
| 17 |
#include <cpu/intel/smm_reloc.h> |
| 18 |
#include <cpu/intel/common/common.h> |
| 19 |
#include <smbios.h> |
| 20 |
#include <smp/node.h> |
| 21 |
#include <static.h> |
| 22 |
#include <types.h> |
| 23 |
|
| 24 |
|
| 25 |
static const u8 power_limit_time_sec_to_msr[] = { |
| 26 |
[0] = 0x00, |
| 27 |
[1] = 0x0a, |
| 28 |
[2] = 0x0b, |
| 29 |
[3] = 0x4b, |
| 30 |
[4] = 0x0c, |
| 31 |
[5] = 0x2c, |
| 32 |
[6] = 0x4c, |
| 33 |
[7] = 0x6c, |
| 34 |
[8] = 0x0d, |
| 35 |
[10] = 0x2d, |
| 36 |
[12] = 0x4d, |
| 37 |
[14] = 0x6d, |
| 38 |
[16] = 0x0e, |
| 39 |
[20] = 0x2e, |
| 40 |
[24] = 0x4e, |
| 41 |
[28] = 0x6e, |
| 42 |
[32] = 0x0f, |
| 43 |
[40] = 0x2f, |
| 44 |
[48] = 0x4f, |
| 45 |
[56] = 0x6f, |
| 46 |
[64] = 0x10, |
| 47 |
[80] = 0x30, |
| 48 |
[96] = 0x50, |
| 49 |
[112] = 0x70, |
| 50 |
[128] = 0x11, |
| 51 |
}; |
| 52 |
|
| 53 |
|
| 54 |
static const u8 power_limit_time_msr_to_sec[] = { |
| 55 |
[0x00] = 0, |
| 56 |
[0x0a] = 1, |
| 57 |
[0x0b] = 2, |
| 58 |
[0x4b] = 3, |
| 59 |
[0x0c] = 4, |
| 60 |
[0x2c] = 5, |
| 61 |
[0x4c] = 6, |
| 62 |
[0x6c] = 7, |
| 63 |
[0x0d] = 8, |
| 64 |
[0x2d] = 10, |
| 65 |
[0x4d] = 12, |
| 66 |
[0x6d] = 14, |
| 67 |
[0x0e] = 16, |
| 68 |
[0x2e] = 20, |
| 69 |
[0x4e] = 24, |
| 70 |
[0x6e] = 28, |
| 71 |
[0x0f] = 32, |
| 72 |
[0x2f] = 40, |
| 73 |
[0x4f] = 48, |
| 74 |
[0x6f] = 56, |
| 75 |
[0x10] = 64, |
| 76 |
[0x30] = 80, |
| 77 |
[0x50] = 96, |
| 78 |
[0x70] = 112, |
| 79 |
[0x11] = 128, |
| 80 |
}; |
| 81 |
|
| 82 |
int cpu_config_tdp_levels(void) |
| 83 |
{ |
| 84 |
msr_t platform_info; |
| 85 |
|
| 86 |
|
| 87 |
if (cpuid_eax(1) < IVB_CONFIG_TDP_MIN_CPUID) |
| 88 |
return 0; |
| 89 |
|
| 90 |
|
| 91 |
platform_info = rdmsr(MSR_PLATFORM_INFO); |
| 92 |
return (platform_info.hi >> 1) & 3; |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
void set_power_limits(u8 power_limit_1_time) |
| 100 |
{ |
| 101 |
struct cpu_intel_model_206ax_config *conf = DEV_PTR(cpu_bus)->chip_info; |
| 102 |
msr_t msr = rdmsr(MSR_PLATFORM_INFO); |
| 103 |
msr_t limit; |
| 104 |
unsigned int power_unit; |
| 105 |
unsigned int tdp, min_power, max_power, max_time; |
| 106 |
u8 power_limit_1_val; |
| 107 |
|
| 108 |
if (power_limit_1_time >= ARRAY_SIZE(power_limit_time_sec_to_msr)) |
| 109 |
return; |
| 110 |
|
| 111 |
if (!(msr.lo & PLATFORM_INFO_SET_TDP)) |
| 112 |
return; |
| 113 |
|
| 114 |
|
| 115 |
msr = rdmsr(MSR_PKG_POWER_SKU_UNIT); |
| 116 |
power_unit = 2 << ((msr.lo & 0xf) - 1); |
| 117 |
|
| 118 |
|
| 119 |
msr = rdmsr(MSR_PKG_POWER_SKU); |
| 120 |
tdp = msr.lo & 0x7fff; |
| 121 |
min_power = (msr.lo >> 16) & 0x7fff; |
| 122 |
max_power = msr.hi & 0x7fff; |
| 123 |
max_time = (msr.hi >> 16) & 0x7f; |
| 124 |
|
| 125 |
printk(BIOS_DEBUG, "CPU TDP: %u Watts\n", tdp / power_unit); |
| 126 |
|
| 127 |
if (power_limit_time_msr_to_sec[max_time] > power_limit_1_time) |
| 128 |
power_limit_1_time = power_limit_time_msr_to_sec[max_time]; |
| 129 |
|
| 130 |
if (min_power > 0 && tdp < min_power) |
| 131 |
tdp = min_power; |
| 132 |
|
| 133 |
if (max_power > 0 && tdp > max_power) |
| 134 |
tdp = max_power; |
| 135 |
|
| 136 |
power_limit_1_val = power_limit_time_sec_to_msr[power_limit_1_time]; |
| 137 |
|
| 138 |
limit.lo = 0; |
| 139 |
if (conf->pl1_mw) { |
| 140 |
printk(BIOS_DEBUG, "Setting PL1 to %u milliwatts\n", conf->pl1_mw); |
| 141 |
limit.lo |= ((conf->pl1_mw * power_unit) / 1000) & PKG_POWER_LIMIT_MASK; |
| 142 |
} else { |
| 143 |
|
| 144 |
limit.lo |= tdp & PKG_POWER_LIMIT_MASK; |
| 145 |
} |
| 146 |
if (conf->pl2_clamp) { |
| 147 |
printk(BIOS_DEBUG, "Enabling PL1 clamping limitation\n"); |
| 148 |
limit.lo |= PKG_POWER_LIMIT_CLAMP; |
| 149 |
} |
| 150 |
limit.lo |= PKG_POWER_LIMIT_EN; |
| 151 |
limit.lo |= (power_limit_1_val & PKG_POWER_LIMIT_TIME_MASK) << |
| 152 |
PKG_POWER_LIMIT_TIME_SHIFT; |
| 153 |
|
| 154 |
limit.hi = 0; |
| 155 |
if (conf->pl2_mw) { |
| 156 |
printk(BIOS_DEBUG, "Setting PL2 to %u milliwatts\n", conf->pl2_mw); |
| 157 |
limit.hi |= ((conf->pl2_mw * power_unit) / 1000) & PKG_POWER_LIMIT_MASK; |
| 158 |
} else { |
| 159 |
|
| 160 |
limit.hi |= ((tdp * 125) / 100) & PKG_POWER_LIMIT_MASK; |
| 161 |
} |
| 162 |
if (conf->pl2_clamp) { |
| 163 |
printk(BIOS_DEBUG, "Enabling PL2 clamping limitation\n"); |
| 164 |
limit.hi |= PKG_POWER_LIMIT_CLAMP; |
| 165 |
} |
| 166 |
limit.hi |= PKG_POWER_LIMIT_EN; |
| 167 |
|
| 168 |
|
| 169 |
wrmsr(MSR_PKG_POWER_LIMIT, limit); |
| 170 |
|
| 171 |
|
| 172 |
if (cpu_config_tdp_levels()) { |
| 173 |
msr = rdmsr(MSR_CONFIG_TDP_NOMINAL); |
| 174 |
limit.hi = 0; |
| 175 |
limit.lo = msr.lo & 0xff; |
| 176 |
wrmsr(MSR_TURBO_ACTIVATION_RATIO, limit); |
| 177 |
} |
| 178 |
} |
| 179 |
|
| 180 |
static void configure_turbo_ratio_limits(struct cpu_intel_model_206ax_config *conf) |
| 181 |
{ |
| 182 |
msr_t msr = rdmsr(MSR_TURBO_RATIO_LIMIT); |
| 183 |
|
| 184 |
for (int i = 0; i < ARRAY_SIZE(conf->turbo_limits.raw); i++) { |
| 185 |
const int shift = i * 8; |
| 186 |
const int limit = conf->turbo_limits.raw[i]; |
| 187 |
|
| 188 |
if (limit) { |
| 189 |
msr.lo &= ~(0xff << shift); |
| 190 |
msr.lo |= (limit << shift); |
| 191 |
} |
| 192 |
} |
| 193 |
|
| 194 |
wrmsr(MSR_TURBO_RATIO_LIMIT, msr); |
| 195 |
} |
| 196 |
|
| 197 |
static void configure_c_states(struct device *dev) |
| 198 |
{ |
| 199 |
struct cpu_intel_model_206ax_config *conf = dev->upstream->dev->chip_info; |
| 200 |
msr_t msr; |
| 201 |
|
| 202 |
msr = rdmsr(MSR_PKG_CST_CONFIG_CONTROL); |
| 203 |
msr.lo |= (1 << 28); |
| 204 |
msr.lo |= (1 << 27); |
| 205 |
msr.lo |= (1 << 26); |
| 206 |
msr.lo |= (1 << 25); |
| 207 |
msr.lo &= ~(1 << 10); |
| 208 |
msr.lo |= 7; |
| 209 |
|
| 210 |
msr.lo |= (1 << 15); |
| 211 |
wrmsr(MSR_PKG_CST_CONFIG_CONTROL, msr); |
| 212 |
|
| 213 |
if (boot_cpu()) { |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
msr = rdmsr(MSR_MISC_PWR_MGMT); |
| 220 |
msr.lo &= ~(1 << 0); |
| 221 |
wrmsr(MSR_MISC_PWR_MGMT, msr); |
| 222 |
|
| 223 |
msr = rdmsr(MSR_POWER_CTL); |
| 224 |
msr.lo |= (1 << 18); |
| 225 |
msr.lo |= (1 << 1); |
| 226 |
msr.lo |= (1 << 0); |
| 227 |
wrmsr(MSR_POWER_CTL, msr); |
| 228 |
|
| 229 |
|
| 230 |
msr.hi = 0; |
| 231 |
if (IS_IVY_CPU(cpu_get_cpuid())) |
| 232 |
msr.lo = IRTL_VALID | IRTL_1024_NS | 0x3b; |
| 233 |
else |
| 234 |
msr.lo = IRTL_VALID | IRTL_1024_NS | 0x50; |
| 235 |
wrmsr(MSR_PKGC3_IRTL, msr); |
| 236 |
|
| 237 |
|
| 238 |
msr.hi = 0; |
| 239 |
if (IS_IVY_CPU(cpu_get_cpuid())) |
| 240 |
msr.lo = IRTL_VALID | IRTL_1024_NS | 0x50; |
| 241 |
else |
| 242 |
msr.lo = IRTL_VALID | IRTL_1024_NS | 0x68; |
| 243 |
wrmsr(MSR_PKGC6_IRTL, msr); |
| 244 |
|
| 245 |
|
| 246 |
msr.hi = 0; |
| 247 |
if (IS_IVY_CPU(cpu_get_cpuid())) |
| 248 |
msr.lo = IRTL_VALID | IRTL_1024_NS | 0x57; |
| 249 |
else |
| 250 |
msr.lo = IRTL_VALID | IRTL_1024_NS | 0x6D; |
| 251 |
wrmsr(MSR_PKGC7_IRTL, msr); |
| 252 |
|
| 253 |
|
| 254 |
msr = rdmsr(MSR_PP0_CURRENT_CONFIG); |
| 255 |
msr.lo &= ~0x1fff; |
| 256 |
if (conf->pp0_current_limit) { |
| 257 |
|
| 258 |
msr.lo |= conf->pp0_current_limit * 8; |
| 259 |
} else { |
| 260 |
printk(BIOS_INFO, "%s: PP0 current limit not set in devicetree\n", dev_path(dev)); |
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
msr.lo |= PP0_CURRENT_LIMIT; |
| 267 |
} |
| 268 |
for (int i = 0; i < VR12_PSI_MAX; i++) { |
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
if (conf->pp0_psi[i].phases != VR12_KEEP_DEFAULT) { |
| 275 |
msr.hi &= ~(0x3ff << (i * 10)); |
| 276 |
msr.hi |= (conf->pp0_psi[i].phases - 1) << (i * 10 + 7); |
| 277 |
msr.hi |= conf->pp0_psi[i].current << (i * 10); |
| 278 |
} else { |
| 279 |
printk(BIOS_INFO, "%s: PP0 PSI%d not set in devicetree\n", dev_path(dev), i); |
| 280 |
} |
| 281 |
} |
| 282 |
msr.lo |= PP0_CURRENT_LIMIT_LOCK; |
| 283 |
wrmsr(MSR_PP0_CURRENT_CONFIG, msr); |
| 284 |
|
| 285 |
|
| 286 |
msr = rdmsr(MSR_PP1_CURRENT_CONFIG); |
| 287 |
msr.lo &= ~0x1fff; |
| 288 |
if (conf->pp1_current_limit) { |
| 289 |
|
| 290 |
msr.lo |= conf->pp1_current_limit * 8; |
| 291 |
} else { |
| 292 |
printk(BIOS_INFO, "%s: PP1 current limit not set in devicetree\n", dev_path(dev)); |
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
if (IS_IVY_CPU(cpu_get_cpuid())) |
| 299 |
msr.lo |= PP1_CURRENT_LIMIT_IVB; |
| 300 |
else |
| 301 |
msr.lo |= PP1_CURRENT_LIMIT_SNB; |
| 302 |
} |
| 303 |
for (int i = 0; i < VR12_PSI_MAX; i++) { |
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
if (conf->pp1_psi[i].phases != VR12_KEEP_DEFAULT) { |
| 310 |
msr.hi &= ~(0x3ff << (i * 10)); |
| 311 |
msr.hi |= (conf->pp1_psi[i].phases - 1) << (i * 10 + 7); |
| 312 |
msr.hi |= conf->pp1_psi[i].current << (i * 10); |
| 313 |
} else { |
| 314 |
printk(BIOS_INFO, "%s: PP1 PSI%d not set in devicetree\n", dev_path(dev), i); |
| 315 |
} |
| 316 |
} |
| 317 |
msr.lo |= PP1_CURRENT_LIMIT_LOCK; |
| 318 |
wrmsr(MSR_PP1_CURRENT_CONFIG, msr); |
| 319 |
} |
| 320 |
|
| 321 |
msr = rdmsr(MSR_PLATFORM_INFO); |
| 322 |
if (msr.lo & PLATFORM_INFO_SET_TURBO_LIMIT) { |
| 323 |
configure_turbo_ratio_limits(conf); |
| 324 |
} else { |
| 325 |
printk(BIOS_INFO, "%s: Programmable ratio limit for turbo mode is disabled\n", |
| 326 |
dev_path(dev)); |
| 327 |
} |
| 328 |
} |
| 329 |
|
| 330 |
static void configure_thermal_target(struct device *dev) |
| 331 |
{ |
| 332 |
struct cpu_intel_model_206ax_config *conf = dev->upstream->dev->chip_info; |
| 333 |
msr_t msr; |
| 334 |
|
| 335 |
if (boot_cpu()) { |
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
msr = rdmsr(MSR_PLATFORM_INFO); |
| 343 |
if ((msr.lo & (1 << 30)) && conf->tcc_offset) { |
| 344 |
msr = rdmsr(MSR_TEMPERATURE_TARGET); |
| 345 |
msr.lo &= ~(0xf << 24); |
| 346 |
msr.lo |= (conf->tcc_offset & 0xf) << 24; |
| 347 |
wrmsr(MSR_TEMPERATURE_TARGET, msr); |
| 348 |
} |
| 349 |
} |
| 350 |
} |
| 351 |
|
| 352 |
static void configure_misc(void) |
| 353 |
{ |
| 354 |
msr_t msr; |
| 355 |
|
| 356 |
msr = rdmsr(IA32_MISC_ENABLE); |
| 357 |
msr.lo |= (1 << 0); |
| 358 |
msr.lo |= (1 << 3); |
| 359 |
msr.lo |= (1 << 16); |
| 360 |
wrmsr(IA32_MISC_ENABLE, msr); |
| 361 |
|
| 362 |
|
| 363 |
msr.lo = 0; |
| 364 |
msr.hi = 0; |
| 365 |
wrmsr(IA32_THERM_INTERRUPT, msr); |
| 366 |
|
| 367 |
if (boot_cpu()) { |
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
msr.lo = 1 << 4; |
| 375 |
msr.hi = 0; |
| 376 |
wrmsr(IA32_PACKAGE_THERM_INTERRUPT, msr); |
| 377 |
} |
| 378 |
} |
| 379 |
|
| 380 |
static void set_max_ratio(void) |
| 381 |
{ |
| 382 |
msr_t msr, perf_ctl; |
| 383 |
|
| 384 |
perf_ctl.hi = 0; |
| 385 |
|
| 386 |
|
| 387 |
if (cpu_config_tdp_levels()) { |
| 388 |
|
| 389 |
msr = rdmsr(MSR_CONFIG_TDP_NOMINAL); |
| 390 |
perf_ctl.lo = (msr.lo & 0xff) << 8; |
| 391 |
} else { |
| 392 |
|
| 393 |
msr = rdmsr(MSR_PLATFORM_INFO); |
| 394 |
perf_ctl.lo = msr.lo & 0xff00; |
| 395 |
} |
| 396 |
wrmsr(IA32_PERF_CTL, perf_ctl); |
| 397 |
|
| 398 |
printk(BIOS_DEBUG, "model_x06ax: frequency set to %d\n", |
| 399 |
((perf_ctl.lo >> 8) & 0xff) * SANDYBRIDGE_BCLK); |
| 400 |
} |
| 401 |
|
| 402 |
unsigned int smbios_cpu_get_max_speed_mhz(void) |
| 403 |
{ |
| 404 |
msr_t msr; |
| 405 |
msr = rdmsr(MSR_TURBO_RATIO_LIMIT); |
| 406 |
return (msr.lo & 0xff) * SANDYBRIDGE_BCLK; |
| 407 |
} |
| 408 |
|
| 409 |
unsigned int smbios_cpu_get_current_speed_mhz(void) |
| 410 |
{ |
| 411 |
msr_t msr; |
| 412 |
msr = rdmsr(MSR_PLATFORM_INFO); |
| 413 |
return ((msr.lo >> 8) & 0xff) * SANDYBRIDGE_BCLK; |
| 414 |
} |
| 415 |
|
| 416 |
unsigned int smbios_processor_external_clock(void) |
| 417 |
{ |
| 418 |
return SANDYBRIDGE_BCLK; |
| 419 |
} |
| 420 |
|
| 421 |
static void model_206ax_report(void) |
| 422 |
{ |
| 423 |
static const char *const mode[] = {"NOT ", ""}; |
| 424 |
char processor_name[49]; |
| 425 |
int vt, txt, aes; |
| 426 |
uint32_t cpu_id, cpu_feature_flag; |
| 427 |
|
| 428 |
|
| 429 |
fill_processor_name(processor_name); |
| 430 |
printk(BIOS_INFO, "CPU: %s.\n", processor_name); |
| 431 |
|
| 432 |
|
| 433 |
cpu_id = cpu_get_cpuid(); |
| 434 |
printk(BIOS_INFO, "CPU: cpuid(1) 0x%x\n", cpu_id); |
| 435 |
|
| 436 |
cpu_feature_flag = cpu_get_feature_flags_ecx(); |
| 437 |
aes = (cpu_feature_flag & CPUID_AES) ? 1 : 0; |
| 438 |
txt = (cpu_feature_flag & CPUID_SMX) ? 1 : 0; |
| 439 |
vt = (cpu_feature_flag & CPUID_VMX) ? 1 : 0; |
| 440 |
printk(BIOS_INFO, "CPU: AES %ssupported\n", mode[aes]); |
| 441 |
printk(BIOS_INFO, "CPU: TXT %ssupported\n", mode[txt]); |
| 442 |
printk(BIOS_INFO, "CPU: VT %ssupported\n", mode[vt]); |
| 443 |
} |
| 444 |
|
| 445 |
static void model_206ax_init(struct device *cpu) |
| 446 |
{ |
| 447 |
|
| 448 |
|
| 449 |
mca_clear_status(); |
| 450 |
|
| 451 |
|
| 452 |
model_206ax_report(); |
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
enable_lapic_tpr(); |
| 458 |
|
| 459 |
|
| 460 |
set_vmx_and_lock(); |
| 461 |
|
| 462 |
|
| 463 |
configure_c_states(cpu); |
| 464 |
|
| 465 |
|
| 466 |
configure_misc(); |
| 467 |
|
| 468 |
|
| 469 |
configure_thermal_target(cpu); |
| 470 |
|
| 471 |
set_aesni_lock(); |
| 472 |
|
| 473 |
|
| 474 |
configure_dca_cap(); |
| 475 |
|
| 476 |
|
| 477 |
set_energy_perf_bias(ENERGY_POLICY_NORMAL); |
| 478 |
|
| 479 |
|
| 480 |
set_max_ratio(); |
| 481 |
|
| 482 |
|
| 483 |
enable_turbo(); |
| 484 |
} |
| 485 |
|
| 486 |
|
| 487 |
static void pre_mp_init(void) |
| 488 |
{ |
| 489 |
|
| 490 |
x86_setup_mtrrs_with_detect(); |
| 491 |
x86_mtrr_check(); |
| 492 |
} |
| 493 |
|
| 494 |
static int get_cpu_count(void) |
| 495 |
{ |
| 496 |
msr_t msr; |
| 497 |
unsigned int num_threads; |
| 498 |
unsigned int num_cores; |
| 499 |
|
| 500 |
msr = rdmsr(MSR_CORE_THREAD_COUNT); |
| 501 |
num_threads = (msr.lo >> 0) & 0xffff; |
| 502 |
num_cores = (msr.lo >> 16) & 0xffff; |
| 503 |
printk(BIOS_DEBUG, "CPU has %u cores, %u threads enabled.\n", |
| 504 |
num_cores, num_threads); |
| 505 |
|
| 506 |
return num_threads; |
| 507 |
} |
| 508 |
|
| 509 |
static void get_microcode_info(const void **microcode, int *parallel) |
| 510 |
{ |
| 511 |
*microcode = intel_microcode_find(); |
| 512 |
*parallel = !intel_ht_supported(); |
| 513 |
} |
| 514 |
|
| 515 |
static void per_cpu_smm_trigger(void) |
| 516 |
{ |
| 517 |
|
| 518 |
smm_relocate(); |
| 519 |
|
| 520 |
|
| 521 |
const void *microcode_patch = intel_microcode_find(); |
| 522 |
intel_microcode_load_unlocked(microcode_patch); |
| 523 |
} |
| 524 |
|
| 525 |
static void post_mp_init(void) |
| 526 |
{ |
| 527 |
|
| 528 |
|
| 529 |
global_smi_enable(); |
| 530 |
|
| 531 |
|
| 532 |
smm_lock(); |
| 533 |
} |
| 534 |
|
| 535 |
static const struct mp_ops mp_ops = { |
| 536 |
.pre_mp_init = pre_mp_init, |
| 537 |
.get_cpu_count = get_cpu_count, |
| 538 |
.get_smm_info = smm_info, |
| 539 |
.get_microcode_info = get_microcode_info, |
| 540 |
.pre_mp_smm_init = smm_initialize, |
| 541 |
.per_cpu_smm_trigger = per_cpu_smm_trigger, |
| 542 |
.relocation_handler = smm_relocation_handler, |
| 543 |
.post_mp_init = post_mp_init, |
| 544 |
}; |
| 545 |
|
| 546 |
void mp_init_cpus(struct bus *cpu_bus) |
| 547 |
{ |
| 548 |
|
| 549 |
mp_init_with_smm(cpu_bus, &mp_ops); |
| 550 |
|
| 551 |
|
| 552 |
mtrr_use_temp_range(CACHE_ROM_BASE, CAR_CACHE_ROM_SIZE, |
| 553 |
MTRR_TYPE_WRPROT); |
| 554 |
} |
| 555 |
|
| 556 |
static struct device_operations cpu_dev_ops = { |
| 557 |
.init = model_206ax_init, |
| 558 |
}; |
| 559 |
|
| 560 |
static const struct cpu_device_id cpu_table[] = { |
| 561 |
{ X86_VENDOR_INTEL, 0x206a0, CPUID_ALL_STEPPINGS_MASK }, |
| 562 |
{ X86_VENDOR_INTEL, 0x306a0, CPUID_ALL_STEPPINGS_MASK }, |
| 563 |
CPU_TABLE_END |
| 564 |
}; |
| 565 |
|
| 566 |
static const struct cpu_driver driver __cpu_driver = { |
| 567 |
.ops = &cpu_dev_ops, |
| 568 |
.id_table = cpu_table, |
| 569 |
}; |