[coreboot-gerrit] Change in coreboot[master]: google/fizz: Adjust PL2 and PsysPl2 values for power loss

Shelley Chen (Code Review) gerrit at coreboot.org
Fri Jan 26 22:38:06 CET 2018


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


Change subject: google/fizz: Adjust PL2 and PsysPl2 values for power loss
......................................................................

google/fizz: Adjust PL2 and PsysPl2 values for power loss

Set PsysPl2 values to 90% of max adapter power for all types of
adapters (typeC and barrel jack) to account for a 10 % power loss from
the adapter to the soc.

BUG=b:71594855
BRANCH=None
TEST=reboot device and make sure Pl2 and PsysPl2 MSRs are properly set
     with iotools rdmsr command on both U42 and U22 skus with both
     typeC and barrel jack power adapters.

Change-Id: I8425c6d4d669449eccb9324ff58ff6d1662c5c43
Signed-off-by: Shelley Chen <shchen at chromium.org>
---
M src/mainboard/google/fizz/mainboard.c
1 file changed, 30 insertions(+), 20 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/23457/1

diff --git a/src/mainboard/google/fizz/mainboard.c b/src/mainboard/google/fizz/mainboard.c
index 4e7f316..f3d2970 100644
--- a/src/mainboard/google/fizz/mainboard.c
+++ b/src/mainboard/google/fizz/mainboard.c
@@ -43,7 +43,7 @@
  * For type-C chargers, set PL2 to 90% of max power to account for
  * cable loss and FET Rdson loss in the path from the source.
  */
-#define GET_TYPEC_PL2(w)   (9 * (w) / 10)
+#define SET_PSYSPL2(w)     (9 * (w) / 10)
 
 #define OEM_ID_COUNT	3
 #define SKU_ID_COUNT	7
@@ -108,17 +108,26 @@
  *
  * Set Pl2 and SysPl2 values based on detected charger.
  * If detected barrel jack, use values below based on SKU.
- * +-------------+-----+---------+-------------------+
- * | sku_id      | PL2 | PsysPL2 | Pmax (Prop = 48W) |
- * +-------------+-----+---------+-------------------+
- * | i7 U42      |  44 |   90    |       119         |
- * | i5 U42      |  44 |   90    |       119         |
- * | i3 U42      |  44 |   90    |       119         |
- * | i7 U22      |  29 |   65    |        91         |
- * | i5 U22      |  29 |   65    |        91         |
- * | i3 U22      |  29 |   65    |        91         |
- * | celeron U22 |  29 |   65    |        91         |
- * +-------------+-----+---------+-------------------+
+ * +-------------+-----+---------+-----+------+------+
+ * | sku_id      | PL2 | PsysPL2 | PL4 | Pmax | Prop |
+ * +-------------+-----+---------+-----+------+------+
+ * | i7 U42      |  44 |   81    | 77  |  120 |  48  |
+ * | i5 U42      |  44 |   81    | 77  |  120 |  48  |
+ * | i3 U42      |  44 |   81    | 77  |  120 |  48  |
+ * | i7 U22      |  29 |   58    | 43  |   91 |  48  |
+ * | i5 U22      |  29 |   58    | 43  |   91 |  48  |
+ * | i3 U22      |  29 |   58    | 43  |   91 |  48  |
+ * | celeron U22 |  29 |   58    | 43  |   91 |  48  |
+ * +-------------+-----+---------+-----+------+------+
+ * For USB C charger:
+ * +-------------+-----+---------+-----+------+------+
+ * | Max Power(W)| PL2 | PsysPL2 | PL4 | Pmax | Prop |
+ * +-------------+-----+---------+-----+------+------+
+ * | 60 (U42)    |  44 |   54    |  54 |  120 |  48  |
+ * | 60 (U22)    |  29 |   54    |  43 |   91 |  48  |
+ * | X  (U42)    |  44 |   .9X   | .9X |  120 |  48  |
+ * | X  (U22)    |  29 |   .9X   | .9X |   91 |  48  |
+ * +-------------+-----+---------+-----+------+------+
  */
 static void mainboard_set_power_limits(u32 *pl2_val, u32 *psyspl2_val)
 {
@@ -131,25 +140,26 @@
 				  (1 << FIZZ_SKU_ID_I5_U42) |
 				  (1 << FIZZ_SKU_ID_I3_U42);
 
+	/* PL2 value is sku-based, no matter what charger we are using */
+	pl2 = FIZZ_PL2_U22;
+	if ((1 << sku) & u42_mask)
+		pl2 = FIZZ_PL2_U42;
+
 	/* If we can't get charger info or not PD charger, assume barrel jack */
 	if (rv != 0 || type != USB_CHG_TYPE_PD) {
-		/* using the barrel jack, get PL2 based on sku id */
-		pl2 = FIZZ_PL2_U22;
+		/* using the barrel jack, get PsysPL2 based on sku id */
 		psyspl2 = FIZZ_PSYSPL2_U22;
 		/* Running a U42 SKU */
-		if ((1 << sku) & u42_mask) {
-			pl2 = FIZZ_PL2_U42;
+		if ((1 << sku) & u42_mask)
 			psyspl2 = FIZZ_PSYSPL2_U42;
-		}
-
 	} else {
 		/* Base on max value of adapter */
-		pl2 = GET_TYPEC_PL2(watts);
 		psyspl2 = watts;
 	}
 
 	*pl2_val = pl2;
-	*psyspl2_val = psyspl2;
+	/* set psyspl2 to 90% of max adapter power */
+	*psyspl2_val = SET_PSYSPL2(psyspl2);
 }
 
 static uint8_t board_oem_id(void)

-- 
To view, visit https://review.coreboot.org/23457
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: I8425c6d4d669449eccb9324ff58ff6d1662c5c43
Gerrit-Change-Number: 23457
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/20180126/cfd3c04b/attachment.html>


More information about the coreboot-gerrit mailing list