diff mbox series

[U-Boot,v3,2/3] riscv: qemu: Use different SYS_TEXT_BASE for S-mode

Message ID 20181121034112.7136-3-anup@brainfault.org
State Superseded
Delegated to: Andes
Headers show
Series [U-Boot,v3,1/3] riscv: Add kconfig option to run u-boot in S-mode | expand

Commit Message

Anup Patel Nov. 21, 2018, 3:41 a.m. UTC
When u-boot runs in S-mode, the M-mode runtime firmware
(BBL or equivalent) uses memory range in 0x80000000 to
0x80200000. Due to this, we cannot use 0x80000000 as
SYS_TEXT_BASE when running in S-mode. Instead for S-mode,
we use 0x80200000 as SYS_TEXT_BASE.

Even Linux RISC-V kernel ignores/reserves memory range
0x80000000 to 0x80200000 because it runs in S-mode.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
---
 board/emulation/qemu-riscv/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Lukas Auer Nov. 21, 2018, 1:48 p.m. UTC | #1
On Wed, 2018-11-21 at 09:11 +0530, Anup Patel wrote:
> When u-boot runs in S-mode, the M-mode runtime firmware
> (BBL or equivalent) uses memory range in 0x80000000 to
> 0x80200000. Due to this, we cannot use 0x80000000 as
> SYS_TEXT_BASE when running in S-mode. Instead for S-mode,
> we use 0x80200000 as SYS_TEXT_BASE.
> 
> Even Linux RISC-V kernel ignores/reserves memory range
> 0x80000000 to 0x80200000 because it runs in S-mode.
> 
> Signed-off-by: Anup Patel <anup@brainfault.org>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Tested-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>  board/emulation/qemu-riscv/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
diff mbox series

Patch

diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig
index 33ca253432..56bb5337d4 100644
--- a/board/emulation/qemu-riscv/Kconfig
+++ b/board/emulation/qemu-riscv/Kconfig
@@ -13,7 +13,8 @@  config SYS_CONFIG_NAME
 	default "qemu-riscv"
 
 config SYS_TEXT_BASE
-	default 0x80000000
+	default 0x80000000 if !RISCV_SMODE
+	default 0x80200000 if RISCV_SMODE
 
 config BOARD_SPECIFIC_OPTIONS # dummy
 	def_bool y