#include <cpu/x86/msr.h>
#include <cpu/x86/lapic.h>
#include <cpu/intel/microcode.h>
+#include <cpu/intel/speedstep.h>
+#include <cpu/intel/acpi.h>
#include <cpu/intel/hyperthreading.h>
#include <cpu/x86/cache.h>
-#include <cpu/x86/mtrr.h>
#include <cpu/x86/name.h>
#include <usbdebug.h>
#define PMG_IO_BASE_ADDR 0xe3
#define PMG_IO_CAPTURE_ADDR 0xe4
-/* MWAIT coordination I/O base address. This must match
- * the \_PR_.CPU0 PM base address.
- */
-#define PMB0_BASE 0x510
-
-/* PMB1: I/O port that triggers SMI once cores are in the same state.
- * See CSM Trigger, at PMG_CST_CONFIG_CONTROL[6:4]
- */
-#define PMB1_BASE 0x800
#define HIGHEST_CLEVEL 3
static void configure_c_states(void)
{
msr.lo |= (1 << 20); /* Lock Enhanced SpeedStep Enable */
wrmsr(IA32_MISC_ENABLE, msr);
+
+ // set maximum CPU speed
+ msr = rdmsr(IA32_PERF_STS);
+ int busratio_max=(msr.hi >> (40-32)) & 0x1f;
+
+ msr = rdmsr(IA32_PLATFORM_ID);
+ int vid_max=msr.lo & 0x3f;
+
+ msr.lo &= ~0xffff;
+ msr.lo |= busratio_max << 8;
+ msr.lo |= vid_max;
+
+ wrmsr(IA32_PERF_CTL, msr);
}
#define PIC_SENS_CFG 0x1aa
#endif
/* Setup MTRRs */
- x86_setup_mtrrs(36);
+ x86_setup_mtrrs();
x86_mtrr_check();
/* Setup Page Attribute Tables (PAT) */