mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
lib: utils/irqchip: plic: Provide a hartindex to context map
This removes platform-specific arguments to plic_warm_irqchip_init(), which makes the driver independent from the platform after cold init, and allows for further refactoring. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
c26e3fd2ed
commit
69448a0790
@@ -66,6 +66,9 @@ static struct plic_data plic = {
|
||||
.addr = UX600_PLIC_ADDR,
|
||||
.size = UX600_PLIC_SIZE,
|
||||
.num_src = UX600_PLIC_NUM_SOURCES,
|
||||
.context_map = {
|
||||
[0] = { 0, -1 },
|
||||
},
|
||||
};
|
||||
|
||||
static struct aclint_mswi_data mswi = {
|
||||
@@ -190,7 +193,6 @@ static int ux600_final_init(bool cold_boot)
|
||||
static int ux600_irqchip_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
u32 hartid = current_hartid();
|
||||
|
||||
if (cold_boot) {
|
||||
rc = plic_cold_irqchip_init(&plic);
|
||||
@@ -198,8 +200,7 @@ static int ux600_irqchip_init(bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return plic_warm_irqchip_init(&plic, (hartid) ? (2 * hartid - 1) : 0,
|
||||
(hartid) ? (2 * hartid) : -1);
|
||||
return plic_warm_irqchip_init(&plic);
|
||||
}
|
||||
|
||||
static int ux600_ipi_init(void)
|
||||
|
Reference in New Issue
Block a user