[PATCH 4/7] sh4: move reset_cpu() from watchdog.c to cpu.c

Rasmus Villemoes rasmus.villemoes at prevas.dk
Tue May 28 13:13:22 CEST 2024


The next patch will remove all the other code from watchdog.c, which
would leave just this function in there. It seems just as natural for
this function to be defined in cpu.c, allowing us to delete watchdog.c
completely.

Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
---
 arch/sh/cpu/sh4/cpu.c      | 10 ++++++++++
 arch/sh/cpu/sh4/watchdog.c |  9 ---------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/arch/sh/cpu/sh4/cpu.c b/arch/sh/cpu/sh4/cpu.c
index 1b2f50dbe6e..6b52737028d 100644
--- a/arch/sh/cpu/sh4/cpu.c
+++ b/arch/sh/cpu/sh4/cpu.c
@@ -11,6 +11,16 @@
 #include <net.h>
 #include <netdev.h>
 #include <asm/processor.h>
+#include <asm/system.h>
+
+void reset_cpu(void)
+{
+	/* Address error with SR.BL=1 first. */
+	trigger_address_error();
+
+	while (1)
+		;
+}
 
 int checkcpu(void)
 {
diff --git a/arch/sh/cpu/sh4/watchdog.c b/arch/sh/cpu/sh4/watchdog.c
index bf403d3c520..a891333392f 100644
--- a/arch/sh/cpu/sh4/watchdog.c
+++ b/arch/sh/cpu/sh4/watchdog.c
@@ -50,12 +50,3 @@ int watchdog_disable(void)
 	return 0;
 }
 #endif
-
-void reset_cpu(void)
-{
-	/* Address error with SR.BL=1 first. */
-	trigger_address_error();
-
-	while (1)
-		;
-}
-- 
2.40.1.1.g1c60b9335d



More information about the U-Boot mailing list