[coreboot-gerrit] Change in coreboot[master]: soc/intel/skylake: Correct PsysPL2 calculation

Shelley Chen (Code Review) gerrit at coreboot.org
Tue Jan 9 03:28:30 CET 2018


Shelley Chen has uploaded this change for review. ( https://review.coreboot.org/23181


Change subject: soc/intel/skylake: Correct PsysPL2 calculation
......................................................................

soc/intel/skylake: Correct PsysPL2 calculation

When setting the PsysPL2 value in the PLATFORM_POWER_LIMIT MSR, we
were multiplying it unnecessarily by the power_unit from hte
RAPL_POWER_UNIT MSR.  Removing this multiplier before writing to the
MSR.

BUG=b:71594855
BRANCH=None
TEST=Run fishtank and ensure that max system power doesn't exceed
     the value set in tdp_psyspl2 in the devicetree.cb file.

Change-Id: I0669d527c8d6189537b4d78728a41ce462ff5eb1
Signed-off-by: Shelley Chen <shchen at chromium.org>
---
M src/soc/intel/skylake/cpu.c
1 file changed, 2 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/23181/1

diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c
index 291a40d..8463c34 100644
--- a/src/soc/intel/skylake/cpu.c
+++ b/src/soc/intel/skylake/cpu.c
@@ -166,7 +166,7 @@
 	tdp_pl2 = (conf->tdp_pl2_override == 0) ?
 		(tdp * 125) / 100 : (conf->tdp_pl2_override * power_unit);
 	printk(BIOS_DEBUG, "CPU PL2 = %u Watts\n", tdp_pl2 / power_unit);
-	limit.hi |= (tdp_pl2) & PKG_POWER_LIMIT_MASK;
+	limit.hi |= tdp_pl2 & PKG_POWER_LIMIT_MASK;
 	limit.hi |= PKG_POWER_LIMIT_CLAMP;
 	limit.hi |= PKG_POWER_LIMIT_EN;
 
@@ -183,8 +183,7 @@
 		limit.hi = 0;
 		printk(BIOS_DEBUG, "CPU PsysPL2 = %u Watts\n",
 			conf->tdp_psyspl2);
-		limit.hi |= (conf->tdp_psyspl2 * power_unit) &
-			PKG_POWER_LIMIT_MASK;
+		limit.hi |= conf->tdp_psyspl2 &	PKG_POWER_LIMIT_MASK;
 		limit.hi |= PKG_POWER_LIMIT_CLAMP;
 		limit.hi |= PKG_POWER_LIMIT_EN;
 

-- 
To view, visit https://review.coreboot.org/23181
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0669d527c8d6189537b4d78728a41ce462ff5eb1
Gerrit-Change-Number: 23181
Gerrit-PatchSet: 1
Gerrit-Owner: Shelley Chen <shchen at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180109/2f7b9095/attachment-0001.html>


More information about the coreboot-gerrit mailing list