public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Support SMP on RISC-V cores with Zalrsc only
@ 2025-09-02  8:19 Yao Zi
  2025-09-02  8:19 ` [PATCH v2 1/3] riscv: Add Kconfig options to distinguish Zaamo and Zalrsc Yao Zi
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yao Zi @ 2025-09-02  8:19 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.07-rc4-00456-g2a74e084d720-dirty (Sep 02 2025 - 08:07:58 +0000)

	CPU:   riscv
	Model: riscv-virtio,qemu
	DRAM:  128 MiB
	using memory 0x86ea1000-0x876c1000 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.

Changed from v1
- Split changes to ibex-ast2700_defconfig into a separate patch
- Fix several typos
- Improve help text of CONFIG_RISCV_ISA_{ZAAMO,ZALRSC}
- Improve commit message for PATCH 3
- Link to v1: https://lore.kernel.org/all/20250802092155.40915-1-ziyao@disroot.org/

Yao Zi (3):
  riscv: Add Kconfig options to distinguish Zaamo and Zalrsc
  configs: ibex-ast2700: Explicitly disable Zaamo and Zalrsc extension
  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] 7+ messages in thread

end of thread, other threads:[~2025-09-18 12:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02  8:19 [PATCH v2 0/3] Support SMP on RISC-V cores with Zalrsc only Yao Zi
2025-09-02  8:19 ` [PATCH v2 1/3] riscv: Add Kconfig options to distinguish Zaamo and Zalrsc Yao Zi
2025-09-18 12:07   ` Leo Liang
2025-09-02  8:19 ` [PATCH v2 2/3] configs: ibex-ast2700: Explicitly disable Zaamo and Zalrsc extension Yao Zi
2025-09-18 12:07   ` Leo Liang
2025-09-02  8:19 ` [PATCH v2 3/3] riscv: Add a Zalrsc-only alternative for synchronization in start.S Yao Zi
2025-09-18 12:08   ` Leo Liang

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