summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-06-17 19:49:17 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-20 18:27:26 +0000
commit323273daeb437387957c7f736b5764e3e38e1168 (patch)
treeef882194c0e44ab08a788082151e90dffcce0577
parent1a4bf7fdaa58d7e05d33bc1faf3fceed8b6ad07a (diff)
downloadchrome-ec-323273daeb437387957c7f736b5764e3e38e1168.tar.gz
zinger: fix bug, increase watchdog timeout to 1.8s
Fix bug and actually increase watchdog timeout to 1.8s. BUG=none BRANCH=none TEST=put a 3 second blocking delay in pd_task and make sure watchdog reboots. set blocking delay to 1.5seconds and make sure no reboot. Change-Id: Ie66621a3bd98354f9fd22b9b10a866d004277340 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/204471 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/zinger/board.h1
-rw-r--r--chip/lm4/watchdog.c2
-rw-r--r--chip/mec1322/watchdog.c4
-rw-r--r--chip/stm32/hwtimer.c2
-rw-r--r--chip/stm32/watchdog.c2
-rw-r--r--include/config.h2
6 files changed, 7 insertions, 6 deletions
diff --git a/board/zinger/board.h b/board/zinger/board.h
index b0dd0b1199..d8184669c0 100644
--- a/board/zinger/board.h
+++ b/board/zinger/board.h
@@ -22,6 +22,7 @@
#define CONFIG_HW_CRC
#define CONFIG_SHA1
#undef CONFIG_WATCHDOG_HELP
+#undef CONFIG_WATCHDOG_PERIOD_MS
#define CONFIG_WATCHDOG_PERIOD_MS 1800
#undef CONFIG_LID_SWITCH
#undef CONFIG_TASK_PROFILING
diff --git a/chip/lm4/watchdog.c b/chip/lm4/watchdog.c
index 56f051bcd8..565ce69fd4 100644
--- a/chip/lm4/watchdog.c
+++ b/chip/lm4/watchdog.c
@@ -82,7 +82,7 @@ DECLARE_HOOK(HOOK_TICK, watchdog_reload, HOOK_PRIO_DEFAULT);
static void watchdog_freq_changed(void)
{
/* Set the timeout period */
- watchdog_period = WATCHDOG_PERIOD_MS * (clock_get_freq() / 1000);
+ watchdog_period = CONFIG_WATCHDOG_PERIOD_MS * (clock_get_freq() / 1000);
/* Reload the watchdog timer now */
watchdog_reload();
diff --git a/chip/mec1322/watchdog.c b/chip/mec1322/watchdog.c
index 87533ac571..205ea9b39c 100644
--- a/chip/mec1322/watchdog.c
+++ b/chip/mec1322/watchdog.c
@@ -14,7 +14,7 @@
* Fire auxiliary timer 50ms before watchdog timer expires. This leaves
* some time for debug trace to be printed.
*/
-#define AUX_TIMER_PERIOD_MS (WATCHDOG_PERIOD_MS - 50)
+#define AUX_TIMER_PERIOD_MS (CONFIG_WATCHDOG_PERIOD_MS - 50)
void watchdog_reload(void)
{
@@ -70,7 +70,7 @@ int watchdog_init(void)
#endif
/* Set timeout. It takes 1007us to decrement WDG_CNT by 1. */
- MEC1322_WDG_LOAD = WATCHDOG_PERIOD_MS * 1000 / 1007;
+ MEC1322_WDG_LOAD = CONFIG_WATCHDOG_PERIOD_MS * 1000 / 1007;
/* Start watchdog */
MEC1322_WDG_CTL |= 1;
diff --git a/chip/stm32/hwtimer.c b/chip/stm32/hwtimer.c
index 0a53cfb4bc..216ca895f7 100644
--- a/chip/stm32/hwtimer.c
+++ b/chip/stm32/hwtimer.c
@@ -366,7 +366,7 @@ void hwtimer_setup_watchdog(void)
* to obtain the number of times TIM_CLOCK_LSB can overflow before we
* generate an interrupt.
*/
- timer->arr = timer->cnt = WATCHDOG_PERIOD_MS * MSEC / (1 << 16);
+ timer->arr = timer->cnt = CONFIG_WATCHDOG_PERIOD_MS * MSEC / (1 << 16);
/* count on every TIM_CLOCK_LSB overflow */
timer->psc = 0;
diff --git a/chip/stm32/watchdog.c b/chip/stm32/watchdog.c
index aa9a3cd168..432bb280e1 100644
--- a/chip/stm32/watchdog.c
+++ b/chip/stm32/watchdog.c
@@ -51,7 +51,7 @@ int watchdog_init(void)
STM32_IWDG_PR = IWDG_PRESCALER & 7;
/* Set the reload value of the watchdog counter */
- STM32_IWDG_RLR = MIN(STM32_IWDG_RLR_MAX, WATCHDOG_PERIOD_MS *
+ STM32_IWDG_RLR = MIN(STM32_IWDG_RLR_MAX, CONFIG_WATCHDOG_PERIOD_MS *
(LSI_CLOCK / IWDG_PRESCALER_DIV) / 1000);
/* Start the watchdog (and re-lock registers) */
diff --git a/include/config.h b/include/config.h
index d1e41c54ea..1dcb96fb8b 100644
--- a/include/config.h
+++ b/include/config.h
@@ -935,7 +935,7 @@
#undef CONFIG_WATCHDOG_HELP
/* Watchdog period in ms; must be at least twice HOOK_TICK_INTERVAL */
-#define WATCHDOG_PERIOD_MS 1100
+#define CONFIG_WATCHDOG_PERIOD_MS 1100
/*****************************************************************************/