From 653f019d0d4de5e50281edae2f1d88af58e53388 Mon Sep 17 00:00:00 2001 From: Pratik Prajapati Date: Mon, 28 Aug 2017 15:15:38 -0700 Subject: soc/intel/skylake: Implement UNCORE PRMRR get base and mask API Implement soc_get_uncore_prmmr_base_and_mask() API for SKL/KBL Change-Id: I880d3d88138809cdf030507877079cbea52a0d97 Signed-off-by: Pratik Prajapati Reviewed-on: https://review.coreboot.org/21245 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/soc/intel/skylake/systemagent.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/soc/intel/skylake/systemagent.c b/src/soc/intel/skylake/systemagent.c index 6149fa2126..ba7c3075cd 100644 --- a/src/soc/intel/skylake/systemagent.c +++ b/src/soc/intel/skylake/systemagent.c @@ -15,12 +15,14 @@ * GNU General Public License for more details. */ +#include #include #include #include #include #include #include +#include #include /* @@ -62,3 +64,14 @@ void soc_systemagent_init(struct device *dev) mdelay(1); set_power_limits(28); } + +int soc_get_uncore_prmmr_base_and_mask(uint64_t *prmrr_base, + uint64_t *prmrr_mask) +{ + msr_t msr; + msr = rdmsr(UNCORE_PRMRR_PHYS_BASE_MSR); + *prmrr_base = (uint64_t) msr.hi << 32 | msr.lo; + msr = rdmsr(UNCORE_PRMRR_PHYS_MASK_MSR); + *prmrr_mask = (uint64_t) msr.hi << 32 | msr.lo; + return 0; +} -- cgit v1.2.3