Files
OpenCellular/include/watchdog.h
Randall Spangler 0b8f5a3a6c Define watchdog_reload() to nothing if not CONFIG_WATCHDOG
Currently, we need to have #ifdefs everywhere watchdog_reload() is
called.  With this fix we don't.

Also don't bother including unused hardware timer watchdog code if the
watchdog isn't defined.

No change when CONFIG_WATCHDOG is defined (which it is for all normal builds).

BUG=chrome-os-partner:20056
BRANCH=none
TEST=build all platforms with CONFIG_WATCHDOG commented out in config.h

Change-Id: Id3ce33af1a497eda127a4892e13651d9d2534d92
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58094
Reviewed-by: Simon Glass <sjg@chromium.org>
2013-06-10 13:59:34 -07:00

42 lines
1.1 KiB
C

/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Watchdog driver */
#ifndef __CROS_EC_WATCHDOG_H
#define __CROS_EC_WATCHDOG_H
/* Watchdog period in ms; must be at least twice HOOK_TICK_INTERVAL */
#define WATCHDOG_PERIOD_MS 1100
/**
* Initialize the watchdog.
*
* This will cause the CPU to reboot if it has been more than 2 watchdog
* periods since watchdog_reload() has been called.
*/
int watchdog_init(void);
/**
* Display a trace with information about an expired watchdog timer
*
* This shows the location in the code where the expiration happened.
* Usually this helps locate a loop which is blocking execution of the
* watchdog task.
*
* @param excep_lr Value of lr to indicate caller return
* @param excep_sp Value of sp to indicate caller task id
*/
void watchdog_trace(uint32_t excep_lr, uint32_t excep_sp);
/* Reload the watchdog counter */
#ifdef CONFIG_WATCHDOG
void watchdog_reload(void);
#else
static inline void watchdog_reload(void) { }
#endif
#endif /* __CROS_EC_WATCHDOG_H */