[coreboot-gerrit] New patch to review for coreboot: google/gru: Fix up PWM regulator ranges

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Mon Sep 12 18:20:44 CEST 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16580

-gerrit

commit 599ed4670494a13f3c025d69e983eb01f807b497
Author: Julius Werner <jwerner at chromium.org>
Date:   Thu Sep 1 11:50:18 2016 -0700

    google/gru: Fix up PWM regulator ranges
    
    We did yet another small adjustment to the PWM regulator ranges for
    Kevin rev6... this patch reflects that in code. Also rewrite code and
    descriptions to indicate that these new ranges are not just for Kevin,
    but also planned to be used on Gru rev2 and any future Gru derivatives
    (which as I understand it is the plan, right?).
    
    BRANCH=None
    BUG=chrome-os-partner:54888
    TEST=Booted my rev5, for whatever that's worth...
    
    Change-Id: Id78501453814d0257ee86a05f6dbd6118b719309
    Signed-off-by: Martin Roth <martinroth at chromium.org>
    Original-Commit-Id: 4e8be3f09ac16c1c9782dee634e5704e0bd6c7f9
    Original-Change-Id: I723dc09b9711c7c6d2b3402d012198438309a8ff
    Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/379921
    Original-Reviewed-by: Douglas Anderson <dianders at chromium.org>
---
 src/mainboard/google/gru/pwm_regulator.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/mainboard/google/gru/pwm_regulator.c b/src/mainboard/google/gru/pwm_regulator.c
index f382b2b..d0cdf43 100644
--- a/src/mainboard/google/gru/pwm_regulator.c
+++ b/src/mainboard/google/gru/pwm_regulator.c
@@ -31,12 +31,12 @@
 #define PWM_DESIGN_VOLTAGE_MIN	8000
 #define PWM_DESIGN_VOLTAGE_MAX	15000
 
-/* The min & max design voltages are different after kevin-r6 */
-int kevin_voltage_min_max_r6[][2] = {
-	[PWM_REGULATOR_GPU] = {7910, 12139},
-	[PWM_REGULATOR_BIG] = {7986, 13057},
-	[PWM_REGULATOR_LIT] = {7997, 13002},
-	[PWM_REGULATOR_CENTERLOG] = {7996, 10507}
+/* Later boards (Kevin rev6+, Gru rev2+) use different regulator ranges. */
+int pwm_design_voltage_later[][2] = {
+	[PWM_REGULATOR_GPU] = {7858, 12177},
+	[PWM_REGULATOR_BIG] = {7987, 13022},
+	[PWM_REGULATOR_LIT] = {7991, 13037},
+	[PWM_REGULATOR_CENTERLOG] = {8001, 10497}
 };
 
 void pwm_regulator_configure(enum pwm_regulator pwm, int millivolt)
@@ -61,9 +61,10 @@ void pwm_regulator_configure(enum pwm_regulator pwm, int millivolt)
 
 	voltage_min = PWM_DESIGN_VOLTAGE_MIN;
 	voltage_max = PWM_DESIGN_VOLTAGE_MAX;
-	if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN) && board_id() >= 6) {
-		voltage_min = kevin_voltage_min_max_r6[pwm][0];
-		voltage_max = kevin_voltage_min_max_r6[pwm][1];
+	if (!(IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN) && board_id() < 6) &&
+	    !(IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU) && board_id() < 2)) {
+		voltage_min = pwm_design_voltage_later[pwm][0];
+		voltage_max = pwm_design_voltage_later[pwm][1];
 	}
 
 	assert(voltage <= voltage_max && voltage >= voltage_min);



More information about the coreboot-gerrit mailing list