[PATCH] drivers: watchdog: Enhance watchdog support in SPL for N5X

Chee, Tien Fong tien.fong.chee at altera.com
Wed Apr 15 11:51:48 CEST 2026


Hi Dinesh,


On 4/3/2026 12:08 pm, dinesh.maniyam at altera.com wrote:
> From: Dinesh Maniyam<dinesh.maniyam at altera.com>


commit subject scope mismatch, expect arm: socfpga: spl_n5x: ...


>
> Enable watchdog before initializing other component (example: DDR).
> Thus, watchdog need to be fully executed in onchip ram.


The commit message does not fully describe the actual change which 
switches from the

legacy CONFIG_HW_WATCHDOG path (hw_watchdog_init()) to

DM watchdog init (initr_watchdog() with CONFIG_IS_ENABLED(WDT)).

Please update the message to clearly state that behavior change and 
rationale

Wording/grammar Minor wording clean-up would help readability, e.g.:
“before initializing other components”
“Watchdog needs to be enabled after the clock driver because it 
retrieves the watchdog clock frequency.”


>
> Signed-off-by: Dinesh Maniyam<dinesh.maniyam at altera.com>
> ---
>   arch/arm/mach-socfpga/spl_n5x.c | 17 ++++++++++-------
>   1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-socfpga/spl_n5x.c b/arch/arm/mach-socfpga/spl_n5x.c
> index 81283ef7162..22c20f89b4b 100644
> --- a/arch/arm/mach-socfpga/spl_n5x.c
> +++ b/arch/arm/mach-socfpga/spl_n5x.c
> @@ -9,6 +9,7 @@
>   #include <asm/arch/mailbox_s10.h>
>   #include <asm/arch/misc.h>
>   #include <asm/arch/reset_manager.h>
> +#include <asm/arch/smmu_s10.h>


  doesn’t appear used by the patch itself


>   #include <asm/arch/system_manager.h>
>   #include <asm/global_data.h>
>   #include <asm/io.h>
> @@ -19,6 +20,7 @@
>   #include <init.h>
>   #include <spl.h>
>   #include <watchdog.h>
> +#include <wdt.h>
>   
>   DECLARE_GLOBAL_DATA_PTR;
>   
> @@ -37,13 +39,6 @@ void board_init_f(ulong dummy)
>   	writel(SYSMGR_WDDBG_PAUSE_ALL_CPU,
>   	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_WDDBG);
>   
> -#ifdef CONFIG_HW_WATCHDOG
> -	/* Enable watchdog before initializing the HW */
> -	socfpga_per_reset(SOCFPGA_RESET(L4WD0), 1);
> -	socfpga_per_reset(SOCFPGA_RESET(L4WD0), 0);
> -	hw_watchdog_init();
> -#endif
> -
>   	/* ensure all processors are not released prior Linux boot */
>   	writeq(0, CPU_RELEASE_ADDR);
>   
> @@ -69,6 +64,14 @@ void board_init_f(ulong dummy)
>   		hang();
>   	}
>   
> +	/*
> +	 * Enable watchdog as early as possible before initializing other
> +	 * component. Watchdog need to be enabled after clock driver because
> +	 * it will retrieve the clock frequency from clock driver.
> +	 */
> +	if (CONFIG_IS_ENABLED(WDT))
> +		initr_watchdog();
> +
>   	print_reset_info();
>   	cm_print_clock_quick_summary();
>   

Best regards,

Tien Fong


More information about the U-Boot mailing list