diff mbox series

[12/18] bootm: Adjust how the board is reset

Message ID 20231204002642.895926-6-sjg@chromium.org
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
Use reset_cpu() to reset the board, copying the logic from the 'reset'
command. This makes more sense than directly calling the do_reset()
function with the arguments passsed to the bootm command.

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

 boot/bootm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Tom Rini Dec. 9, 2023, 4:01 p.m. UTC | #1
On Sun, Dec 03, 2023 at 05:26:28PM -0700, Simon Glass wrote:

> Use reset_cpu() to reset the board, copying the logic from the 'reset'
> command. This makes more sense than directly calling the do_reset()
> function with the arguments passsed to the bootm command.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox series

Patch

diff --git a/boot/bootm.c b/boot/bootm.c
index d2448f6306dc..de5c32099ceb 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -1138,10 +1138,12 @@  err:
 	if (iflag)
 		enable_interrupts();
 
-	if (ret == BOOTM_ERR_UNIMPLEMENTED)
+	if (ret == BOOTM_ERR_UNIMPLEMENTED) {
 		bootstage_error(BOOTSTAGE_ID_DECOMP_UNIMPL);
-	else if (ret == BOOTM_ERR_RESET)
-		do_reset(cmdtp, flag, argc, argv);
+	} else if (ret == BOOTM_ERR_RESET) {
+		printf("Resetting the board...\n");
+		reset_cpu();
+	}
 
 	return ret;
 }