CVA6-CHERI, genesys2, RVY: Add support for generating bootable SD card images for CheriBSD, CHERI-Linux, and CHERI-seL4 - #523
Open
heshamelmatary wants to merge 21 commits into
Open
CVA6-CHERI, genesys2, RVY: Add support for generating bootable SD card images for CheriBSD, CHERI-Linux, and CHERI-seL4#523heshamelmatary wants to merge 21 commits into
heshamelmatary wants to merge 21 commits into
Conversation
Similar to CheriBSD's kernel-config, this commit allows the user to specify a defconfig that is not a default eg for CVA6-CHERI or Codasip's X730 by passing its name to --linux-kernel/defconfig $XXX.
Similar to Linux's defconfig, this commit allows the user to specify a defconfig that is not a default eg for CVA6-CHERI or Codasip's X730 by passing its name to --u-boot/defconfig $XXX
Currently the launch target will add -cpu codasip-a730 only if --riscv-cheri-isa experimental_std093 is passed, and will discard -cpu if not. Discarding -cpu will result in a CHERI-enabled RVY QEMU, but with extended CHERI flags/features disabled such as cheri_pte, cheri_levels, etc, in the QEMU 7.1 branch. This PR fixes this by: 1- Always pass -cpu rv64,cheri_pte,cheri_levels for RVY by default, without having to check for the --riscv-cheri-isa flag, by also relying on the cross compilation target. 2- Use a more generic -cpu rv64 and not codasip-a730.
Install the host-built mkimage tool as part of the U-Boot installation. mkimage is useful for creating U-Boot payload images and scripts, including FIT images and .scr boot scripts.
Install any generated RISC-V device tree blobs alongside the other U-Boot artifacts. Some platforms and U-Boot configurations (e.g. FIT images) require DTBs to be packaged with the boot artifacts when booting operating systems such as Linux. Installing the generated DTBs is also useful when using custom DTBs instead of relying on those provided by the firmware, so install them when they are present.
Current cheribuild only uses the fw_jump variant of OpenSBI while there exists other variants as well such as fw_payload that could be used. This commit enables choosing the payload variant of opensbi (which could embed u-boot and/or other OSes) and install it as an optional (QEMU's) firmware variant besides fw_jump.
To avoid getting stuck if there is no dhcp server.
Mocha is lowRISC's CHERI-enabled SoC part of the COSMIC project [1] and is based on our CVA6-CHERI. This commit uses lowRISC's GitHub repos and configs to reproduce their images using cheribuild and for our own CI testing as well. [1] https://cosmic-project.lowrisc.org
Contributor
|
Thanks for this! Will be very helpful for getting people set up on the Genesys2 CVA6-CHERI platform. |
heshamelmatary
force-pushed
the
cva6-cheri
branch
2 times, most recently
from
July 28, 2026 14:28
e33c1d1 to
57b0a51
Compare
Also move Mocha CHERI-Linux targets to the same separate file.
heshamelmatary
force-pushed
the
cva6-cheri
branch
from
July 28, 2026 14:47
57b0a51 to
6620850
Compare
Microkit is a tool and light-weight libraries to build/run seL4 applications on top of it; it is usually packaged, along with the toolchain, as a package to be used as an seL4 SDK.
There is a corner case when a user provides both repository _and_ git-revision (eg for LLVM), which will fail to clone if the passed repository does not have the default_branch encoded in the target.
This is also tested and works fine for CHERI-Linux and CHERI-seL4.
heshamelmatary
force-pushed
the
cva6-cheri
branch
from
July 29, 2026 15:21
3ef2852 to
849d5fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds targets for generating bootable images that can be flashed to an SD card (or injected directly into RAM) and used to run on both Mocha and CVA6-CHERI on the Genesys2 board. Only purecap RVY targets are currently supported. The boot flow and tools align as closely as possible with CVA6-SDK, which uses U-Boot as an OpenSBI payload and embeds kernels/OSes, ramdisks, and DTBs in a new U-Boot FIT image format. The currently supported OS images include:
./cheribuild.py genimage-cva6-cheribsd --cheribsd-mfs-root-kernel-riscv64-purecap/kernel-config RVY-PURECAP-PRIME --riscv-cheri-isa=experimental_std093 --cheribsd/git-revision cheri-rv64y-rebased-c18n -dNote: At the time of creating this PR, a working and tested RVY CheriBSD build requires the custom flags, branches, repositories, and toolchain specified above. This will hopefully become more stable and eventually be merged upstream, at which point fewer custom options should be required.
CHERI-Linux (minimal):
./cheribuild.py genimage-cva6-cheri-linux -dor for Mocha:
./cheribuild.py genimage-mocha-cheri-linux --riscv-float-abi soft -dCHERI-seL4 (CHERI-Microkit userspace and CHERI-Exercises on top):
./cheribuild.py genimage-cva6-cheri-sel4 --cheri-microkit/boards arianeThe above have been tested against bitfiles generated from CVA6-CHERI for the Genesys2 board.
Note:
This PR/branch is standalone and self-contained (i.e. it can be used independently to build the images) and includes commits from #483, #502, #503, #504, #505, and #521. It will likely be force-pushed during the review process to address comments and fixes until it is merged into
main.