[PATCH 5/5] maix: enable SBI system reset for MAIX

Heinrich Schuchardt xypron.glpk at gmx.de
Thu Mar 4 18:00:51 CET 2021


When running in S-mode we can use the SBI system reset extension to provide
the system reset.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 board/sipeed/maix/maix.c            | 5 +++++
 configs/sipeed_maix_smode_defconfig | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/board/sipeed/maix/maix.c b/board/sipeed/maix/maix.c
index cbcb23cf5c..388eddee6e 100644
--- a/board/sipeed/maix/maix.c
+++ b/board/sipeed/maix/maix.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
+#include <dm/lists.h>
 #include <fdt_support.h>
 #include <asm/io.h>

@@ -37,5 +38,9 @@ int board_init(void)
 			return ret;
 	}

+	if (IS_ENABLED(CONFIG_SYSRESET_SBI))
+		ret = device_bind_driver(gd->dm_root, "sbi-sysreset",
+					 "sbi-sysreset", NULL);
+
 	return 0;
 }
diff --git a/configs/sipeed_maix_smode_defconfig b/configs/sipeed_maix_smode_defconfig
index 2516bb7258..aa95893feb 100644
--- a/configs/sipeed_maix_smode_defconfig
+++ b/configs/sipeed_maix_smode_defconfig
@@ -7,4 +7,6 @@ CONFIG_STACK_SIZE=0x100000
 # CONFIG_NET is not set
 # CONFIG_INPUT is not set
 # CONFIG_DM_ETH is not set
+CONFIG_SYSRESET_SBI=y
+# CONFIG_SYSRESET_SYSCON is not set
 # CONFIG_EFI_UNICODE_CAPITALIZATION is not set
--
2.30.1



More information about the U-Boot mailing list