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 <sridhar.siricilla@intel.com>
Change-Id: If73df17faaf7b870ae311460a868d52352683c0c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59789
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Sridhar Siricilla 2021-12-02 09:48:44 +05:30 committed by Patrick Georgi
parent 7424576e41
commit 57ff302a6c
1 changed files with 2 additions and 3 deletions

View File

@ -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);