summaryrefslogtreecommitdiff
path: root/lib_nios
diff options
context:
space:
mode:
Diffstat (limited to 'lib_nios')
-rw-r--r--lib_nios/board.c5
-rw-r--r--lib_nios/time.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/lib_nios/board.c b/lib_nios/board.c
index fb477e9..d6c02d8 100644
--- a/lib_nios/board.c
+++ b/lib_nios/board.c
@@ -139,13 +139,16 @@ void board_init (void)
bd->bi_baudrate = CONFIG_BAUDRATE;
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
+ WATCHDOG_RESET ();
if ((*init_fnc_ptr) () != 0) {
hang ();
}
}
+ WATCHDOG_RESET ();
bd->bi_flashsize = flash_init();
+ WATCHDOG_RESET ();
mem_malloc_init();
malloc_bin_reloc();
env_relocate();
@@ -157,12 +160,14 @@ void board_init (void)
if (s) s = (*e) ? e + 1 : e;
}
+ WATCHDOG_RESET ();
devices_init();
jumptable_init();
console_init_r();
/*
*/
+ WATCHDOG_RESET ();
interrupt_init ();
#ifdef CONFIG_STATUS_LED
diff --git a/lib_nios/time.c b/lib_nios/time.c
index 765b9c1..25a233e 100644
--- a/lib_nios/time.c
+++ b/lib_nios/time.c
@@ -22,6 +22,7 @@
*/
#include <common.h>
+#include <watchdog.h>
extern void dly_clks( unsigned long ticks );
@@ -33,5 +34,6 @@ void udelay(unsigned long usec)
* cpu clocks.
*/
unsigned long cnt = (CONFIG_SYS_CLK_FREQ/1000000) * usec;
+ WATCHDOG_RESET (); /* trigger watchdog if needed */
dly_clks (cnt);
}