All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Support SMP on RISC-V cores with Zalrsc only
@ 2025-08-02  9:21 Yao Zi
  2025-08-02  9:21 ` [PATCH 1/2] riscv: Add Kconfig options to distinguish Zaamo and Zalrsc Yao Zi
  2025-08-02  9:21 ` [PATCH 2/2] riscv: Add a Zalrsc-only alternative for synchronization in start.S Yao Zi
  0 siblings, 2 replies; 9+ messages in thread
From: Yao Zi @ 2025-08-02  9:21 UTC (permalink / raw)
  To: Rick Chen, Leo, Tom Rini, Chia-Wei, Wang, Simon Glass; +Cc: u-boot, Yao Zi

Previously, we use AMO instructions to synchronize cores at start when
SMP is used, which requires Zaamo extension to present. This series
implements an alternative implementation of synchronization with LR/SC
instructions and add Kconfig options to use them, make it possible to
enable SMP on cores without Zaamo extension.

This is tested on both TH1520 Lichee Pi 4A board and QEMU. With QEMU,
building and testing looks lile,

	$ make qemu-riscv64_defconfig
	$ ./scripts/config -d CONFIG_RISCV_ISA_ZAAMO
	$ make
	$ qemu-system-riscv64 -M virt \
		-cpu rv64,a=off,zaamo=off,zawrs=off,zalrsc=on	\
		-nographic -bios u-boot-nodtb.bin -smp 8
	U-Boot 2025.10-rc1-00100-gc5bdc8820ee2-dirty (Aug 02 2025 - 09:16:21 +0000)

	CPU:   riscv
	Model: riscv-virtio,qemu
	DRAM:  128 MiB
	using memory 0x86eb5000-0x876d5000 for malloc()
	Core:  34 devices, 13 uclasses, devicetree: board
	Flash: 32 MiB
	Loading Environment from nowhere... OK
	In:    serial,usbkbd
	Out:   serial,vidconsole
	Err:   serial,vidconsole
	No USB controllers found
	Net:   No ethernet found.

without this series, U-Boot won't run if Zaamo is disabled with
-cpu rv64,zaamo=off.

Yao Zi (2):
  riscv: Add Kconfig options to distinguish Zaamo and Zalrsc
  riscv: Add a Zalrsc-only alternative for synchronization in start.S

 arch/riscv/Kconfig             | 17 +++++++++++++++++
 arch/riscv/Makefile            |  7 ++++++-
 arch/riscv/cpu/start.S         | 26 +++++++++++++++++++++++++-
 configs/ibex-ast2700_defconfig |  3 ++-
 4 files changed, 50 insertions(+), 3 deletions(-)

-- 
2.50.1


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

end of thread, other threads:[~2025-08-03  3:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-02  9:21 [PATCH 0/2] Support SMP on RISC-V cores with Zalrsc only Yao Zi
2025-08-02  9:21 ` [PATCH 1/2] riscv: Add Kconfig options to distinguish Zaamo and Zalrsc Yao Zi
2025-08-02 23:59   ` Yixun Lan
2025-08-03  0:16     ` Yao Zi
2025-08-03  1:24   ` Yixun Lan
2025-08-03  3:28     ` Yao Zi
2025-08-02  9:21 ` [PATCH 2/2] riscv: Add a Zalrsc-only alternative for synchronization in start.S Yao Zi
2025-08-03  1:21   ` Yixun Lan
2025-08-03  3:53     ` Yao Zi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.