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>
This commit is contained in:
Alec Berg
2014-06-17 19:49:17 -07:00
committed by chrome-internal-fetch
parent 1a4bf7fdaa
commit 323273daeb
6 changed files with 7 additions and 6 deletions

View File

@@ -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

View File

@@ -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();

View File

@@ -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;

View File

@@ -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;

View File

@@ -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) */

View File

@@ -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
/*****************************************************************************/