summaryrefslogtreecommitdiff
path: root/include/sbi_utils/ipi
AgeCommit message (Collapse)Author
2025-09-16lib: utils/ipi: Convert IPI drivers as early driversAnup Patel
The fdt_ipi_init() is already called from generic_early_init() so let's convert IPI drivers as early drivers. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Samuel Holland <[email protected]> Tested-by: Nick Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2024-11-28lib: utils/ipi: Use fdt_driver for initializationSamuel Holland
The ipi driver subsystem does not need any extra data, so it can use `struct fdt_driver` directly. The generic fdt_ipi_init() performs a best-effort initialization of all matching DT nodes. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-11-11platform: Drop IPI warm init and exit hooksSamuel Holland
Now that the SBI IPI core clears IPIs at warm boot in a generic way, none of the drivers or platforms use these hooks, and we can remove them. Platforms need only to initialize the driver once during cold init. If other hooks are needed in the future, they can be added to struct sbi_ipi_device. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-11-11lib: sbi_ipi: Move initial IPI clear to sbi_ipi_init()Samuel Holland
sbi_ipi_init() expects the platform warm init function to clear IPIs on the local hart, but there is already a generic function to do this. After this change, none of the existing drivers need a warm init callback. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-08-24lib: utils/ipi: Constify FDT pointers in parsing functionsSamuel Holland
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-12-06lib: ipi: Adjust Andes PLICSW to single-bit-per-hart schemeLeo Yu-Chi Liang
The old scheme doesn't allow sending hart0 self-IPI as the corresponding bit on pending register is hardwired to 0, this could lead to unhandle IPIs on SMP systems, esp. on single-core. Furthermore, the limitation of old scheme is 8-core, instead of reserving source hart information, we assign bit (x + 1) as the enable and pending bit of hartx, this also expands the bootable hart number. The following diagram shows the enable bits of the new scheme on 32-core Andes platform. Pending regs: 0x1000 x---0---0---0---0------0---0 Pending hart ID: 0 1 2 3 ... 30 31 Interrupt ID: 0 1 2 3 4 ... 31 32 | | | | | | | Enable regs: 0x2000 x---1---0---0---0-...--0---0---> hart0 | | | | | | | 0x2080 x---0---1---0---0-...--0---0---> hart1 | | | | | | | 0x2100 x---0---0---1---0-...--0---0---> hart2 | | | | | | | 0x2180 x---0---0---0---1-...--0---0---> hart3 . . . . . . . . . . . . . . . . . . . . . 0x2f00 x---0---0---0---0-...--1---0---> hart30 | | | | | | | 0x2f80 x---0---0---0---0-...--0---1---> hart31 <-------- word 0 -------><--- word 1 ---> To send IPI to hart0, for example, another hart (including hart0 itself) will set bit 1 of first word on the pending register. We also fix indentation in andes_plicsw.h along with this patch. Fixes: ce7c490719ed ("lib: utils/ipi: Add Andes fdt ipi driver support") Signed-off-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Randolph <[email protected]> Reported-by: Lad Prabhakar <[email protected]> Link: https://lists.infradead.org/pipermail/opensbi/2023-October/005665.html Reviewed-by: Lad Prabhakar <[email protected]> Tested-by: Lad Prabhakar <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2022-10-23lib: utils/ipi: Add Andes fdt ipi driver supportYu Chien Peter Lin
Move Andes PLICSW ipi device to fdt ipi framework, this patch is based on Leo's modified IPI scheme on PLICSW. Current IPI scheme uses bit 0 of pending reigster on PLICSW to send IPI from hart 0 to hart 7, but bit 0 needs to be hardwired to 0 according to spec. After some investigation, self-IPI seems to be seldom or never used, so we re-order the IPI scheme to support 8 core platforms. dts example (Quad-core AX45MP): plicsw: interrupt-controller@e6400000 { compatible = "andestech,plicsw"; reg = <0x00000000 0xe6400000 0x00000000 0x00400000>; interrupts-extended = <&CPU0_intc 3 &CPU1_intc 3 &CPU2_intc 3 &CPU3_intc 3>; interrupt-controller; #address-cells = <2>; #interrupt-cells = <2>; }; Signed-off-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2022-08-08lib: utils/ipi: Use kconfig for enabling/disabling driversAnup Patel
We update ipi drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate ipi drivers for each platform. Signed-off-by: Anup Patel <[email protected]> Tested-by: Andrew Jones <[email protected]> Acked-by: Atish Patra <[email protected]> Tested-by: Atish Patra <[email protected]>
2021-06-24lib: utils/ipi: Add ACLINT MSWI libraryAnup Patel
We add common ACLINT MSWI library similar to the CLINT library so that OpenSBI platforms can use it. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: Xiang W <[email protected]>
2021-04-28lib: sbi: Simplify ipi platform operationsAnup Patel
Instead of having ipi_send() and ipi_clear() callbacks in platform operations, it will be much simpler for ipi driver to directly register these operations as a device to sbi_ipi implementation. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Alistair Francis <[email protected]>
2020-05-01lib: utils: Add simple FDT ipi frameworkAnup Patel
We add simple ipi framework which will select and use ipi driver based on details in FDT passed by previous booting stage. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>