11 #define MAX_CPU_CACHE (256 * KiB)
24 total_cache += ~(mtrr.
lo & 0xfffff000) + 1;
53 "PROG_RUN: CPU does not support caching ROM\n"
54 "The next stage will run slowly!\n");
60 "PROG_RUN: No MTRR available to cache ROM!\n"
61 "The next stage will run slowly!\n");
67 "PROG_RUN: No more cache available for the next stage\n"
68 "The next stage will run slowly!\n");
81 if (mtrr_base + mtrr_size < end) {
86 const uint32_t lower_coverage = mtrr_base + mtrr_size -
base;
87 const uint32_t upper_coverage =
MIN(alt_base + mtrr_size, end) - alt_base;
88 if (upper_coverage > lower_coverage)
93 "PROG_RUN: Setting MTRR to cache XIP stage. base: 0x%08x, size: 0x%08x\n",
94 mtrr_base, mtrr_size);
static unsigned int cpuid_eax(unsigned int op)
static void get_fms(struct cpuinfo_x86 *c, uint32_t tfms)
#define printk(level,...)
static __always_inline msr_t rdmsr(unsigned int index)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_NOTICE
BIOS_NOTICE - Unexpected but relatively insignificant.
int get_free_var_mtrr(void)
void set_var_mtrr(unsigned int reg, unsigned int base, unsigned int size, unsigned int type)
static void * prog_start(const struct prog *prog)
static size_t prog_size(const struct prog *prog)
#define MTRR_PHYS_MASK(reg)
static int get_var_mtrr_count(void)
#define MTRR_PHYS_MASK_VALID
static uint32_t max_cache_used(void)
void platform_prog_run(struct prog *prog)