On Wed, Mar 6, 2019 at 6:54 AM Lukas Auer <lukas.a...@aisec.fraunhofer.de> wrote: > > Harts on RISC-V boot independently, U-Boot is responsible for managing > them. Functions are called on other harts with smp_call_function(), > which sends inter-processor interrupts (IPIs) to all other available > harts. Available harts are those marked as available in the device tree > and present in the available_harts mask stored in global data. The > available_harts mask is used to register all harts that have entered > U-Boot. Functions are specified with their address and two function > arguments (argument 2 and 3). The first function argument is always the > hart ID of the hart calling the function. On the other harts, the IPI > interrupt handler handle_ipi() must be called on software interrupts to > handle the request and call the specified function. > > Functions are stored in the ipi_data data structure. Every hart has its > own data structure in global data. While this is not required at the > moment (all harts are expected to boot Linux), this does allow future > expansion, where other harts may be used for monitoring or other tasks. > > Signed-off-by: Lukas Auer <lukas.a...@aisec.fraunhofer.de> > --- > > Changes in v2: > - Remove unneeded quotes from NR_CPUS Kconfig entry > - Move memory barrier from send_ipi_many() to handle_ipi() > - Add check in send_ipi_many so that IPIs are only sent to available > harts as indicated by the available_harts mask > > arch/riscv/Kconfig | 19 +++++ > arch/riscv/include/asm/global_data.h | 6 ++ > arch/riscv/include/asm/smp.h | 53 ++++++++++++ > arch/riscv/lib/Makefile | 1 + > arch/riscv/lib/smp.c | 116 +++++++++++++++++++++++++++ > 5 files changed, 195 insertions(+) > create mode 100644 arch/riscv/include/asm/smp.h > create mode 100644 arch/riscv/lib/smp.c >
Reviewed-by: Bin Meng <bmeng...@gmail.com> Tested-by: Bin Meng <bmeng...@gmail.com> _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot