From f52288f9350324602552481bd3647e11a97f99c6 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Thu, 1 Sep 2016 11:50:18 -0700 Subject: 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 Original-Commit-Id: 4e8be3f09ac16c1c9782dee634e5704e0bd6c7f9 Original-Change-Id: I723dc09b9711c7c6d2b3402d012198438309a8ff Original-Signed-off-by: Julius Werner Original-Reviewed-on: https://chromium-review.googlesource.com/379921 Original-Reviewed-by: Douglas Anderson Reviewed-on: https://review.coreboot.org/16580 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Patrick Georgi --- src/mainboard/google/gru/pwm_regulator.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/mainboard/google/gru/pwm_regulator.c') diff --git a/src/mainboard/google/gru/pwm_regulator.c b/src/mainboard/google/gru/pwm_regulator.c index f382b2b58c..d0cdf43682 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); -- cgit v1.2.3