[PATCH v1 9/9] spl: s10: Enhance watchdog support in SPL for Stratix 10
YUSLAIMI, ALIF ZAKUAN
alif.zakuan.yuslaimi at altera.com
Tue Apr 28 05:23:38 CEST 2026
Hi Tien Fong,
On 21/4/2026 5:17 pm, Chee, Tien Fong wrote:
> Hi Alif,
>
>
> On 3/4/2026 10:25 am, alif.zakuan.yuslaimi at altera.com wrote:
>> From: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi at altera.com>
>>
>> Watchdog needs to be fully executed in the onchip ram. Enabling watchdog
>> before initializing other components such as DDR in Stratix10 SPL
>>
>> Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi at altera.com>
>> ---
>> arch/arm/mach-socfpga/spl_s10.c | 16 ++++++++--------
>> 1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/mach-socfpga/spl_s10.c b/arch/arm/mach-socfpga/
>> spl_s10.c
>> index ace029557f3..588dca4fcd3 100644
>> --- a/arch/arm/mach-socfpga/spl_s10.c
>> +++ b/arch/arm/mach-socfpga/spl_s10.c
>> @@ -18,7 +18,7 @@
>> #include <asm/arch/misc.h>
>> #include <asm/arch/reset_manager.h>
>> #include <asm/arch/system_manager.h>
>> -#include <watchdog.h>
>> +#include <wdt.h>
>> #include <dm/uclass.h>
>> u32 reset_flag(void)
>> @@ -54,13 +54,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);
>> @@ -80,6 +73,13 @@ void board_init_f(ulong dummy)
>> hang();
>> }
>> + /*
>> + * Enable watchdog as early as possible before initializing other
>> + * component.
>> + */
>> + if (CONFIG_IS_ENABLED(WDT))
>> + initr_watchdog();
>
>
> Either move initr_watchdog() before the ALTERA_SDRAM block to match the
> stated intent ("before DDR"),
>
> or update the commit message to accurately describe where it is placed
> and why.
>
>
> Best regards,
>
> Tien Fong
>
Switching from the legacy hw_watchdog_init() path to the driver-model
WDT (initr_watchdog()) requires clocks and reset to be valid for
the L4 watchdog block, and so it must run after the clock manager
(uclass_get_device(UCLASS_CLK)) succeeds.
Enabling watchdog immediately after clock init keeps watchdog coverage
as early as possible.
I will improve the commit message for v2 submission.
Thanks for your feedback,
Alif
More information about the U-Boot
mailing list