summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2020-06-08 22:12:13 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-11 03:19:46 +0000
commit4aacf83506fd959d1341e29b664f6e4fe97824cb (patch)
tree46003fbfc642ca56ef8582fdae5868760c2111e0 /power
parent0ca41341b9bb80b3e640aaa516a16e2096327515 (diff)
downloadchrome-ec-4aacf83506fd959d1341e29b664f6e4fe97824cb.tar.gz
system: Clear AP_IDLE when waking up from hibernation by AC
Currently, AP_IDLE is set when EC is left idle in G3. This makes the AP stay off after EC wakes up from hibernation (for any wake-up source). This makes a board require another power button press to boot the system from hibernation. This change makes RO clear AP_IDLE unless AC is present. When AC is present, EC doesn't hibernate. So, AC presence infers the EC woke up from hibernation by AC. That is, if the system wakes up by a power button press, AP_IDLE is cleared and AP will be turned on (unless it's overwritten by AP_OFF). Tested as follows on Trembyle: 1. Put DUT in hibernation. 2. Wake up DUT and observe: a. When waking up by power button, AP is turned on. b. When waking up by lid open, AP is turned on. c. When waking up by AC, AP is left idle. BUG=b:157077589, chromium:1073960 BRANCH=none TEST=See above. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ie5020bbe50ad489f4e3010820681cc57ff51b941 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2236589
Diffstat (limited to 'power')
-rw-r--r--power/common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/power/common.c b/power/common.c
index ea5bad51f8..cc06d0891a 100644
--- a/power/common.c
+++ b/power/common.c
@@ -348,10 +348,11 @@ static enum power_state power_common_state(enum power_state state)
&target, now)) {
case CRITICAL_SHUTDOWN_HIBERNATE:
CPRINTS("Hibernate due to G3 idle");
- if (IS_ENABLED(CONFIG_VBOOT_EFS2)) {
+ if (IS_ENABLED(CONFIG_EXTPOWER_GPIO) &&
+ IS_ENABLED(CONFIG_VBOOT_EFS2)) {
uint32_t reset_flags;
reset_flags = chip_read_reset_flags() |
- EC_RESET_FLAG_AP_OFF;
+ EC_RESET_FLAG_AP_IDLE;
chip_save_reset_flags(reset_flags);
}
system_hibernate(0, 0);