From b5f3455a98ac2efad01228c01d25b05e9bddf52a Mon Sep 17 00:00:00 2001 From: Louis Yung-Chieh Lo Date: Thu, 8 May 2014 14:17:15 -0700 Subject: tegra: don't set auto_power_on if SYSJUMP The auto_power_on is set 1 unexpectedly while EC jumps. This has a side effect that would turn on the AP unexpectedly after "power off". See comment 43 of issue 28249 BUG=chrome-os-partner:28249 BRANCH=tot,nyan TEST=on nyan: > reboot > sysinfo // If EC is in RO, "sysjump RW" > power off // The AP keeps off. Change-Id: I3c06e99383c06af7cd6c17dd65040e20f06d8e73 Signed-off-by: Louis Yung-Chieh Lo Reviewed-on: https://chromium-review.googlesource.com/198941 --- power/tegra.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/power/tegra.c b/power/tegra.c index 1d7b24cb28..dac1d2f475 100644 --- a/power/tegra.c +++ b/power/tegra.c @@ -233,12 +233,13 @@ DECLARE_HOOK(HOOK_LID_CHANGE, tegra_lid_event, HOOK_PRIO_DEFAULT); enum power_state power_chipset_init(void) { int init_power_state; + uint32_t reset_flags = system_get_reset_flags(); /* * Force the AP shutdown unless we are doing SYSJUMP. Otherwise, * the AP could stay in strange state. */ - if (!(system_get_reset_flags() & RESET_FLAG_SYSJUMP)) { + if (!(reset_flags & RESET_FLAG_SYSJUMP)) { CPRINTF("[%T not sysjump; forcing AP shutdown]\n"); chipset_turn_off_power_rails(); @@ -258,7 +259,8 @@ enum power_state power_chipset_init(void) } /* Leave power off only if requested by reset flags */ - if (!(system_get_reset_flags() & RESET_FLAG_AP_OFF)) { + if (!(reset_flags & RESET_FLAG_AP_OFF) && + !(reset_flags & RESET_FLAG_SYSJUMP)) { CPRINTF("[%T auto_power_on is set due to reset_flag 0x%x]\n", system_get_reset_flags()); auto_power_on = 1; -- cgit v1.2.1