summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Huang <hl@rock-chips.com>2017-07-31 15:12:15 +0800
committerJulius Werner <jwerner@chromium.org>2017-08-01 20:00:25 +0000
commitc93d79b6cbccf9c2732fe8374bd32ac5063aa9d3 (patch)
treee7da1e30ddf71abbafb096daff97ddf1f36e6861
parenta2c5b2f2522346c7b0d4e27a583485bfe70fc896 (diff)
downloadcoreboot-c93d79b6cbccf9c2732fe8374bd32ac5063aa9d3.tar.xz
google/gru: Correct Scarlet pwm regulator minimum value and maximum value
In Scarlet pwm regulatoror minimum value and maximum value differs from other board variants, Correct it so we can get the right voltage. Change-Id: I1f722eabb697b3438d9f4aa29c205b0161eb442a Signed-off-by: Lin Huang <hl@rock-chips.com> Reviewed-on: https://review.coreboot.org/20831 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--src/mainboard/google/gru/pwm_regulator.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mainboard/google/gru/pwm_regulator.c b/src/mainboard/google/gru/pwm_regulator.c
index 696f09a206..3ee74a4426 100644
--- a/src/mainboard/google/gru/pwm_regulator.c
+++ b/src/mainboard/google/gru/pwm_regulator.c
@@ -32,7 +32,7 @@
#define PWM_DESIGN_VOLTAGE_MIN_OUTDATED 8000
#define PWM_DESIGN_VOLTAGE_MAX_OUTDATED 15000
-/* Later boards (Kevin rev6+, Gru rev2+) use different regulator ranges. */
+/* Applies for Kevin rev6+ */
int kevin6_pwm_design_voltage[][2] = {
[PWM_REGULATOR_GPU] = {7858, 12177},
[PWM_REGULATOR_BIG] = {7987, 13022},
@@ -40,6 +40,7 @@ int kevin6_pwm_design_voltage[][2] = {
[PWM_REGULATOR_CENTERLOG] = {8001, 10497}
};
+/* Applies for Gru rev2+ and Bob. */
int pwm_design_voltage[][2] = {
[PWM_REGULATOR_GPU] = {7864, 12177},
[PWM_REGULATOR_BIG] = {8001, 13022},
@@ -47,6 +48,13 @@ int pwm_design_voltage[][2] = {
[PWM_REGULATOR_CENTERLOG] = {7994, 10499}
};
+/* Applies for Scarlet */
+int scarlet_pwm_design_voltage[][2] = {
+ [PWM_REGULATOR_GPU] = {7996, 10990},
+ [PWM_REGULATOR_BIG] = {8000, 12992},
+ [PWM_REGULATOR_LIT] = {8021, 11996},
+};
+
int pwm_enum_to_pwm_number[] = {
[PWM_REGULATOR_GPU] = 0,
[PWM_REGULATOR_LIT] = 2,
@@ -74,6 +82,9 @@ void pwm_regulator_configure(enum pwm_regulator pwm, int millivolt)
} else if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN) && board_id() >= 6) {
voltage_min = kevin6_pwm_design_voltage[pwm][0];
voltage_max = kevin6_pwm_design_voltage[pwm][1];
+ } else if (IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET)) {
+ voltage_min = scarlet_pwm_design_voltage[pwm][0];
+ voltage_max = scarlet_pwm_design_voltage[pwm][1];
}
assert(voltage <= voltage_max && voltage >= voltage_min);