diff options
author | scott worley <scott.worley@microchip.corp-partner.google.com> | 2018-05-10 11:55:09 -0400 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-06-12 21:50:53 -0700 |
commit | 201c5fb497d2c810eb95c9ddf05835adcde63b12 (patch) | |
tree | 224bd48d790c60206cc58272bffea1e778eceafb | |
parent | f659a25457fc8b85059d84b77dd8599001074199 (diff) | |
download | chrome-ec-201c5fb497d2c810eb95c9ddf05835adcde63b12.tar.gz |
ec_chip_mchp: Add debug config item to prevent watchdog from firing.
Prevent WDT from firing while JTAG is attached without
having to completely remove watchdog feature. When new
chip debug feature is enabled attached a JTAG cable pulling
JTAG TRST# pin high will prevent watchdog timer from counting
down. Replacing the JTAG cable with a weak pull down will
allow WDT to operate normally.
BRANCH=None
BUG=None
TEST=Build all boards using chip mchp.
Change-Id: I54c52bd1ba2115491e63882c91a6ab4827918784
Signed-off-by: scott worley <scott.worley@microchip.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/1053950
Commit-Ready: Randall Spangler <rspangler@chromium.org>
Tested-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | chip/mchp/watchdog.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/chip/mchp/watchdog.c b/chip/mchp/watchdog.c index 156edfc750..03edeb414e 100644 --- a/chip/mchp/watchdog.c +++ b/chip/mchp/watchdog.c @@ -19,10 +19,8 @@ void watchdog_reload(void) /* Reload the auxiliary timer */ MCHP_TMR16_CTL(0) &= ~(1 << 5); MCHP_TMR16_CNT(0) = CONFIG_AUX_TIMER_PERIOD_MS; -#ifndef CONFIG_CHIPSET_DEBUG MCHP_TMR16_CTL(0) |= 1 << 5; #endif -#endif } DECLARE_HOOK(HOOK_TICK, watchdog_reload, HOOK_PRIO_DEFAULT); @@ -58,7 +56,6 @@ int watchdog_init(void) MCHP_TMR16_CTL(0) = val; -#ifndef CONFIG_CHIPSET_DEBUG /* Enable interrupt from auxiliary timer */ MCHP_TMR16_IEN(0) |= 1; task_enable_irq(MCHP_IRQ_TIMER16_0); @@ -68,7 +65,6 @@ int watchdog_init(void) MCHP_TMR16_CNT(0) = CONFIG_AUX_TIMER_PERIOD_MS; MCHP_TMR16_CNT(0) |= 1 << 5; #endif -#endif /* Clear WDT PCR sleep enable */ MCHP_PCR_SLP_DIS_DEV(MCHP_PCR_WDT); @@ -78,8 +74,8 @@ int watchdog_init(void) /* Start watchdog */ #ifdef CONFIG_CHIPSET_DEBUG - /* debug, set stall and do not start */ - MCHP_WDG_CTL = (1 << 4); /* enable WDG stall on active JTAG */ + /* WDT will not count if JTAG TRST# is pulled high by JTAG cable */ + MCHP_WDG_CTL = (1 << 4) | (1 << 0); #else MCHP_WDG_CTL |= 1; #endif |