]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
drivers: watchdog: Enable watchdog support in SPL for Agilex
authorAlif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Mon, 4 Aug 2025 01:24:34 +0000 (18:24 -0700)
committerTien Fong Chee <tien.fong.chee@intel.com>
Fri, 8 Aug 2025 14:20:46 +0000 (22:20 +0800)
Enable watchdog as early as possible after clock initialization
which is set at 10 seconds.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
arch/arm/mach-socfpga/spl_agilex.c
drivers/watchdog/Kconfig

index 2780e0f921f0510a31d63d8dee295a34e667c3ae..c16519fc2bdadfcb3b7b248e1209ff5f751b90f6 100644 (file)
@@ -19,7 +19,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>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -84,6 +84,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();
+
        preloader_console_init();
        print_reset_info();
        cm_print_clock_quick_summary();
index 56290b32bd94f699d89887ec35a8d23537b6003e..9e149a75e8147bad78d4e31920dd2d28a0494498 100644 (file)
@@ -31,7 +31,7 @@ config WATCHDOG_TIMEOUT_MSECS
        default 128000 if ARCH_MX5 || ARCH_MX6
        default 128000 if ARCH_MX7 || ARCH_VF610
        default 30000 if ARCH_SNAPDRAGON
-       default 30000 if ARCH_SOCFPGA
+       default 10000 if ARCH_SOCFPGA
        default 16000 if ARCH_SUNXI
        default 5376 if ULP_WATCHDOG
        default 15000 if ARCH_BCM283X