From: Anup Patel <anup@brainfault.org>
Date: Wed, 12 Dec 2018 14:12:29 +0000 (-0800)
Subject: riscv: Introduce a Kconfig option for machine mode
X-Git-Tag: v2025.01-rc5-pxa1908~3209^2~22
X-Git-Url: http://git.dujemihanovic.xyz/img/static/login.html?a=commitdiff_plain;h=3cfc825261d90472fa11ea72d7ed2d293b744140;p=u-boot.git

riscv: Introduce a Kconfig option for machine mode

So far we have a Kconfig option for supervisor mode. This adds an
option for the machine mode.

Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
---

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 6d85ac96f8..55c60e4aeb 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -62,6 +62,22 @@ config CMODEL_MEDANY
 
 endchoice
 
+choice
+	prompt "Run Mode"
+	default RISCV_MMODE
+
+config RISCV_MMODE
+	bool "Machine"
+	help
+	  Choose this option to build U-Boot for RISC-V M-Mode.
+
+config RISCV_SMODE
+	bool "Supervisor"
+	help
+	  Choose this option to build U-Boot for RISC-V S-Mode.
+
+endchoice
+
 config RISCV_ISA_C
 	bool "Emit compressed instructions"
 	default y
@@ -73,11 +89,6 @@ config RISCV_ISA_C
 config RISCV_ISA_A
 	def_bool y
 
-config RISCV_SMODE
-	bool "Run in S-Mode"
-	help
-	  Enable this option to build U-Boot for RISC-V S-Mode
-
 config 32BIT
 	bool