[RFC PATCH 5/8] watchdog: Get rid of ASSEMBLY hacks

Rasmus Villemoes rasmus.villemoes at prevas.dk
Mon Aug 29 09:50:31 CEST 2022


On 29/08/2022 08.23, Stefan Roese wrote:
> Only one occurance of WATCHDOG_RESET is left in one assembler file.
> This patch changes this occurance to a direct call to watchdog_reset

Well...

> 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 at denx.de>
> ---
>  arch/powerpc/lib/ticks.S |  5 ++--
>  include/watchdog.h       | 50 +++++++++++++---------------------------
>  2 files changed, 19 insertions(+), 36 deletions(-)
> 
> diff --git a/arch/powerpc/lib/ticks.S b/arch/powerpc/lib/ticks.S
> index c487f938fa8d..8647d77cc9ad 100644
> --- a/arch/powerpc/lib/ticks.S
> +++ b/arch/powerpc/lib/ticks.S
> @@ -9,7 +9,6 @@
>  #include <ppc_asm.tmpl>
>  #include <ppc_defs.h>
>  #include <config.h>
> -#include <watchdog.h>
>  
>  /*
>   * unsigned long long get_ticks(void);
> @@ -42,7 +41,9 @@ wait_ticks:
>  	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 */

...you actually change it to a call to schedule(), which AFAICT doesn't
always exist (at least as a function with external linkage). Or does it
if either one of those conditions are met?

Side note: Oh gosh do I hope this can put an end to the CONFIG_WATCHDOG
v CONFIG_HW_WATCHDOG silliness; what is a watchdog if not a piece of HW.

>  	#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*/

Yes please. I strongly suspect that comment is some ancient leftover
from some none-complying preprocessor or whatnot.

Rasmus


More information about the U-Boot mailing list