U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <me@ziyao.cc>
To: Zhouqi Jiang <luojia@rustsbi.com>, u-boot@lists.u-boot-project.org
Cc: tim609@andestech.com, leo.liang@sifive.com, me@ziyao.cc,
	sjg@chromium.org, alpernebiyasak@gmail.com, trini@konsulko.com
Subject: Re: [PATCH] riscv: Add RustSBI firmware support
Date: Mon, 16 Nov 2026 12:45:36 +0000	[thread overview]
Message-ID: <avr68Io04mE4YFs-@pie> (raw)
In-Reply-To: <2744044E69DD25E5+20261115143808.1812787-1-luojia@rustsbi.com>

On Sun, Nov 15, 2026 at 10:38:08PM +0800, Zhouqi Jiang wrote:
> RustSBI is a security-focused, open-source RISC-V SBI implementation
> written in Rust. It is listed in the SBI specification with
> implementation ID 4.
> 
> Add RustSBI support to U-Boot:
> - Add SPL firmware selection and dynamic handoff.
> - Add the RustSBI FIT image type and RUSTSBI binman input.
> - Update RISC-V FIT templates, documentation and tests.
> 
> Ref: https://docs.riscv.org/reference/sbi/_attachments/riscv-sbi.pdf
> Signed-off-by: Zhouqi Jiang <luojia@rustsbi.com>
> ---
>  MAINTAINERS                             |  1 +
>  Makefile                                |  1 +
>  arch/riscv/Kconfig                      | 10 +++----
>  arch/riscv/dts/binman.dtsi              | 23 ++++++++++++++-
>  arch/riscv/dts/thead-th1520-binman.dtsi | 24 ++++++++++++++++
>  boot/image.c                            |  1 +
>  common/spl/Kconfig                      | 37 +++++++++++++++++++------
>  common/spl/Makefile                     |  1 +
>  common/spl/spl.c                        |  3 ++
>  common/spl/spl_fit.c                    |  3 +-
>  common/spl/spl_rustsbi.c                | 13 +++++++++
>  doc/board/emulation/qemu-riscv.rst      |  9 ++++++
>  include/image.h                         |  1 +
>  include/spl.h                           |  5 ++++
>  tools/binman/etype/rustsbi.py           | 18 ++++++++++++
>  tools/binman/ftest.py                   | 16 +++++++++++
>  tools/binman/missing-blob-help          |  4 +++
>  tools/binman/test/fip/rustsbi.dts       | 11 ++++++++

These changes should be defnitely split into separate commits, since
they're related to too many different components (riscv, boot flow,
spl loaders, binman, and doc).

>  18 files changed, 165 insertions(+), 16 deletions(-)
>  create mode 100644 common/spl/spl_rustsbi.c
>  create mode 100644 tools/binman/etype/rustsbi.py
>  create mode 100644 tools/binman/test/fip/rustsbi.dts

[...]

> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 386241efd4a..4bd562437cb 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -476,8 +476,7 @@ config SBI_V02
>  	  single hart needs to boot and enter the operating system. The booting
>  	  hart can bring up secondary harts one by one afterwards.
>  
> -	  Choose this option if OpenSBI release v0.7 or above is used together
> -	  with U-Boot.
> +	  Choose this option if the SBI firmware implements SBI v0.2 or later.

This change itself looks like a good clean-up, and could be accepted
independently with RustSBI support. Please split it into a separate
commit.

[...]

> diff --git a/doc/board/emulation/qemu-riscv.rst b/doc/board/emulation/qemu-riscv.rst
> index a76a1a8bf75..1be2f53f54e 100644
> --- a/doc/board/emulation/qemu-riscv.rst
> +++ b/doc/board/emulation/qemu-riscv.rst
> @@ -124,6 +124,15 @@ with the following commands.
>      make qemu-riscv64_spl_defconfig
>      make
>  
> +To use RustSBI firmware, build RustSBI Prototyper in dynamic mode for the
> +target with the SPL firmware load address. See https://github.com/rustsbi/rustsbi
> +for details. Set RUSTSBI to the firmware binary and build U-Boot::
> +
> +    make qemu-riscv32_spl_defconfig  # Or qemu-riscv64_spl_defconfig
> +    scripts/config --disable SPL_OPENSBI --enable SPL_RUSTSBI
> +    make olddefconfig
> +    make RUSTSBI=/path/to/rustsbi-prototyper-dynamic.bin
> +
>  The minimal QEMU commands to run U-Boot SPL in both 32-bit and 64-bit
>  configurations are:

We should probably not cover every possible SBI implementations in a
board-specific documentation. A better option might be explaining the
support status of different SBI implementations in RISC-V-specific
doc doc/arch/riscv.rst, and keep all the board-level ones as-is.

[...]

-- 
Thanks,
Yao Zi

Meow-mrrp-mrow, I'm a cat.

  parent reply	other threads:[~2026-11-16 12:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 14:38 [PATCH] riscv: Add RustSBI firmware support Zhouqi Jiang
2026-11-15 17:10 ` Tom Rini
2026-11-16  5:42   ` Zhouqi Jiang
2026-11-16 13:02     ` Yao Zi
2026-11-16 15:15       ` Zhouqi Jiang
2026-11-19 11:41         ` Yao Zi
2026-11-19 12:00           ` Zhouqi Jiang
2026-11-16 12:45 ` Yao Zi [this message]
2026-11-19  9:18 ` [PATCH v2 0/3] riscv: Support RustSBI through the FW_DYNAMIC handoff Zhouqi Jiang
2026-11-19 10:31   ` E Shattow
     [not found] ` <20261119091842.3062208-1-luojia@rustsbi.com>
2026-11-19  9:18   ` [PATCH v2 1/3] riscv: Describe SBI_V02 in terms of the SBI version Zhouqi Jiang
2026-11-19 10:43     ` E Shattow
2026-11-19 12:08       ` Yao Zi
2026-11-19  9:18   ` [PATCH v2 2/3] binman: Accept RUSTSBI as an alias for OPENSBI Zhouqi Jiang
2026-11-19 10:47     ` E Shattow
2026-11-19  9:18   ` [PATCH v2 3/3] riscv: Document SBI firmware support in SPL Zhouqi Jiang
2026-11-19 11:14     ` E Shattow
2026-11-19 12:05       ` Zhouqi Jiang

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=avr68Io04mE4YFs-@pie \
    --to=me@ziyao.cc \
    --cc=alpernebiyasak@gmail.com \
    --cc=leo.liang@sifive.com \
    --cc=luojia@rustsbi.com \
    --cc=sjg@chromium.org \
    --cc=tim609@andestech.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    /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