[coreboot-gerrit] Patch set updated for coreboot: google/gru: Add new PWM regulator duty numbers for revision 6

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Wed Aug 17 03:51:31 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/16235

-gerrit

commit afc8da91c4fb08662399c0266375c4a744017be3
Author: Julius Werner <jwerner at chromium.org>
Date:   Thu Aug 11 16:37:57 2016 -0700

    google/gru: Add new PWM regulator duty numbers for revision 6
    
    We're changing the PWM regulator bounds on Kevin from rev6 onwards, so
    we'll need to use different duty cycle values for them. We really want a
    proper PWM regulator driver that can calculate these values
    automatically from voltages, but until we have that this patch just
    hardcodes the new numbers in.
    
    (Yes, this is a patch for the mainboard/google/gru board family that only
    touches a file from the rockchip/rk3399 SoC. That too is something
    that'll be fixed up in a later CL.)
    
    BRANCH=None
    BUG=chrome-os-partner:54888
    TEST=Booted Kevin rev4 (for whatever that's worth...).
    
    Change-Id: Ibb6ab5c6517d83ffb5e32cb17d0de33e8ec10293
    Signed-off-by: Martin Roth <martinroth at chromium.org>
    Original-Commit-Id: 4cb2a939295e2b6443c5dbd3374982224322304b
    Original-Change-Id: I8757cc54f2478d20bb948a1a0a7398b0404a7b1f
    Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/368410
    Original-Commit-Ready: Dan Shi <dshi at chromium.org>
    Original-Reviewed-by: Douglas Anderson <dianders at chromium.org>
---
 src/soc/rockchip/rk3399/romstage.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/soc/rockchip/rk3399/romstage.c b/src/soc/rockchip/rk3399/romstage.c
index 8adaa7c..ccf42b9 100644
--- a/src/soc/rockchip/rk3399/romstage.c
+++ b/src/soc/rockchip/rk3399/romstage.c
@@ -79,12 +79,24 @@ static void init_dvs_outputs(void)
 	 */
 	duty_ns = 2860; /* 0.9v */
 
+	/* TODO: Clean all this up, implement proper pwm_regulator driver. */
 	if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN)) {
 		id = board_id();
 		if (id <= 2)
 			duty_ns = 1906; /* 1.1v */
 		else if (id == 3)
 			duty_ns = 2621; /* 0.95v */
+		else if (id >= 6) {
+			/* GPU: 3337 * (12043 - 9000) / (12043 - 7984) = 2501 */
+			pwm_init(0, 3337, 2501);
+			/* BIG: 3337 * (12837 - 9000) / (12837 - 7985) = 2638 */
+			pwm_init(1, 3337, 2638);
+			/* LIT: 3337 * (12807 - 9000) / (12807 - 8009) = 2647 */
+			pwm_init(2, 3337, 2647);
+			/* CTR: 3337 * (10507 - 9500) / (10507 - 7996) = 1338 */
+			pwm_init(3, 3337, 1338);
+			return;
+		}
 	}
 
 	for (i = 0; i < 4; i++)



More information about the coreboot-gerrit mailing list