Skip to content

Add riscv semihosting support in u-boot

Kautuk Consul u-boot 7 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 0 repliesNew
  2. v53 patches 25 repliesSuperseded
  3. v43 patches 7 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v33 patches1 replySuperseded
v2 posting 2/20 of 3 patches0 repliesSuperseded
v2 posting 1/23 patches8 repliesSuperseded
v12 patches7 repliesSuperseded

Changes in v6 from the cover letter

- Removed patch 3/3: default enablement of semihosting removed
for the qemu-riscv64 targets due to failure of the CI test-cases. This is happening due to the qemu version and some commits currently not taken into qemu latest version.
- Added patch 3/3: Added a 3rd patch which adds a dependency on SPL_SEMIHOSTING for the SPL_FS_LOAD_PAYLOAD_NAME config option. This will remove the need for the user to enable any of the SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS config options for SPL_SEMIHOSTING compilations.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3lib: Add common semihosting libraryarch/arm/Kconfig arch/arm/lib/semihosting.c include/semihosting.h +3 more+247 -2260 replies
2/3arch/riscv: add semihosting support for RISC-Varch/riscv/include/asm/spl.h arch/riscv/lib/Makefile arch/riscv/lib/interrupts.c +2 more+57 -50 replies
3/3common/spl/Kconfig: add dependency on SPL_SEMIHOSTING for SPL payloadcommon/spl/Kconfig+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 0/3] Add riscv semihosting support in u-boot

Semihosting is a mechanism that enables code running on a target to communicate and use the Input/Output facilities on a host computer that is running a debugger. This patchset adds support for semihosting in u-boot for RISCV64 targets.

CHANGES since v5:
- Removed patch 3/3: default enablement of semihosting removed
for the qemu-riscv64 targets due to failure of the CI test-cases. This is happening due to the qemu version and some commits currently not taken into qemu latest version.
- Added patch 3/3: Added a 3rd patch which adds a dependency on SPL_SEMIHOSTING for the SPL_FS_LOAD_PAYLOAD_NAME config option. This will remove the need for the user to enable any of the SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS config options for SPL_SEMIHOSTING compilations.

Compilation and test commands for SPL and S-mode configurations
=================================================================

U-Boot S-mode on QEMU virt
----------------------------
// Compilation of S-mode u-boot
ARCH=riscv
CROSS_COMPILE=riscv64-unknown-linux-gnu-
make qemu-riscv64_smode_defconfig
make
// Run riscv 64-bit u-boot with opensbi on qemu qemu-system-riscv64 -M virt -m 256M -display none -serial stdio -bios\
opensbi/build/platform/generic/firmware/fw_jump.bin -kernel\
u-boot/u-boot.bin -semihosting-config enable=on

U-Boot SPL on QEMU virt
------------------------
// Compilation of u-boot-spl
ARCH=riscv
CROSS_COMPILE=riscv64-unknown-linux-gnu-
make qemu-riscv64_spl_defconfig
make OPENSBI=opensbi/build/platform/generic/firmware/fw_dynamic.bin // Run 64-bit u-boot-spl in qemu
qemu-system-riscv64 -M virt -m 256M -display none -serial stdio -bios\
u-boot/spl/u-boot-spl.bin -device\
loader,file=u-boot/u-boot.itb,addr=0x80200000 -semihosting-config enable=on

Kautuk Consul (3):
lib: Add common semihosting library
arch/riscv: add semihosting support for RISC-V common/spl/Kconfig: add dependency on SPL_SEMIHOSTING for SPL payload

 arch/arm/Kconfig             |  46 ---------
 arch/arm/lib/semihosting.c   | 181 +---------------------------------
 arch/riscv/include/asm/spl.h |   1 +
 arch/riscv/lib/Makefile      |   2 +
 arch/riscv/lib/interrupts.c  |  25 +++++
 arch/riscv/lib/semihosting.c |  24 +++++
 common/spl/Kconfig           |   2 +-
 include/semihosting.h        |  11 +++
 lib/Kconfig                  |  47 +++++++++
 lib/Makefile                 |   2 +
 lib/semihosting.c            | 186 +++++++++++++++++++++++++++++++++++
 11 files changed, 300 insertions(+), 227 deletions(-)
 create mode 100644 arch/riscv/lib/semihosting.c
 create mode 100644 lib/semihosting.c
Signature · 1 line
2.34.1