Mario Scheithauer has uploaded this change for review. ( https://review.coreboot.org/25584
Change subject: soc/intel/common/block/cpu: Fix cpu_get_power_max ......................................................................
soc/intel/common/block/cpu: Fix cpu_get_power_max
To avoid rounding errors with the current data types, the formula in this function must be converted.
Change-Id: I75d05165fd9e5a0992330df00f8665a05d2daeb3 Signed-off-by: Mario Scheithauer mario.scheithauer@siemens.com --- M src/soc/intel/common/block/cpu/cpulib.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/25584/1
diff --git a/src/soc/intel/common/block/cpu/cpulib.c b/src/soc/intel/common/block/cpu/cpulib.c index ed1ba0f..0b1599a 100644 --- a/src/soc/intel/common/block/cpu/cpulib.c +++ b/src/soc/intel/common/block/cpu/cpulib.c @@ -287,7 +287,7 @@ msr = rdmsr(MSR_PKG_POWER_SKU_UNIT); power_unit = 2 << ((msr.lo & 0xf) - 1); msr = rdmsr(MSR_PKG_POWER_SKU); - return ((msr.lo & 0x7fff) / power_unit) * 1000; + return (msr.lo & 0x7fff) * 1000 / power_unit; }
uint32_t cpu_get_max_turbo_ratio(void)