From: Anup Patel <anup@brainfault.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 0/3] RISC-V S-mode support
Date: Wed, 21 Nov 2018 09:11:09 +0530 [thread overview]
Message-ID: <20181121034112.7136-1-anup@brainfault.org> (raw)
This patchset allows us runing u-boot in S-mode which is
useful on platforms where M-mode runtime firmware is an
independent firmware and u-boot is used as last stage OS
bootloader.
The patchset based upon git://git.denx.de/u-boot-riscv.git
and is tested on QEMU in both M-mode and S-mode.
For S-mode testing, we have used u-boot.bin as payload of
latest BBL (at commit 6ebd0f2a46255d0c76dad3c05b16c1d154795d26)
applied with following changes:
diff --git a/machine/emulation.c b/machine/emulation.c
index 132e977..def75e1 100644
--- a/machine/emulation.c
+++ b/machine/emulation.c
@@ -162,6 +162,12 @@ static inline int emulate_read_csr(int num, uintptr_t mstatus, uintptr_t* result
switch (num)
{
+ case CSR_MISA:
+ *result = read_csr(misa);
+ return 0;
+ case CSR_MHARTID:
+ *result = read_csr(mhartid);
+ return 0;
case CSR_CYCLE:
if (!((counteren >> (CSR_CYCLE - CSR_CYCLE)) & 1))
return -1;
Changes since v2:
- Dropped 'default n" from RISCV_SMODE kconfig option
- Replaced '-smode_' in defconfig names with '_smode_'
Changes since v1:
- Rebased upon latest git://git.denx.de/u-boot-riscv.git
- Add details in cover letter for running u-boot in S-mode
using BBL
Anup Patel (3):
riscv: Add kconfig option to run u-boot in S-mode
riscv: qemu: Use different SYS_TEXT_BASE for S-mode
riscv: Add S-mode defconfigs for QEMU virt machine
arch/riscv/Kconfig | 5 ++++
arch/riscv/cpu/start.S | 33 ++++++++++++++++++++++++++
board/emulation/qemu-riscv/Kconfig | 3 ++-
board/emulation/qemu-riscv/MAINTAINERS | 2 ++
configs/qemu-riscv32_smode_defconfig | 10 ++++++++
configs/qemu-riscv64_smode_defconfig | 11 +++++++++
6 files changed, 63 insertions(+), 1 deletion(-)
create mode 100644 configs/qemu-riscv32_smode_defconfig
create mode 100644 configs/qemu-riscv64_smode_defconfig
--
2.17.1
next reply other threads:[~2018-11-21 3:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 3:41 Anup Patel [this message]
2018-11-21 3:41 ` [U-Boot] [PATCH v3 1/3] riscv: Add kconfig option to run u-boot in S-mode Anup Patel
2018-11-21 13:47 ` Auer, Lukas
2018-11-21 22:11 ` Auer, Lukas
2018-11-22 4:00 ` Anup Patel
2018-11-21 16:28 ` Palmer Dabbelt
2018-11-21 22:06 ` Auer, Lukas
2018-11-21 22:16 ` Palmer Dabbelt
2018-11-22 4:00 ` Anup Patel
2018-11-22 14:36 ` Bin Meng
2018-11-21 3:41 ` [U-Boot] [PATCH v3 2/3] riscv: qemu: Use different SYS_TEXT_BASE for S-mode Anup Patel
2018-11-21 13:48 ` Auer, Lukas
2018-11-21 3:41 ` [U-Boot] [PATCH v3 3/3] riscv: Add S-mode defconfigs for QEMU virt machine Anup Patel
2018-11-21 13:48 ` Auer, Lukas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181121034112.7136-1-anup@brainfault.org \
--to=anup@brainfault.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox