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-zi...@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