20 #define SMRR_SUPPORTED (1 << 11)
22 #define D_OPEN (1 << 6)
23 #define D_CLS (1 << 5)
24 #define D_LCK (1 << 4)
25 #define G_SMRAME (1 << 3)
26 #define C_BASE_SEG ((0 << 2) | (1 << 1) | (0 << 0))
37 switch (
c.x86_model) {
55 "SMRR not enabled, skip writing SMRR...\n");
72 const u32 rmask = ~((1 << 12) - 1);
78 "TSEG base not aligned with TSEG SIZE! Not setting SMRR\n");
90 params->smrr_base.lo &= rmask;
105 ied_base = (
void *)
params->ied_base;
108 memcpy(ied_base, &ied,
sizeof(ied));
111 memset(ied_base + (1 << 20), 0, (32 << 10));
126 size_t *smm_save_state_size)
140 *smm_save_state_size =
sizeof(em64t101_smm_state_save_area_t);
166 u32 smbase = staggered_smbase;
static unsigned int cpuid_eax(unsigned int op)
static void get_fms(struct cpuinfo_x86 *c, uint32_t tfms)
void * memcpy(void *dest, const void *src, size_t n)
void * memset(void *dstpp, int c, size_t len)
static struct sdram_info params
#define printk(level,...)
void smm_relocation_handler(int cpu, uintptr_t curr_smbase, uintptr_t staggered_smbase)
void smm_initialize(void)
void smm_info(uintptr_t *perm_smbase, size_t *perm_smsize, size_t *smm_save_state_size)
static void write_smrr_alt(struct smm_relocation_params *relo_params)
static void setup_ied_area(struct smm_relocation_params *params)
bool cpu_has_alternative_smrr(void)
static void fill_in_relocation_params(struct smm_relocation_params *params)
void smm_initiate_relocation(void)
static __always_inline msr_t rdmsr(unsigned int index)
#define IA32_FEATURE_CONTROL
#define FEATURE_CONTROL_LOCK_BIT
static __always_inline void wrmsr(unsigned int index, msr_t msr)
void smm_region(uintptr_t *start, size_t *size)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
static const struct smm_save_state_ops * save_state
struct smm_relocation_params smm_reloc_params
void smm_southbridge_clear_state(void)
static void write_smrr(struct smm_relocation_params *relo_params)
void northbridge_write_smram(u8 smram)
#define c(value, pmcreg, dst_bits)
int smm_subregion(int sub, uintptr_t *start, size_t *size)
#define CORE2_SMRR_PHYS_MASK
#define CORE2_SMRR_PHYS_BASE
#define MTRR_PHYS_MASK_VALID