summaryrefslogtreecommitdiff
path: root/chip/npcx/watchdog.c
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2017-12-01 11:16:58 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-12-11 15:16:23 -0800
commit0037fb8dfcd7136d40e608ad9973331bd82d9a80 (patch)
tree15677d4993958e2b173675411933f565fead2ff7 /chip/npcx/watchdog.c
parent665ee232999ab22a9e0a53ddba020e0b1f387fcf (diff)
downloadchrome-ec-0037fb8dfcd7136d40e608ad9973331bd82d9a80.tar.gz
system: Log PC and task id on watchdog
For debug, in common code let's log the watchdog PC and task id as our SW panic params. BUG=chromium:790006 BRANCH=none TEST=manually test scarlet rev2 from a1-a3, b1-b2: (a1) Add 'while(1);' in button ISR (a2) Boot and press the button (a3) When watchdog is triggeried, check with 'panicinfo' that saved R5 is the PC for button ISR. (b1) 'crash watchdog' in EC console (b2) Check with 'panicinfo' that CONSOLE task id is saved in EXCEPTION and PC is saved in R5. Change-Id: I64d2fcf594dd24b0951e002ab8e80ebcac2d1def Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/803618 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/npcx/watchdog.c')
-rw-r--r--chip/npcx/watchdog.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/chip/npcx/watchdog.c b/chip/npcx/watchdog.c
index 1036523996..4b43a09db2 100644
--- a/chip/npcx/watchdog.c
+++ b/chip/npcx/watchdog.c
@@ -59,7 +59,6 @@ static uint8_t watchdog_count(void)
void __keep watchdog_check(uint32_t excep_lr, uint32_t excep_sp)
{
int wd_cnt;
- uint32_t panic_info;
/* Clear timeout status for event */
SET_BIT(NPCX_ITCTS(ITIM_WDG_NO), NPCX_ITCTS_TO_STS);
@@ -79,19 +78,6 @@ void __keep watchdog_check(uint32_t excep_lr, uint32_t excep_sp)
watchdog_trace(excep_lr, excep_sp);
cflush();
- /*
- * Log the panic PC if watchdog occurred in exception context
- * or the watchdog task # otherwise.
- */
- panic_info = ((excep_lr & 0xf) == 1) ?
- ((uint32_t *)excep_sp)[6] : task_get_current();
- /*
- * 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, panic_info);
-
/* Trigger watchdog immediately */
system_watchdog_reset();
}