watchdog: Get rid of ASSEMBLY hacks

Only one occurance of WATCHDOG_RESET is left in one assembler file.
This patch changes this occurance to a direct call to watchdog_reset
and then removes all the ASSEMBLY ifdef'ery in watchdog.h, as it's not
needed any more to clean this mess a bit up.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
This commit is contained in:
Stefan Roese
2022-09-02 14:10:47 +02:00
parent 29caf9305b
commit ff3fdfe89b
2 changed files with 19 additions and 36 deletions

View File

@@ -9,7 +9,6 @@
#include <ppc_asm.tmpl> #include <ppc_asm.tmpl>
#include <ppc_defs.h> #include <ppc_defs.h>
#include <config.h> #include <config.h>
#include <watchdog.h>
/* /*
* unsigned long long get_ticks(void); * unsigned long long get_ticks(void);
@@ -42,7 +41,9 @@ wait_ticks:
addc r14, r4, r14 /* Compute end time lower */ addc r14, r4, r14 /* Compute end time lower */
addze r15, r3 /* and end time upper */ 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 */ 1: bl get_ticks /* Get current time */
subfc r4, r4, r14 /* Subtract current time from end time */ subfc r4, r4, r14 /* Subtract current time from end time */
subfe. r3, r3, r15 subfe. r3, r3, r15

View File

@@ -38,54 +38,36 @@ int init_func_watchdog_reset(void);
* Hardware watchdog * Hardware watchdog
*/ */
#ifdef CONFIG_HW_WATCHDOG #ifdef CONFIG_HW_WATCHDOG
#if defined(__ASSEMBLY__) extern void hw_watchdog_reset(void);
#define WATCHDOG_RESET bl hw_watchdog_reset
#else
extern void hw_watchdog_reset(void);
#define WATCHDOG_RESET hw_watchdog_reset #define WATCHDOG_RESET hw_watchdog_reset
#endif /* __ASSEMBLY__ */
#else #else
/* /*
* Maybe a software watchdog? * Maybe a software watchdog?
*/ */
#if defined(CONFIG_WATCHDOG) #if defined(CONFIG_WATCHDOG)
#if defined(__ASSEMBLY__) /* Don't require the watchdog to be enabled in SPL */
/* Don't require the watchdog to be enabled in SPL */ #if defined(CONFIG_SPL_BUILD) && \
#if defined(CONFIG_SPL_BUILD) && \ !defined(CONFIG_SPL_WATCHDOG)
!defined(CONFIG_SPL_WATCHDOG) #define WATCHDOG_RESET() { \
#define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/ cyclic_run(); \
#else }
#define WATCHDOG_RESET bl watchdog_reset
#endif
#else #else
/* Don't require the watchdog to be enabled in SPL */ extern void watchdog_reset(void);
#if defined(CONFIG_SPL_BUILD) && \
!defined(CONFIG_SPL_WATCHDOG)
#define WATCHDOG_RESET() { \
cyclic_run(); \
}
#else
extern void watchdog_reset(void);
#define WATCHDOG_RESET() { \ #define WATCHDOG_RESET() { \
watchdog_reset(); \ watchdog_reset(); \
cyclic_run(); \ cyclic_run(); \
} }
#endif
#endif #endif
#else #else
/* /*
* No hardware or software watchdog. * No hardware or software watchdog.
*/ */
#if defined(__ASSEMBLY__) #define WATCHDOG_RESET() { \
#define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/ cyclic_run(); \
#else
#define WATCHDOG_RESET() { \
cyclic_run(); \
} }
#endif /* __ASSEMBLY__ */ #endif /* CONFIG_WATCHDOG */
#endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */
#endif /* CONFIG_HW_WATCHDOG */ #endif /* CONFIG_HW_WATCHDOG */
/* /*