Skip to contentSkip to conversation

ARC: Reset: Implement weak reset_cpu()

PATCH New Alexey Brodkin 1 participant 1 message May 31, 2018 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARC: Reset: Implement weak reset_cpu()

This will allow for board-specific implementation of reset. Default version will just stop execution with help of BRK instruction.

---
 arch/arc/lib/reset.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
arch/arc/lib/reset.c +9 -5
index fe38c51bff93..02e08df48de0 100644
@@ -6,13 +6,17 @@
 #include <command.h>
 #include <common.h>
 
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+__weak void reset_cpu(ulong addr)
 {
-	printf("Put your restart handler here\n");
-
-#ifdef DEBUG
 	/* Stop debug session here */
 	__builtin_arc_brk();
-#endif
+}
+
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+	printf("Resetting the board...\n");
+
+	reset_cpu(0);
+
 	return 0;
 }
Signature · 1 line
2.17.0