summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMulin Chao <MLChao@nuvoton.com>2018-04-06 16:57:36 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-04-26 01:35:02 +0000
commit54c029ec8508afbfc2678d301a12f3b1eb05fa2a (patch)
tree77955d6c109b7ca8a9fda55cf2f6b5a4bb392a39
parent80282bdfa4c9d7633fe6ddc51945777d0fefc15a (diff)
downloadchrome-ec-54c029ec8508afbfc2678d301a12f3b1eb05fa2a.tar.gz
npcx: watchdog: disable ITIM16 before updating ITCNT register
During watchdog initialization, the driver doesn't disable ITIM16 module which used for detecting watchdog timeout before updating new preload value. Although the ITEN bit on reset is zero, it caused preload value is not updated to module successfully since ITEN won't be reset (ITIM16 is still enabled) in sysjump case. Despite WDCNT will be reloaded by touching watchdog in HOOK_TICK hook function later, it's better to disable any ITIM16 module before updating ITCNT register. BRANCH=none BUG=b:77336821 TEST=No build errors for npcx5 series. Change-Id: I6444dfdece0e9f286be64b7ccbfa6e80deff28a8 Original-Change-Id: I19baa47bca347b9dca2fc1dcaacca81519facf21 Original-Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Original-Reviewed-on: https://chromium-review.googlesource.com/999458 Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1029252 Commit-Queue: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Trybot-Ready: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--chip/npcx/watchdog.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/chip/npcx/watchdog.c b/chip/npcx/watchdog.c
index 4b43a09db2..9a5369534f 100644
--- a/chip/npcx/watchdog.c
+++ b/chip/npcx/watchdog.c
@@ -37,6 +37,8 @@ void watchdog_init_warning_timer(void)
NPCX_ITPRE(ITIM_WDG_NO) = DIV_ROUND_NEAREST(1000*INT_32K_CLOCK,
SECOND) - 1;
+ /* Event module disable */
+ CLEAR_BIT(NPCX_ITCTS(ITIM_WDG_NO), NPCX_ITCTS_ITEN);
/* ITIM count down : event expired*/
NPCX_ITCNT16(ITIM_WDG_NO) = CONFIG_AUX_TIMER_PERIOD_MS - 1;
/* Event module enable */