From d1921632fc8926fa5a566ba14bfe718881fd8bea Mon Sep 17 00:00:00 2001 From: Louis Yung-Chieh Lo Date: Tue, 29 Apr 2014 17:39:35 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/197604 Reviewed-by: David Hendricks --- power/tegra.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'power') 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 */ -- cgit v1.2.1