From 57ff302a6cfffa29e1a611901e5671fa5a1e1b26 Mon Sep 17 00:00:00 2001 From: Sridhar Siricilla Date: Thu, 2 Dec 2021 09:48:44 +0530 Subject: soc/intel/common: Refactor cpu_set_p_state_to_max_non_turbo_ratio The patch refectors cpu_set_p_state_to_max_non_turbo_ratio(). The function is updated to use cpu_get_max_non_turbo_ratio(). TEST=Build the code for Brya Signed-off-by: Sridhar Siricilla Change-Id: If73df17faaf7b870ae311460a868d52352683c0c Reviewed-on: https://review.coreboot.org/c/coreboot/+/59789 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/soc/intel/common/block/cpu/cpulib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/soc') diff --git a/src/soc/intel/common/block/cpu/cpulib.c b/src/soc/intel/common/block/cpu/cpulib.c index 617968a1bc..27ff8cd151 100644 --- a/src/soc/intel/common/block/cpu/cpulib.c +++ b/src/soc/intel/common/block/cpu/cpulib.c @@ -137,11 +137,10 @@ void cpu_set_p_state_to_nominal_tdp_ratio(void) */ void cpu_set_p_state_to_max_non_turbo_ratio(void) { - msr_t msr, perf_ctl; + msr_t perf_ctl; /* Platform Info bits 15:8 give max ratio */ - msr = rdmsr(MSR_PLATFORM_INFO); - perf_ctl.lo = msr.lo & 0xff00; + perf_ctl.lo = (cpu_get_max_non_turbo_ratio() << 8) & 0xff00; perf_ctl.hi = 0; set_perf_control_msr(perf_ctl); -- cgit v1.2.3