]> Git Repo - J-u-boot.git/blobdiff - drivers/timer/mpc83xx_timer.c
Merge branch 'next'
[J-u-boot.git] / drivers / timer / mpc83xx_timer.c
index 2f2b8be3dca971f09aa8916d5ed22eed2d94a2f8..9da74479aaa678bfab861950a770b216b604c433 100644 (file)
@@ -4,7 +4,7 @@
  * Mario Six, Guntermann & Drunck GmbH, [email protected]
  */
 
-#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
@@ -170,8 +175,8 @@ void timer_interrupt(struct pt_regs *regs)
        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
@@ -184,7 +189,7 @@ void wait_ticks(ulong ticks)
        ulong end = get_ticks() + ticks;
 
        while (end > get_ticks())
-               WATCHDOG_RESET();
+               schedule();
 }
 
 static u64 mpc83xx_timer_get_count(struct udevice *dev)
This page took 0.022924 seconds and 4 git commands to generate.