From d67edcae6e9d438f2e60f6b67d97a7d3f09cb18b Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Tue, 13 Nov 2018 19:28:07 +0100 Subject: soc/intel/common: Bring DISPLAY_MTRRS into the light Initially, I wanted to move only the Kconfig DISPLAY_MTRRS into the "Debug" menu. It turned out, though, that the code looks rather generic. No need to hide it in soc/intel/. To not bloat src/Kconfig up any further, start a new `Kconfig.debug` hierarchy just for debug options. If somebody wants to review the code if it's 100% generic, we could even get rid of HAVE_DISPLAY_MTRRS. Change-Id: Ibd0a64121bd6e4ab5d7fd835f3ac25d3f5011f24 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/29684 Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/include/cpu/x86/mtrr.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/include') diff --git a/src/include/cpu/x86/mtrr.h b/src/include/cpu/x86/mtrr.h index 1f704ac869..eb7d78d1c5 100644 --- a/src/include/cpu/x86/mtrr.h +++ b/src/include/cpu/x86/mtrr.h @@ -99,10 +99,17 @@ void x86_mtrr_check(void); * This function needs to be called after the first MTRR solution is derived. */ void mtrr_use_temp_range(uintptr_t begin, size_t size, int type); +static inline int get_var_mtrr_count(void) +{ + return rdmsr(MTRR_CAP_MSR).lo & MTRR_CAP_VCNT; +} + void set_var_mtrr(unsigned int reg, unsigned int base, unsigned int size, unsigned int type); int get_free_var_mtrr(void); +asmlinkage void display_mtrrs(void); + /* * Set the MTRRs using the data on the stack from setup_stack_and_mtrrs. * Return a new top_of_stack value which removes the setup_stack_and_mtrrs data. -- cgit v1.2.3