lib: sbi_irqchip: Support irqchip device targetting subset of harts

It is possible to have platform where an irqchip device targets
a subset of harts and there are multiple irqchip devices to cover
all harts.

To support this scenario:
1) Add target_harts hartmask to struct sbi_irqchip_device which
   represents the set of harts targetted by the irqchip device
2) Call warm_init() and process_hwirqs() callbacks of an irqchip
   device on a hart only if irqchip device targets that particular
   hart

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260213055342.3124872-6-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Anup Patel
2026-02-13 11:23:39 +05:30
committed by Anup Patel
parent 5a300b32d5
commit b55bb4cdcb
5 changed files with 74 additions and 23 deletions

View File

@@ -297,8 +297,18 @@ int aplic_cold_irqchip_init(struct aplic_data *aplic)
return rc;
}
if (aplic->num_idc) {
for (i = 0; i < aplic->num_idc; i++)
sbi_hartmask_set_hartindex(aplic->idc_map[i],
&aplic->irqchip.target_harts);
} else {
sbi_hartmask_set_all(&aplic->irqchip.target_harts);
}
/* Register irqchip device */
sbi_irqchip_add_device(&aplic->irqchip);
rc = sbi_irqchip_add_device(&aplic->irqchip);
if (rc)
return rc;
/* Attach to the aplic list */
sbi_list_add_tail(&aplic->node, &aplic_list);