[PATCH v2 0/8] Extend irqchip framework for M-mode interrupts

Anup Patel anup at brainfault.org
Sat Mar 21 22:21:33 PDT 2026


On Fri, Feb 13, 2026 at 11:23 AM Anup Patel <anup.patel at oss.qualcomm.com> wrote:
>
> To handle interrupts in M-mode, the OpenSBI irqchip framework
> needs to support:
> 1) Multiple interrupt controllers where each targets a
>    subset of harts
> 2) Hierarchical interrupt controllers (e.g. APLIC + IMSIC)
> 3) Registering handler for hardware interrupt of a
>    particular interrupt controller out of multiple
>    multiple interrupt controllers
>
> The needs to be achieved without over-consuming memory.
>
> These patches can also be found in irqchip_imp_v2 branch
> at: https://github.com/avpatel/opensbi.git
>
> Changes since v1:
>  - Fixed typos in PATCH4 and PATCH5
>  - Improved sbi_irqchip_process() and sbi_irqchip_add_device()
>    based on Samuel's suggestion
>
> Anup Patel (8):
>   lib: sbi_irqchip: Use chip as variable name for irqchip device
>   lib: sbi_irqchip: Rename irq_handle() callback to process_hwirqs()
>   lib: utils/irqchip: Fix context_map init in
>     irqchip_plic_update_context_map()
>   lib: utils/irqchip: Add IDC to hartindex map in struct aplic_data
>   lib: sbi_irqchip: Support irqchip device targetting subset of harts
>   lib: utils/irqchip: Add unique_id to plic, aplic, and imsic data
>   lib: sbi_irqchip: Associate 32-bit unique ID for each irqchip device
>   lib: sbi_irqchip: Allow registering interrupt handlers
>
>  include/sbi/sbi_irqchip.h                |  74 +++++-
>  include/sbi_utils/irqchip/aplic.h        |   2 +
>  include/sbi_utils/irqchip/imsic.h        |   1 +
>  include/sbi_utils/irqchip/plic.h         |   1 +
>  lib/sbi/sbi_irqchip.c                    | 281 +++++++++++++++++++++--
>  lib/utils/fdt/fdt_helper.c               |   3 +
>  lib/utils/irqchip/aplic.c                |  14 +-
>  lib/utils/irqchip/fdt_irqchip_aplic.c    |  54 ++++-
>  lib/utils/irqchip/fdt_irqchip_plic.c     |   5 +
>  lib/utils/irqchip/imsic.c                |  19 +-
>  lib/utils/irqchip/plic.c                 |   7 +-
>  platform/generic/openhwgroup/ariane.c    |   1 +
>  platform/generic/openhwgroup/openpiton.c |   1 +
>  platform/kendryte/k210/platform.c        |   1 +
>  platform/nuclei/ux600/platform.c         |   1 +
>  platform/template/platform.c             |   1 +
>  16 files changed, 437 insertions(+), 29 deletions(-)
>

Applied this series to the riscv/opensbi repo.

Regards,
Anup



More information about the opensbi mailing list