summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-31 17:44:51 -0700
committerRandall Spangler <rspangler@chromium.org>2012-10-31 18:08:44 -0700
commitf55e55322834db625bfffe02371e9f258412a024 (patch)
tree65927c8825b9fc1d216af7cf4eeaac2289023d7e
parent5c59877ee1878b8de380b662601592c817a8b0a8 (diff)
downloadchrome-ec-f55e55322834db625bfffe02371e9f258412a024.tar.gz
link: Cold reboot should ignore WAKE# pin
This fixes the EC not being able to do a cold reset while the power button is held down, because the power button asserts WAKE#. BUG=chrome-os-partner:15705 BRANCH=link TEST=manual - scope HIB# - hold down power button - from console, 'reboot cold' HIB# should stay asserted for 150ms. Before this fix, it asserted only briefly. Change-Id: I07c6bb5ee3f846544c75e7e0d4584f8434a9cd56 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/37090 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Puneet Kumar <puneetster@chromium.org> (cherry picked from commit 9a1548984d1bcfb6a2035110349af9e2e0f4531a) Reviewed-on: https://gerrit.chromium.org/gerrit/37094
-rw-r--r--chip/lm4/system.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/chip/lm4/system.c b/chip/lm4/system.c
index 80d4522e72..bc650a3a93 100644
--- a/chip/lm4/system.c
+++ b/chip/lm4/system.c
@@ -227,7 +227,11 @@ static void hibernate(uint32_t seconds, uint32_t microseconds, uint32_t flags)
/* Set up wake reasons and hibernate flags */
hibctl = LM4_HIBERNATE_HIBCTL | LM4_HIBCTL_PINWEN;
- flags |= HIBDATA_WAKE_PIN;
+
+ if (flags & HIBDATA_WAKE_PIN)
+ hibctl |= LM4_HIBCTL_PINWEN;
+ else
+ hibctl &= ~LM4_HIBCTL_PINWEN;
if (seconds || microseconds) {
hibctl |= LM4_HIBCTL_RTCWEN;
@@ -279,7 +283,7 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds)
{
/* Flush console before hibernating */
cflush();
- hibernate(seconds, microseconds, 0);
+ hibernate(seconds, microseconds, HIBDATA_WAKE_PIN);
}
int system_pre_init(void)
@@ -362,7 +366,10 @@ void system_reset(int flags)
hibdata_write(HIBDATA_INDEX_SAVED_RESET_FLAGS, save_flags);
if (flags & SYSTEM_RESET_HARD) {
- /* Bounce through hibernate to trigger a hard reboot */
+ /*
+ * Bounce through hibernate to trigger a hard reboot. Do
+ * not wake on wake pin, since we need the full duration.
+ */
hibernate(0, HIB_RESET_USEC, HIBDATA_WAKE_HARD_RESET);
} else
CPU_NVIC_APINT = 0x05fa0004;