]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
riscv: Move do_reset() to a common place
authorBin Meng <bmeng.cn@gmail.com>
Wed, 26 Sep 2018 13:55:22 +0000 (06:55 -0700)
committerAndes <uboot@andestech.com>
Wed, 3 Oct 2018 09:48:43 +0000 (17:48 +0800)
We don't have a reset method on any RISC-V board yet. Instead of
adding the same 'unsupported' message for each CPU variant it might
make more sense to add a generic do_reset function for all CPU
variants to lib/, similar to the one for ARM (arch/arm/lib/reset.c).

Suggested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
arch/riscv/cpu/ax25/cpu.c
arch/riscv/cpu/qemu/cpu.c
arch/riscv/lib/Makefile
arch/riscv/lib/reset.c [new file with mode: 0644]

index ab05b57d4fb7005c15405f355e55e478dce09774..fddcc156c3dce4f75ec154307ea4ce352710161c 100644 (file)
@@ -6,9 +6,6 @@
 
 /* CPU specific code */
 #include <common.h>
-#include <command.h>
-#include <watchdog.h>
-#include <asm/cache.h>
 
 /*
  * cleanup_before_linux() is called just before we call linux
@@ -24,9 +21,3 @@ int cleanup_before_linux(void)
 
        return 0;
 }
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       disable_interrupts();
-       panic("ax25-ae350 wdt not support yet.\n");
-}
index a06463937339cee6b2170e9e4d73aa18854fbc51..6c7a32755a698b29a3adb7e4f3151137f23a1928 100644 (file)
@@ -4,7 +4,6 @@
  */
 
 #include <common.h>
-#include <command.h>
 
 /*
  * cleanup_before_linux() is called just before we call linux
@@ -20,10 +19,3 @@ int cleanup_before_linux(void)
 
        return 0;
 }
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       printf("reset unsupported yet\n");
-
-       return 0;
-}
index cc562f935a7ac1038d948cf4b24f62aebae64f1a..b58db89752219b0c197981821db247cf160ce8c4 100644 (file)
@@ -10,6 +10,7 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-$(CONFIG_CMD_GO) += boot.o
 obj-y  += cache.o
 obj-y  += interrupts.o
+obj-y  += reset.o
 obj-y   += setjmp.o
 
 # For building EFI apps
diff --git a/arch/riscv/lib/reset.c b/arch/riscv/lib/reset.c
new file mode 100644 (file)
index 0000000..a6aa8e2
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <common.h>
+#include <command.h>
+
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       printf("resetting ...\n");
+
+       printf("reset unsupported yet\n");
+       hang();
+
+       return 0;
+}