Skip to content

Commit

Permalink
arch: riscv: Add support for custom IPI implementation
Browse files Browse the repository at this point in the history
Allow RISCV implementation to define its own custom IPI
implementation (e.g. Andes usage of PLIC for IPI)

Signed-off-by: Maxim Adelman <[email protected]
  • Loading branch information
Maxim Adelman committed Nov 27, 2023
1 parent a43e516 commit d82ffcb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions arch/riscv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ config RISCV_SOC_HAS_CUSTOM_SYS_IO
the RISC-V SoC needs to do something different and more than reading and
writing the registers.

config RISCV_SOC_HAS_CUSTOM_SMP_IPI
bool
select SCHED_IPI_SUPPORTED
help
Hidden option to allow SoC to overwrite SMP IPI implementation
Enable this hidden option and implement arch_sched_ipi()

config RISCV_SOC_CONTEXT_SAVE
bool "SOC-based context saving in IRQ handlers"
select RISCV_SOC_OFFSETS
Expand Down
3 changes: 2 additions & 1 deletion arch/riscv/core/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ void z_riscv_secondary_cpu_init(int hartid)
riscv_cpu_init[cpu_num].fn(riscv_cpu_init[cpu_num].arg);
}

#ifdef CONFIG_SMP
/* IPI */
#if defined(CONFIG_SMP) && !defined(CONFIG_RISCV_SOC_HAS_CUSTOM_SMP_IPI)

#define MSIP(hartid) ((volatile uint32_t *)RISCV_MSIP_BASE)[hartid]

Expand Down

0 comments on commit d82ffcb

Please sign in to comment.