watchdog: Implement generic watchdog_reset() version
[project/bcm63xx/u-boot.git] / board / xilinx / zynq / board.c
index ea26aad16f841ab7170bf057c266dbb1051a1053..6857f2c0b8469cb6e2c52af7dcb5790f3ce57c2a 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT)
-static struct udevice *watchdog_dev __attribute__((section(".data"))) = NULL;
-#endif
-
 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_BOARD_EARLY_INIT_F)
 int board_early_init_f(void)
 {
@@ -31,19 +27,6 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT)
-       if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) {
-               debug("Watchdog: Not found by seq!\n");
-               if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
-                       puts("Watchdog: Not found!\n");
-                       return 0;
-               }
-       }
-
-       wdt_start(watchdog_dev, 0, 0);
-       puts("Watchdog: Started\n");
-# endif
-
        return 0;
 }
 
@@ -127,25 +110,3 @@ int dram_init(void)
        return 0;
 }
 #endif
-
-#if defined(CONFIG_WATCHDOG)
-/* Called by macro WATCHDOG_RESET */
-void watchdog_reset(void)
-{
-# if !defined(CONFIG_SPL_BUILD)
-       static ulong next_reset;
-       ulong now;
-
-       if (!watchdog_dev)
-               return;
-
-       now = timer_get_us();
-
-       /* Do not reset the watchdog too often */
-       if (now > next_reset) {
-               wdt_reset(watchdog_dev);
-               next_reset = now + 1000;
-       }
-# endif
-}
-#endif