summaryrefslogtreecommitdiff
path: root/chip/npcx/watchdog.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-09-26 12:43:36 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-27 20:33:54 -0700
commit77a96c4b4d8081c7352fda8b3f4902089bdd154f (patch)
tree0d6ac5acd79250d1afe3bb695bb55ab381220125 /chip/npcx/watchdog.c
parentd6d12ec67bb0d20229ee0c273bc9d917b0821eb4 (diff)
downloadchrome-ec-77a96c4b4d8081c7352fda8b3f4902089bdd154f.tar.gz
npcx: watchdog: Log watchdog panic information
On EC panic events such as assertion fail, watchdog, etc. log the EC state to our persistent panic log so that it can be retrieved later. BUG=chrome-os-partner:57794 BRANCH=Kevin TEST=Run `crash watchdog` on kevin, then `panicinfo` on subsequent boot. Verify saved panic log matches watchdog dump. Change-Id: I06414f986458af1426b9b9720025144cd38a7a59 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/389591 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/389957 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'chip/npcx/watchdog.c')
-rw-r--r--chip/npcx/watchdog.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/chip/npcx/watchdog.c b/chip/npcx/watchdog.c
index 3c62cbc3f3..0b570df76a 100644
--- a/chip/npcx/watchdog.c
+++ b/chip/npcx/watchdog.c
@@ -76,6 +76,14 @@ void __keep watchdog_check(uint32_t excep_lr, uint32_t excep_sp)
/* Print panic info */
watchdog_trace(excep_lr, excep_sp);
cflush();
+#ifdef CONFIG_SOFTWARE_PANIC
+ /*
+ * panic_reboot() will be called by software_panic(), so this
+ * typically will not return, and panic reason will appear
+ * as "soft".
+ */
+ software_panic(PANIC_SW_WATCHDOG, excep_lr);
+#endif
/* Trigger watchdog immediately */
system_watchdog_reset();
}