diff mbox series

[08/18] m68k: Add a reset_cpu() function

Message ID 20231203172622.8.I2c0bbce52ecf7ce9458c481fbd12b6029e5ebd27@changeid
State Superseded
Delegated to: Tom Rini
Headers show
Series Complete decoupling of bootm logic from commands | expand

Commit Message

Simon Glass Dec. 4, 2023, 12:26 a.m. UTC
The current do_reset() is called from a command context. Add a function
which can be used from anywhere, as is done on ARM.

Since there are lots of reset functions, this one actually just calls
do_reset(). Future refactoring could correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/m68k/lib/traps.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Angelo Dureghello Dec. 10, 2023, 7:37 p.m. UTC | #1
Hi Simon,


Acked-by: Angelo Dureghello <angelo@kernel-spcece.org>


On 04/12/23 1:26 AM, Simon Glass wrote:
> The current do_reset() is called from a command context. Add a function
> which can be used from anywhere, as is done on ARM.
> 
> Since there are lots of reset functions, this one actually just calls
> do_reset(). Future refactoring could correct this.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>   arch/m68k/lib/traps.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/arch/m68k/lib/traps.c b/arch/m68k/lib/traps.c
> index c283351181d8..ae8ae6ccf592 100644
> --- a/arch/m68k/lib/traps.c
> +++ b/arch/m68k/lib/traps.c
> @@ -7,6 +7,7 @@
>    * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
>    */
>   
> +#include <cpu_func.h>
>   #include <init.h>
>   #include <watchdog.h>
>   #include <command.h>
> @@ -65,3 +66,9 @@ int arch_initr_trap(void)
>   
>   	return 0;
>   }
> +
> +void reset_cpu(void)
> +{
> +	/* TODO: Refactor all the do_reset calls to be reset_cpu() instead */
> +	do_reset(NULL, 0, 0, NULL);
> +}
diff mbox series

Patch

diff --git a/arch/m68k/lib/traps.c b/arch/m68k/lib/traps.c
index c283351181d8..ae8ae6ccf592 100644
--- a/arch/m68k/lib/traps.c
+++ b/arch/m68k/lib/traps.c
@@ -7,6 +7,7 @@ 
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  */
 
+#include <cpu_func.h>
 #include <init.h>
 #include <watchdog.h>
 #include <command.h>
@@ -65,3 +66,9 @@  int arch_initr_trap(void)
 
 	return 0;
 }
+
+void reset_cpu(void)
+{
+	/* TODO: Refactor all the do_reset calls to be reset_cpu() instead */
+	do_reset(NULL, 0, 0, NULL);
+}