diff options
author | Jett Rink <jettrink@chromium.org> | 2019-09-06 11:33:48 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-09 04:30:34 +0000 |
commit | 9a22d8465107ee1a0b526e4caf70ca9b689b7f57 (patch) | |
tree | 118b3c8e14744b63893cac904ffdc725706164c2 /include/watchdog.h | |
parent | 83e0848263313dbdaf10ebc887dea548faaf251a (diff) | |
download | chrome-ec-9a22d8465107ee1a0b526e4caf70ca9b689b7f57.tar.gz |
npcx: Ensure the watchdog isn't stopped while it is invalid to do so
We cannot unlock the watchdog timer within 3 watch dog ticks of touching
it per the datasheet. This is actually around 100ms so we should protect
against this.
Note: To avoid bringing in other dependencies into the npcx_monitor_fw,
the "old" method of stopping the watchdog is used (no waiting first).
BRANCH=none
BUG=b:140207603
TEST=eliminates cold reset issue.
Change-Id: I440d36fb9aecdd6d78bae6fc4002208198a3357f
Signed-off-by: Jett Rink <jettrink@chromium.org>
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1842592
Reviewed-by: ML Chao <mlchao@nuvoton.corp-partner.google.com>
Diffstat (limited to 'include/watchdog.h')
-rw-r--r-- | include/watchdog.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/watchdog.h b/include/watchdog.h index bf12ad0593..036f722d97 100644 --- a/include/watchdog.h +++ b/include/watchdog.h @@ -38,6 +38,13 @@ void watchdog_trace(uint32_t excep_lr, uint32_t excep_sp); */ void watchdog_warning_irq(void); +/** + * We cannot unlock the watchdog timer within 3 watch dog ticks of + * touching it per the datasheet. This is around 100ms so we should + * protect against this. + */ +void watchdog_stop_and_unlock(void); + /* Reload the watchdog counter */ #ifdef CONFIG_WATCHDOG void watchdog_reload(void); |