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

Signed-off-by: Anirudh Srinivasan <[email protected]>
---
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,
--  
Anirudh Srinivasan <[email protected]>

Reply via email to