*/
-#include <common.h>
+#include <config.h>
#include <clk.h>
#include <dm.h>
#include <irq_func.h>
#include <time.h>
#include <timer.h>
#include <watchdog.h>
+#include <asm/global_data.h>
#include <asm/ptrace.h>
#include <linux/bitops.h>
DECLARE_GLOBAL_DATA_PTR;
+#ifndef CFG_SYS_WATCHDOG_FREQ
+#define CFG_SYS_WATCHDOG_FREQ (CONFIG_SYS_HZ / 2)
+#endif
+
/**
* struct mpc83xx_timer_priv - Private data structure for MPC83xx timer driver
* @decrementer_count: Value to which the decrementer register should be re-set
priv->timestamp++;
#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG)
- if ((timestamp % (CONFIG_SYS_WATCHDOG_FREQ)) == 0)
- WATCHDOG_RESET();
+ if (CFG_SYS_WATCHDOG_FREQ && (priv->timestamp % (CFG_SYS_WATCHDOG_FREQ)) == 0)
+ schedule();
#endif /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */
#ifdef CONFIG_LED_STATUS
ulong end = get_ticks() + ticks;
while (end > get_ticks())
- WATCHDOG_RESET();
+ schedule();
}
static u64 mpc83xx_timer_get_count(struct udevice *dev)