summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorLouis Yung-Chieh Lo <yjlou@chromium.org>2014-04-29 17:39:35 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-03 02:11:36 +0000
commitd1921632fc8926fa5a566ba14bfe718881fd8bea (patch)
tree43b1faf2c4e39b6da1e0270162af2ec44ebf2a30 /power
parent8980e9a53af9676f721474c141c8b29545de0af5 (diff)
downloadchrome-ec-d1921632fc8926fa5a566ba14bfe718881fd8bea.tar.gz
tegra: keeps AP in off state for "reboot ap-off"
XPSHOLD is not always removed after chipset_force_shutdown(). This is different to the GAIA design. So, check the RESET_FLAG_AP_OFF flag again while check_for_power_on_event(). BUG=chrome-os-partner:28371 BRANCH=tot,nyan TEST=verify on big. re-flash ec: power on 2, AP is up. AP is on, reboot@EC: power on 1, AP is up. AP is off, reboot@EC: power on 2, AP is up. AP is on, reboot ap-off@EC: AP keeps off (see FLAG_AP_OFF flag) AP is off, reboot ap-off@EC: AP keeps off (see FLAG_AP_OFF flag) reboot ap-off@EC, then 'powerbtn': AP is off at boot, then power on 4 reboot@EC: power on 2, AP is up. re-plug AC (remove battery): power on 2 re-plug battery (without AC): power on 2 (but my battery is dead) power off (S5), power on: power off 4, power on 5 power off (G3), power on: power off 4, power on 5 lid close / power off (S5)/ lid open: power on 3 lid close / power off (G3)/ lid open: power on 3 press power button and release: nothing happens after 15s. AP keeps in S5. button off (S5)/ on: power off 3, power on 4 button off (G3)/ on: power off 3, power on 4 power off (S5)/ button on: power off 4, power on 4 power off (G3)/ button on: power off 4, power on 4 button off (S5)/ power on: power off 3, power on 5 button off (G3)/ power on: power off 3, power on 4 button off (S5)/ lid open: power off 3, power on 3 button off (G3)/ lid open: power off 3, power on 3 is off, long press button (60s): power on 4, too long, shutdown, stay off is on, long press button (60s): power off 3, stay off AP is on, apreset cold: entered to S5, power off 3, power on 5 AP is on, apreset warm: power state is not changed, but reboots to BIOS Change-Id: I9ccd13ab4b5f38be1ad8d6c9a04724b56bc5b166 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/197604 Reviewed-by: David Hendricks <dhendrix@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/tegra.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/power/tegra.c b/power/tegra.c
index b8d9a239f7..b263980662 100644
--- a/power/tegra.c
+++ b/power/tegra.c
@@ -282,9 +282,20 @@ static int check_for_power_on_event(void)
{
/* check if system is already ON */
if (power_get_signals() & IN_XPSHOLD) {
- CPRINTF("[%T system is on, thus clear auto_power_on]\n");
- auto_power_on = 0; /* no need to arrange another power on */
- return 1;
+ if (system_get_reset_flags() & RESET_FLAG_AP_OFF) {
+ CPRINTF(
+ "[%T system is on, but "
+ "RESET_FLAG_AP_OFF is on]\n");
+ system_clear_reset_flags(RESET_FLAG_AP_OFF);
+ return 0;
+ } else {
+ CPRINTF(
+ "[%T system is on, thus clear "
+ "auto_power_on]\n");
+ /* no need to arrange another power on */
+ auto_power_on = 0;
+ return 1;
+ }
}
/* power on requested at EC startup for recovery */