[PATCH v2 03/21] ppc: Add a reset_cpu() function
Simon Glass
sjg at chromium.org
Thu Dec 14 17:50:12 CET 2023
The current do_reset() is called from a command context. Add a function
which can be used from anywhere, as is done on ARM.
This is only needed if CONFIG_SYSRESET is disabled.
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 at chromium.org>
---
(no changes since v1)
arch/powerpc/lib/traps.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/powerpc/lib/traps.c b/arch/powerpc/lib/traps.c
index c7bce82a44b3..cf8da2e5df0d 100644
--- a/arch/powerpc/lib/traps.c
+++ b/arch/powerpc/lib/traps.c
@@ -4,6 +4,8 @@
* Wolfgang Denk, DENX Software Engineering, wd at denx.de.
*/
+#include <command.h>
+#include <cpu_func.h>
#include <init.h>
#include <asm/global_data.h>
@@ -17,3 +19,11 @@ int arch_initr_trap(void)
return 0;
}
+
+#ifndef CONFIG_SYSRESET
+void reset_cpu(void)
+{
+ /* TODO: Refactor all the do_reset calls to be reset_cpu() instead */
+ do_reset(NULL, 0, 0, NULL);
+}
+#endif
--
2.43.0.472.g3155946c3a-goog
More information about the U-Boot
mailing list