From c93d79b6cbccf9c2732fe8374bd32ac5063aa9d3 Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Mon, 31 Jul 2017 15:12:15 +0800 Subject: 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 Reviewed-on: https://review.coreboot.org/20831 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/mainboard/google/gru/pwm_regulator.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3