lib: sbi_irqchip: Add support for registering MSI handlers

Some of the drivers (such as APLIC) require capability to registers
MSI handlers from the parent interrupt controller (such as IMSIC)
so add sbi_irqchip_register_msi_handler() for this purpose.

Link: https://lore.kernel.org/r/20260423052339.356900-7-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Anup Patel
2026-04-23 10:53:39 +05:30
committed by Anup Patel
parent c0d0dd02b1
commit 79e63bc834
2 changed files with 88 additions and 2 deletions
+19
View File
@@ -16,6 +16,13 @@
struct sbi_scratch;
/** irqchip message signalled interrupt (MSI) */
struct sbi_irqchip_msi_msg {
u32 address_lo;
u32 address_hi;
u32 data;
};
/** irqchip hardware device */
struct sbi_irqchip_device {
/** Node in the list of irqchip devices (private) */
@@ -109,6 +116,18 @@ int sbi_irqchip_get_affinity(struct sbi_irqchip_device *chip, u32 hwirq,
/** Set hardware interrupt affinity */
int sbi_irqchip_set_affinity(struct sbi_irqchip_device *chip, u32 hwirq, u32 hart_index);
/** Write MSI message to the hardware interrupt handler */
int sbi_irqchip_write_msi(struct sbi_irqchip_device *chip, u32 hwirq,
const struct sbi_irqchip_msi_msg *msg);
/** Register a hardware MSI handler */
int sbi_irqchip_register_msi(struct sbi_irqchip_device *chip, u32 num_hwirq,
void (*write_msi)(u32 hwirq,
const struct sbi_irqchip_msi_msg *msg,
void *priv),
int (*callback)(u32 hwirq, void *priv), void *priv,
u32 *out_first_hwirq);
/** Register a hardware interrupt handler */
int sbi_irqchip_register_handler(struct sbi_irqchip_device *chip,
u32 first_hwirq, u32 num_hwirq, u32 hwirq_flags,