Skip to contentSkip to conversation

watchdog: Fix SPL build with watchdog disabled in asm files

PATCH In review Pali Rohár 2 participants 4 messages Apr 28, 2022 – Jun 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: Fix SPL build with watchdog disabled in asm files

Allow to compile assembler files in SPL build which calls WATCHDOG_RESET function when watchdog is disabled in SPL and enabled in U-Boot proper.

This issue was fixed in past by commit 7fbd42f5afc4 ("watchdog: Handle SPL build with watchdog disabled") for C source files, but not for assembler source files.

Currently the only assembler source file which calls WATCHDOG_RESET is arch/powerpc/lib/ticks.S, so this patch affects and fixes powerpc SPL builds.

---
 include/watchdog.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
include/watchdog.h +7 -1
index 14fa5fda259e..813cc8f2a5d3 100644
@@ -49,7 +49,13 @@ int init_func_watchdog_reset(void);
 	 */
 	#if defined(CONFIG_WATCHDOG)
 		#if defined(__ASSEMBLY__)
-			#define WATCHDOG_RESET bl watchdog_reset
+			/* 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*/
+			#else
+				#define WATCHDOG_RESET bl watchdog_reset
+			#endif
 		#else
 			/* Don't require the watchdog to be enabled in SPL */
 			#if defined(CONFIG_SPL_BUILD) &&		\
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Pali Rohár

Allow to compile assembler files in SPL build which calls WATCHDOG_RESET function when watchdog is disabled in SPL and enabled in U-Boot proper.

This issue was fixed in past by commit 7fbd42f5afc4 ("watchdog: Handle SPL build with watchdog disabled") for C source files, but not for assembler source files.

Quoted 5 lines

Currently the only assembler source file which calls WATCHDOG_RESET is arch/powerpc/lib/ticks.S, so this patch affects and fixes powerpc SPL builds.

Thanks,
Stefan

Quoted 13 lines
---
  include/watchdog.h | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
include/watchdog.h +0 -1
index 14fa5fda259e..813cc8f2a5d3 100644
@@ -49,7 +49,13 @@ int init_func_watchdog_reset(void);
  	 */
  	#if defined(CONFIG_WATCHDOG)
  		#if defined(__ASSEMBLY__)
-			#define WATCHDOG_RESET bl watchdog_reset

include/watchdog.h int init_func_watchdog_reset(void); · line 61

Quoted 10 lines
include/watchdog.h +7 -0
+			/* 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*/
+			#else
+				#define WATCHDOG_RESET bl watchdog_reset
+			#endif
  		#else
  			/* Don't require the watchdog to be enabled in SPL */
  			#if defined(CONFIG_SPL_BUILD) &&		\

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#2 lore raw
In reply to Pali Rohár

PING?

Quoted 38 lines · On Thursday 28 April 2022 13:33:09 Pali Rohár wrote:

Allow to compile assembler files in SPL build which calls WATCHDOG_RESET function when watchdog is disabled in SPL and enabled in U-Boot proper.

This issue was fixed in past by commit 7fbd42f5afc4 ("watchdog: Handle SPL build with watchdog disabled") for C source files, but not for assembler source files.

Currently the only assembler source file which calls WATCHDOG_RESET is arch/powerpc/lib/ticks.S, so this patch affects and fixes powerpc SPL builds.

---
 include/watchdog.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
include/watchdog.h +7 -1
index 14fa5fda259e..813cc8f2a5d3 100644
@@ -49,7 +49,13 @@ int init_func_watchdog_reset(void);
 	 */
 	#if defined(CONFIG_WATCHDOG)
 		#if defined(__ASSEMBLY__)
-			#define WATCHDOG_RESET bl watchdog_reset
+			/* 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*/
+			#else
+				#define WATCHDOG_RESET bl watchdog_reset
+			#endif
 		#else
 			/* Don't require the watchdog to be enabled in SPL */
 			#if defined(CONFIG_SPL_BUILD) &&		\
Signature · 1 line
2.20.1
#3 lore raw
Quoted 15 lines · Pali Rohár

PING?

Quoted 12 lines · On Thursday 28 April 2022 13:33:09 Pali Rohár wrote:

Allow to compile assembler files in SPL build which calls WATCHDOG_RESET function when watchdog is disabled in SPL and enabled in U-Boot proper.

This issue was fixed in past by commit 7fbd42f5afc4 ("watchdog: Handle SPL build with watchdog disabled") for C source files, but not for assembler source files.

Currently the only assembler source file which calls WATCHDOG_RESET is arch/powerpc/lib/ticks.S, so this patch affects and fixes powerpc SPL builds.

Applied to u-boot-watchdog/master

Thanks,
Stefan

Quoted 18 lines
Quoted 18 lines
---
  include/watchdog.h | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
include/watchdog.h +5 -1
index 14fa5fda259e..813cc8f2a5d3 100644
@@ -49,7 +49,13 @@ int init_func_watchdog_reset(void);
  	 */
  	#if defined(CONFIG_WATCHDOG)
  		#if defined(__ASSEMBLY__)
-			#define WATCHDOG_RESET bl watchdog_reset
+			/* 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*/
+			#else
Quoted 8 lines
Quoted 8 lines
include/watchdog.h +2 -0
+				#define WATCHDOG_RESET bl watchdog_reset
+			#endif
  		#else
  			/* Don't require the watchdog to be enabled in SPL */
  			#if defined(CONFIG_SPL_BUILD) &&		\
Signature · 1 line
2.20.1

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]