drivers: watchdog: Enhance watchdog support in SPL for Stratix 10 and Agilex
PATCH 1/2 drivers: watchdog: Enhance watchdog support in SPL for Stratix 10 and Agilex
From: Siew Chin Lim <[email protected]>
Change watchdog default timeout to 10 seconds and enable watchdog before initializing other component (example: DDR). Thus, watchdog need to be fully executed in onchip ram.
--- arch/arm/mach-socfpga/spl_agilex.c | 17 +++++++++-------- arch/arm/mach-socfpga/spl_s10.c | 14 +++++++------- drivers/watchdog/Kconfig | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-)
arch/arm/mach-socfpga/spl_agilex.c +9 -8
@@ -20,7 +20,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 ;
@@ -40,13 +40,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 );
@@ -60,6 +53,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 ();
arch/arm/mach-socfpga/spl_s10.c +7 -7
@@ -21,7 +21,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 ;
@@ -41,12 +41,12 @@ 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 +/* +* Enable watchdog as early as possible before initializing other +* component. +*/ +if (CONFIG_IS_ENABLED (WDT )) +initr_watchdog ();/* ensure all processors are not released prior Linux boot */ writeq (0 ,CPU_RELEASE_ADDR );
drivers/watchdog/Kconfig +1 -1
@@ -27,7 +27,7 @@ config WATCHDOG_TIMEOUT_MSECS int "Watchdog timeout in msec" default 128000 if ARCH_MX31 || ARCH_MX5 || ARCH_MX6 default 128000 if ARCH_MX7 || ARCH_VF610 - default 30000 if ARCH_SOCFPGA + default 10000 if ARCH_SOCFPGA default 16000 if ARCH_SUNXI default 60000 help
Signature · 1 line
2.26.2
PATCH 2/2 drivers: watchdog: Enhance watchdog support in SPL for N5X
From: Siew Chin Lim <[email protected]>
Enable watchdog before initializing other component (example: DDR). Thus, watchdog need to be fully executed in onchip ram.
--- arch/arm/mach-socfpga/spl_n5x.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
arch/arm/mach-socfpga/spl_n5x.c +10 -7
@@ -21,6 +21,8 @@#include <init.h> #include <spl.h> #include <watchdog.h> +#include <asm/arch/smmu_s10.h> +#include <wdt.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -39,13 +41,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 );
@@ -67,6 +62,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 ();
Signature · 1 line
2.26.2
Quoted 5 lines · Jit Loon Lim
From: Siew Chin Lim <[email protected]>
Change watchdog default timeout to 10 seconds and enable watchdog before initializing other component (example: DDR). Thus, watchdog need to be fully executed in onchip ram.
Please find some comments below.
Quoted 22 lines
Signed-off-by Siew Chin Lim <[email protected]>Signed-off-by Jit Loon Lim <[email protected]>--- arch/arm/mach-socfpga/spl_agilex.c | 17 +++++++++-------- arch/arm/mach-socfpga/spl_s10.c | 14 +++++++------- drivers/watchdog/Kconfig | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-)arch/arm/mach-socfpga/spl_agilex.c +1
-1@@ -20,7 +20,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 ;
arch/arm/mach-socfpga/spl_agilex.c void board_init_f(ulong dummy) · line 49
Quoted 10 lines
arch/arm/mach-socfpga/spl_agilex.c +0
-7@@ -40,13 +40,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 -
The patch also removes the CONFIG_HW_WATCHDOG stuff, which is probably unused right now. Could you please also mention this in the commit message?
Quoted 5 lines
arch/arm/mach-socfpga/spl_agilex.c +0
-0/* ensure all processors are not released prior Linux boot */ writeq (0 ,CPU_RELEASE_ADDR );@@ -60,6 +53,14 @@ void board_init_f(ulong dummy)hang ();
arch/arm/mach-socfpga/spl_agilex.c void board_init_f(ulong dummy) · line 63
Quoted 10 lines
arch/arm/mach-socfpga/spl_agilex.c +8
-0} +/* +* 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 (); +
initr_watchdog() will get called from spl/common/spl/spl.c:board_init_r(). Is this too late? How much time passes between these two code path's?
Thanks,
Stefan
Quoted 40 lines
arch/arm/mach-socfpga/spl_agilex.c +0
-0preloader_console_init ();print_reset_info ();cm_print_clock_quick_summary ();arch/arm/mach-socfpga/spl_s10.c +7
-7@@ -21,7 +21,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 ;@@ -41,12 +41,12 @@ 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 +/* +* Enable watchdog as early as possible before initializing other +* component. +*/ +if (CONFIG_IS_ENABLED (WDT )) +initr_watchdog ();/* ensure all processors are not released prior Linux boot */ writeq (0 ,CPU_RELEASE_ADDR );drivers/watchdog/Kconfig +0
-0
drivers/watchdog/Kconfig config WATCHDOG_TIMEOUT_MSECS · line 33
Quoted 8 lines
drivers/watchdog/Kconfig +1
-1@@ -27,7 +27,7 @@ config WATCHDOG_TIMEOUT_MSECS int "Watchdog timeout in msec" default 128000 if ARCH_MX31 || ARCH_MX5 || ARCH_MX6 default 128000 if ARCH_MX7 || ARCH_VF610 - default 30000 if ARCH_SOCFPGA + default 10000 if ARCH_SOCFPGA default 16000 if ARCH_SUNXI default 60000 help
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
-----Original Message-----
From: Stefan Roese <[email protected]>
Sent: Monday, 5 December, 2022 8:28 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Vignesh R <[email protected]>; Vasut, Marek <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lim, Elly Siew Chin <[email protected]>; Kho, Sin Hui <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>
Subject: Re: [PATCH 1/2] drivers: watchdog: Enhance watchdog support in SPL for Stratix 10 and Agilex
Quoted 5 lines · Jit Loon Lim
From: Siew Chin Lim <[email protected]>
Change watchdog default timeout to 10 seconds and enable watchdog before initializing other component (example: DDR). Thus, watchdog need to be fully executed in onchip ram.
Please find some comments below.
Quoted 22 lines
Signed-off-by Siew Chin Lim <[email protected]>Signed-off-by Jit Loon Lim <[email protected]>--- arch/arm/mach-socfpga/spl_agilex.c | 17 +++++++++-------- arch/arm/mach-socfpga/spl_s10.c | 14 +++++++------- drivers/watchdog/Kconfig | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-)arch/arm/mach-socfpga/spl_agilex.c +1
-0@@ -20,7 +20,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 ;
arch/arm/mach-socfpga/spl_agilex.c void board_init_f(ulong dummy) · line 49
Quoted 10 lines
arch/arm/mach-socfpga/spl_agilex.c +0
-7@@ -40,13 +40,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 -
The patch also removes the CONFIG_HW_WATCHDOG stuff, which is probably unused right now. Could you please also mention this in the commit message?
Sure.
Quoted 5 lines
arch/arm/mach-socfpga/spl_agilex.c +0
-0/* ensure all processors are not released prior Linux boot */ writeq (0 ,CPU_RELEASE_ADDR );@@ -60,6 +53,14 @@ void board_init_f(ulong dummy)hang ();
arch/arm/mach-socfpga/spl_agilex.c void board_init_f(ulong dummy) · line 63
Quoted 10 lines
arch/arm/mach-socfpga/spl_agilex.c +8
-0} +/* +* 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 (); +
initr_watchdog() will get called from spl/common/spl/spl.c:board_init_r(). Is this too late? How much time passes between these two code path's?
We do not have the actual measurement now and shall update once we get it measured.
Thanks,
Stefan
Quoted 39 lines
arch/arm/mach-socfpga/spl_agilex.c +0
-0preloader_console_init ();print_reset_info ();cm_print_clock_quick_summary ();(quoted diff) +0
-0
b/arch/arm/mach-socfpga/spl_s10.cindexc20e87cdbe..4044dc335e100644arch/arm/mach-socfpga/spl_s10.c +7
-6@@ -21,7 +21,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 ;@@ -41,12 +41,12 @@ 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 +/* +* Enable watchdog as early as possible before initializing other +* component. +*/ +if (CONFIG_IS_ENABLED (WDT )) +initr_watchdog ();/* ensure all processors are not released prior Linux boot */ writeq (0 ,CPU_RELEASE_ADDR );drivers/watchdog/Kconfig index renamed from drivers/watchdog/Kconfig +0
-0
50e6a1efba..a6c242ac9d100644
drivers/watchdog/Kconfig config WATCHDOG_TIMEOUT_MSECS · line 33
Quoted 8 lines
drivers/watchdog/Kconfig +1
-1@@ -27,7 +27,7 @@ config WATCHDOG_TIMEOUT_MSECS int "Watchdog timeout in msec" default 128000 if ARCH_MX31 || ARCH_MX5 || ARCH_MX6 default 128000 if ARCH_MX7 || ARCH_VF610 - default 30000 if ARCH_SOCFPGA + default 10000 if ARCH_SOCFPGA default 16000 if ARCH_SUNXI default 60000 help
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Hi Lim, Jit Loon,
Quoted 72 lines · Jit Loon
-----Original Message-----
From: Stefan Roese <[email protected]>
Sent: Monday, 5 December, 2022 8:28 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Vignesh R <[email protected]>; Vasut, Marek <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lim, Elly Siew Chin <[email protected]>; Kho, Sin Hui <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>
Subject: Re: [PATCH 1/2] drivers: watchdog: Enhance watchdog support in SPL for Stratix 10 and AgilexQuoted 5 lines · Jit Loon Lim
From: Siew Chin Lim <[email protected]>
Change watchdog default timeout to 10 seconds and enable watchdog before initializing other component (example: DDR). Thus, watchdog need to be fully executed in onchip ram.
Please find some comments below.
Quoted 22 lines
Signed-off-by Siew Chin Lim <[email protected]>Signed-off-by Jit Loon Lim <[email protected]>--- arch/arm/mach-socfpga/spl_agilex.c | 17 +++++++++-------- arch/arm/mach-socfpga/spl_s10.c | 14 +++++++------- drivers/watchdog/Kconfig | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-)arch/arm/mach-socfpga/spl_agilex.c +1
-0@@ -20,7 +20,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 ;arch/arm/mach-socfpga/spl_agilex.c void board_init_f(ulong dummy) · line 49
Quoted 10 lines
arch/arm/mach-socfpga/spl_agilex.c +0
-7@@ -40,13 +40,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 -The patch also removes the
CONFIG_HW_WATCHDOGstuff, which is probably unused right now. Could you please also mention this in the commit message?Sure.
Quoted 5 lines
arch/arm/mach-socfpga/spl_agilex.c +0
-0/* ensure all processors are not released prior Linux boot */ writeq (0 ,CPU_RELEASE_ADDR );@@ -60,6 +53,14 @@ void board_init_f(ulong dummy)hang ();arch/arm/mach-socfpga/spl_agilex.c void board_init_f(ulong dummy) · line 63
Quoted 10 lines
arch/arm/mach-socfpga/spl_agilex.c +8
-0} +/* +* 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 (); +
initr_watchdog()will get called fromspl/common/spl/spl.c:board_init_r(). Is this too late? How much time passes between these two code path's?
Quoted 1 line
We do not have the actual measurement now and shall update once we get it measured.
Do you have some updates on this by now?
Thanks,
Stefan
Quoted 45 lines
Thanks,
StefanQuoted 42 lines
arch/arm/mach-socfpga/spl_agilex.c +0
-0preloader_console_init ();print_reset_info ();cm_print_clock_quick_summary ();(quoted diff) +0
-0
b/arch/arm/mach-socfpga/spl_s10.cindexc20e87cdbe..4044dc335e100644arch/arm/mach-socfpga/spl_s10.c +7
-6@@ -21,7 +21,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 ;@@ -41,12 +41,12 @@ 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 +/* +* Enable watchdog as early as possible before initializing other +* component. +*/ +if (CONFIG_IS_ENABLED (WDT )) +initr_watchdog ();/* ensure all processors are not released prior Linux boot */ writeq (0 ,CPU_RELEASE_ADDR );drivers/watchdog/Kconfig index renamed from drivers/watchdog/Kconfig +0
-0
50e6a1efba..a6c242ac9d100644drivers/watchdog/Kconfig +0
-0@@ -27,7 +27,7 @@ config WATCHDOG_TIMEOUT_MSECS int "Watchdog timeout in msec" default 128000 if ARCH_MX31 || ARCH_MX5 || ARCH_MX6 default 128000 if ARCH_MX7 || ARCH_VF610
Quoted 9 lines
drivers/watchdog/Kconfig config WATCHDOG_TIMEOUT_MSECS · line 33
Quoted 5 lines
drivers/watchdog/Kconfig +1
-1- default 30000 if ARCH_SOCFPGA + default 10000 if ARCH_SOCFPGA default 16000 if ARCH_SUNXI default 60000 helpViele Grüße,
Stefan Roese
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]