Files
OpenCellular/include/watchdog.h
Simon Glass 9f2e621d80 Move watchdog_trace() into the generic watchdog file
We want this function to be available for all chips, so move it into a
generic place.

The task_disable_irq() from the LM4 version can be left in
watchdog_check(), to keep the watchdog_trace() function generic.

BUG=chrome-os-partner:10145
TEST=build for all boards

Change-Id: I98c60ce5958f1498b84a233ef04290a68a7838c5
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24397
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2012-06-15 13:39:22 -07:00

39 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
#define WATCHDOG_PERIOD_MS 1100 /* Watchdog period in ms */
/*
* Interval in ms between reloads of the watchdog timer. Should be less
* than half of the watchdog period.
*/
#define WATCHDOG_RELOAD_MS 500
/* 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 */
void watchdog_reload(void);
#endif /* __CROS_EC_WATCHDOG_H */