public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v4 0/3] Add riscv semihosting support in u-boot
@ 2022-09-19 11:49 Kautuk Consul
  2022-09-19 11:49 ` [PATCH v4 1/3] lib: Add common semihosting library Kautuk Consul
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Kautuk Consul @ 2022-09-19 11:49 UTC (permalink / raw)
  To: Rayagonda Kokatanur, Sean Anderson, Rick Chen, Leo, Simon Glass,
	Heinrich Schuchardt, Ilias Apalodimas, Alexandru Gagniuc,
	Philippe Reynes, Rasmus Villemoes, Stefan Roese, Loic Poulain,
	Bin Meng
  Cc: u-boot, Kautuk Consul

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 v2 and v3:
-	v2: Move the arch/arm/Kconfig common *SEMIHOSTING* config
	options from arch/arm/Kconfig to lib/Kconfig.
-	v2: Improve the *SEMIHOSTING_FALLBACK config options in
	lib/Kconfig to depend on RISCV or ARM64.
-	v2: Remove the arch/riscv/include/asm/semhosting.h file.
-	v2: Improve the arch/riscv/lib/semihosting.c by removing the
	jump statement and moving the .align 4 to before the 2
	.option directives.
-	v3: Additionally check for the RISCV config option in the "depends"
	of the SPL_SEMIHOSTING_FALLBACK config option in lib/Kconfig.

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

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

Kautuk Consul (3):
  lib: Add common semihosting library
  arch/riscv: add semihosting support for RISC-V
  board: qemu-riscv: enable semihosting

 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          |  11 ++
 arch/riscv/lib/semihosting.c         |  24 ++++
 configs/qemu-riscv32_defconfig       |   4 +
 configs/qemu-riscv32_smode_defconfig |   4 +
 configs/qemu-riscv32_spl_defconfig   |   7 +
 configs/qemu-riscv64_defconfig       |   4 +
 configs/qemu-riscv64_smode_defconfig |   4 +
 configs/qemu-riscv64_spl_defconfig   |   7 +
 include/semihosting.h                |  11 ++
 lib/Kconfig                          |  46 +++++++
 lib/Makefile                         |   2 +
 lib/semihosting.c                    | 186 +++++++++++++++++++++++++++
 16 files changed, 314 insertions(+), 226 deletions(-)
 create mode 100644 arch/riscv/lib/semihosting.c
 create mode 100644 lib/semihosting.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-09-23  4:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-19 11:49 [PATCH v4 0/3] Add riscv semihosting support in u-boot Kautuk Consul
2022-09-19 11:49 ` [PATCH v4 1/3] lib: Add common semihosting library Kautuk Consul
2022-09-22  9:02   ` Leo Liang
2022-09-22 17:00   ` Sean Anderson
2022-09-23  4:39     ` Kautuk Consul
2022-09-19 11:49 ` [PATCH v4 2/3] arch/riscv: add semihosting support for RISC-V Kautuk Consul
2022-09-22  9:03   ` Leo Liang
2022-09-22 17:05   ` Sean Anderson
2022-09-23  4:57     ` Kautuk Consul
2022-09-19 11:49 ` [PATCH v4 3/3] board: qemu-riscv: enable semihosting Kautuk Consul
2022-09-22  9:03   ` Leo Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox