summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMulin Chao <MLChao@nuvoton.com>2018-04-06 16:57:36 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-04-09 01:34:48 -0700
commit45fbc3b938849122d2a7f9d5614e7c5b78714fde (patch)
tree7bf00a94addfef9f1b8b4fc81c5234206bf1e9e8
parent03cc82b93b60084942203efe6d86ef11bad56cd0 (diff)
downloadchrome-ec-45fbc3b938849122d2a7f9d5614e7c5b78714fde.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: I19baa47bca347b9dca2fc1dcaacca81519facf21 Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/999458 Reviewed-by: Randall Spangler <rspangler@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 */