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 #ifdef CONFIG_WATCHDOG
25 #define INIT_FUNC_WATCHDOG_INIT init_func_watchdog_init,
26 #define INIT_FUNC_WATCHDOG_RESET init_func_watchdog_reset,
28 #define INIT_FUNC_WATCHDOG_INIT
29 #define INIT_FUNC_WATCHDOG_RESET
32 #if defined(CONFIG_HW_WATCHDOG) && defined(CONFIG_WATCHDOG)
33 # error "Configuration error: CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG can't be used together."
39 #ifdef CONFIG_HW_WATCHDOG
40 #if defined(__ASSEMBLY__)
41 #define WATCHDOG_RESET bl hw_watchdog_reset
43 extern void hw_watchdog_reset(void);
45 #define WATCHDOG_RESET hw_watchdog_reset
46 #endif /* __ASSEMBLY__ */
49 * Maybe a software watchdog?
51 #if defined(CONFIG_WATCHDOG)
52 #if defined(__ASSEMBLY__)
53 #define WATCHDOG_RESET bl watchdog_reset
55 extern void watchdog_reset(void);
57 #define WATCHDOG_RESET watchdog_reset
61 * No hardware or software watchdog.
63 #if defined(__ASSEMBLY__)
64 #define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/
66 #define WATCHDOG_RESET() {}
67 #endif /* __ASSEMBLY__ */
68 #endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */
69 #endif /* CONFIG_HW_WATCHDOG */
72 * Prototypes from $(CPU)/cpu.c.
76 #if (defined(CONFIG_8xx) || defined(CONFIG_MPC860)) && !defined(__ASSEMBLY__)
77 void reset_8xx_watchdog(volatile immap_t *immr);
81 #if defined(CONFIG_5xx) && !defined(__ASSEMBLY__)
82 void reset_5xx_watchdog(volatile immap_t *immr);
86 #if defined(CONFIG_MPC5xxx) && !defined(__ASSEMBLY__)
87 void reset_5xxx_watchdog(void);
91 #if defined(CONFIG_4xx) && !defined(__ASSEMBLY__)
92 void reset_4xx_watchdog(void);
95 #if defined(CONFIG_HW_WATCHDOG) && !defined(__ASSEMBLY__)
96 void hw_watchdog_init(void);
98 #endif /* _WATCHDOG_H_ */