Skip to content

riscv: Add support for M-mode IPIs using IMSIC

Anirudh Srinivasan u-boot 1 version In review

Get series with b4
b4 am [email protected] change-id 20261105-mimsic_ipi-d6df81eebbce

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2riscv: move ACLINT MSWI based IPIs to separate Kconfig symbolarch/riscv/Kconfig arch/riscv/cpu/fu540/Kconfig arch/riscv/cpu/fu740/Kconfig +7 more+24 -10 replies
2/2riscv: Add driver for M-mode IPIs using M-mode IMSICarch/riscv/Kconfig arch/riscv/cpu/start.S arch/riscv/include/asm/csr.h +4 more+169 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/2] riscv: Add support for M-mode IPIs using IMSIC

U-boot currently supports M-mode IPIs using the ACLINT MSWI device. This series extends U-boot to support IPIs using the M-mode IMSIC present on chips implementing AIA. The ACLINT spec was never ratified [1][2] as chips with AIA use the M-IMSIC for IPIs instead of the ACLINT MSWI. One such example is Tenstorrent Atlantis, which does not implement the ACLINT MSWI.

The IMSIC based IPI driver has been kept simple here and supports systems with contiugous hart IDs from 0 and a single IMSIC register region. While more complex IMSIC register layouts and hart ID numbering is possible (OpenSBI and Linux support these), existing hardware out there implementing AIA do not support these (Spacemit K3, Tenstorrent Atlantis and the QEMU Virt machine's default AIA config with a single socket).

This series can be tested by enabling AIA in the riscv machine (-M virt,aia=aplic-imsic), switching qemu-riscv64_spl_defconfig to use M-IMSIC for IPIs like this

sed -i 's/ACLINT_IPI/MIMSIC_IPI/g' arch/riscv/cpu/generic/Kconfig

One question I had is whether I should add a new defconfig that tests this, so that it can be run in CI.

[1] https://github.com/riscvarchive/riscv-aclint/blob/4e570bfd3201f2c09e5afd290b5091526b0f099a/riscv-aclint.adoc
[2] https://lists.riscv.org/g/tech-aia/topic/connections_between_aia_and/107177435

---
Anirudh Srinivasan (2):
riscv: move ACLINT MSWI based IPIs to separate Kconfig symbol
riscv: Add driver for M-mode IPIs using M-mode IMSIC

 arch/riscv/Kconfig                   |  28 ++++++++++
 arch/riscv/cpu/fu540/Kconfig         |   1 +
 arch/riscv/cpu/fu740/Kconfig         |   1 +
 arch/riscv/cpu/generic/Kconfig       |   2 +
 arch/riscv/cpu/jh7110/Kconfig        |   1 +
 arch/riscv/cpu/k1/Kconfig            |   2 +
 arch/riscv/cpu/start.S               |  32 +++++++++++
 arch/riscv/cpu/th1520/Kconfig        |   2 +
 arch/riscv/include/asm/csr.h         |  11 ++++
 arch/riscv/include/asm/global_data.h |   5 ++
 arch/riscv/include/asm/syscon.h      |   1 +
 arch/riscv/lib/Makefile              |   3 +-
 arch/riscv/lib/mimsic_ipi.c          | 103 +++++++++++++++++++++++++++++++++++
 board/openpiton/riscv64/Kconfig      |   1 +
 board/sipeed/maix/Kconfig            |   1 +
 15 files changed, 193 insertions(+), 1 deletion(-)

---
base-commit: d1d45c926a571fb6c1e6d7105c280833646915ea
change-id: 20261105-mimsic_ipi-d6df81eebbce

Best regards,

Signature · 1 line
Anirudh Srinivasan <[email protected]>