3 * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
5 * SPDX-License-Identifier: GPL-2.0+
9 * Watchdog functions and macros.
14 #if !defined(__ASSEMBLY__)
16 * Reset the watchdog timer, always returns 0
18 * This function is here since it is shared between board_f() and board_r(),
19 * and the legacy arch/<arch>/board.c code.
21 int init_func_watchdog_reset(void);
24 #if defined(CONFIG_SYS_GENERIC_BOARD) && \
25 (defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG))
26 #define INIT_FUNC_WATCHDOG_INIT init_func_watchdog_init,
27 #define INIT_FUNC_WATCHDOG_RESET init_func_watchdog_reset,
29 #define INIT_FUNC_WATCHDOG_INIT
30 #define INIT_FUNC_WATCHDOG_RESET
33 #if defined(CONFIG_HW_WATCHDOG) && defined(CONFIG_WATCHDOG)
34 # error "Configuration error: CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG can't be used together."
40 #ifdef CONFIG_HW_WATCHDOG
41 #if defined(__ASSEMBLY__)
42 #define WATCHDOG_RESET bl hw_watchdog_reset
44 extern void hw_watchdog_reset(void);
46 #define WATCHDOG_RESET hw_watchdog_reset
47 #endif /* __ASSEMBLY__ */
50 * Maybe a software watchdog?
52 #if defined(CONFIG_WATCHDOG)
53 #if defined(__ASSEMBLY__)
54 #define WATCHDOG_RESET bl watchdog_reset
56 extern void watchdog_reset(void);
58 #define WATCHDOG_RESET watchdog_reset
62 * No hardware or software watchdog.
64 #if defined(__ASSEMBLY__)
65 #define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/
67 #define WATCHDOG_RESET() {}
68 #endif /* __ASSEMBLY__ */
69 #endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */
70 #endif /* CONFIG_HW_WATCHDOG */
73 * Prototypes from $(CPU)/cpu.c.
77 #if (defined(CONFIG_8xx) || defined(CONFIG_MPC860)) && !defined(__ASSEMBLY__)
78 void reset_8xx_watchdog(volatile immap_t *immr);
82 #if defined(CONFIG_5xx) && !defined(__ASSEMBLY__)
83 void reset_5xx_watchdog(volatile immap_t *immr);
87 #if defined(CONFIG_MPC5xxx) && !defined(__ASSEMBLY__)
88 void reset_5xxx_watchdog(void);
92 #if defined(CONFIG_4xx) && !defined(__ASSEMBLY__)
93 void reset_4xx_watchdog(void);
96 #if defined(CONFIG_HW_WATCHDOG) && !defined(__ASSEMBLY__)
97 void hw_watchdog_init(void);
100 #if defined(CONFIG_MPC85xx) && !defined(__ASSEMBLY__)
101 void init_85xx_watchdog(void);
103 #endif /* _WATCHDOG_H_ */