#include <ppc_asm.tmpl>
#include <ppc_defs.h>
#include <config.h>
-#include <watchdog.h>
/*
* unsigned long long get_ticks(void);
addc r14, r4, r14 /* Compute end time lower */
addze r15, r3 /* and end time upper */
- WATCHDOG_RESET /* Trigger watchdog, if needed */
+#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG)
+ bl schedule /* Trigger watchdog, if needed */
+#endif
1: bl get_ticks /* Get current time */
subfc r4, r4, r14 /* Subtract current time from end time */
subfe. r3, r3, r15
* Hardware watchdog
*/
#ifdef CONFIG_HW_WATCHDOG
- #if defined(__ASSEMBLY__)
- #define WATCHDOG_RESET bl hw_watchdog_reset
- #else
- extern void hw_watchdog_reset(void);
+ extern void hw_watchdog_reset(void);
- #define WATCHDOG_RESET hw_watchdog_reset
- #endif /* __ASSEMBLY__ */
+ #define WATCHDOG_RESET hw_watchdog_reset
#else
/*
* Maybe a software watchdog?
*/
#if defined(CONFIG_WATCHDOG)
- #if defined(__ASSEMBLY__)
- /* Don't require the watchdog to be enabled in SPL */
- #if defined(CONFIG_SPL_BUILD) && \
- !defined(CONFIG_SPL_WATCHDOG)
- #define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/
- #else
- #define WATCHDOG_RESET bl watchdog_reset
- #endif
+ /* Don't require the watchdog to be enabled in SPL */
+ #if defined(CONFIG_SPL_BUILD) && \
+ !defined(CONFIG_SPL_WATCHDOG)
+ #define WATCHDOG_RESET() { \
+ cyclic_run(); \
+ }
#else
- /* Don't require the watchdog to be enabled in SPL */
- #if defined(CONFIG_SPL_BUILD) && \
- !defined(CONFIG_SPL_WATCHDOG)
- #define WATCHDOG_RESET() { \
- cyclic_run(); \
- }
- #else
- extern void watchdog_reset(void);
+ extern void watchdog_reset(void);
- #define WATCHDOG_RESET() { \
- watchdog_reset(); \
- cyclic_run(); \
- }
- #endif
+ #define WATCHDOG_RESET() { \
+ watchdog_reset(); \
+ cyclic_run(); \
+ }
#endif
#else
/*
* No hardware or software watchdog.
*/
- #if defined(__ASSEMBLY__)
- #define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/
- #else
- #define WATCHDOG_RESET() { \
- cyclic_run(); \
+ #define WATCHDOG_RESET() { \
+ cyclic_run(); \
}
- #endif /* __ASSEMBLY__ */
- #endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */
+ #endif /* CONFIG_WATCHDOG */
#endif /* CONFIG_HW_WATCHDOG */
/*