diff options
author | Wai-Hong Tam <waihong@google.com> | 2019-12-07 12:03:38 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-10 22:21:33 +0000 |
commit | f1e139f6b87a9e35209b8221264d2899a429d071 (patch) | |
tree | 9041924eb9f4997ab692c9c87b00f1b4ad44252d /power | |
parent | a7caa808133041759366f45b90d4fa8d252a5a62 (diff) | |
download | chrome-ec-f1e139f6b87a9e35209b8221264d2899a429d071.tar.gz |
Trogdor: On startup, turn off the system without check
The original check in the init hook (power_chipset_init) may cause
watchdog reset, as the init hook is earlier than the task execution
that we should not perform any long action, like waiting for a signal
in our case.
We should simply turn off the switchcap without any check.
In most of the common cases (except flashing EC/AP), the switchcap
should be off and the check is unnecessary.
BRANCH=None
BUG=b:145843686
TEST=Performed flashing EC and AP, EC watchdog reset not seen.
Change-Id: I36873e773800def7e3dfceaec28c294dee9a09c7
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1955107
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'power')
-rw-r--r-- | power/sc7180.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/power/sc7180.c b/power/sc7180.c index 21be404e2c..a29c1078a2 100644 --- a/power/sc7180.c +++ b/power/sc7180.c @@ -327,6 +327,21 @@ static void wait_pmic_pwron(int enable, unsigned int timeout) } /** + * Set the state of the system power signals but without any check. + * + * The system power signals are the enable pins of SwitchCap and VBOB. + * They control the power of the set of PMIC chips and the AP. + * + * @param enable 1 to enable or 0 to disable + */ +static void set_system_power_no_check(int enable) +{ + gpio_set_level(GPIO_SWITCHCAP_ON, enable); + /* TODO: VBOB_EN GPIO is NC, just a backup. Remove it later. */ + gpio_set_level(GPIO_VBOB_EN, enable); +} + +/** * Set the state of the system power signals. * * The system power signals are the enable pins of SwitchCap and VBOB. @@ -337,10 +352,8 @@ static void wait_pmic_pwron(int enable, unsigned int timeout) static void set_system_power(int enable) { CPRINTS("%s(%d)", __func__, enable); - gpio_set_level(GPIO_SWITCHCAP_ON, enable); + set_system_power_no_check(enable); wait_switchcap_power_good(enable); - /* TODO: VBOB_EN GPIO is NC, just a backup. Remove it later. */ - gpio_set_level(GPIO_VBOB_EN, enable); if (enable) { usleep(SYSTEM_POWER_ON_DELAY); } else { @@ -410,7 +423,7 @@ enum power_state power_chipset_init(void) */ if (!(reset_flags & EC_RESET_FLAG_SYSJUMP)) { CPRINTS("not sysjump; forcing system shutdown"); - set_system_power(0); + set_system_power_no_check(0); init_power_state = POWER_G3; } else { /* In the SYSJUMP case, we check if the AP is on */ |