mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
lib: utils: Allow PLIC functions to be used for multiple PLICs
We extend all PLIC functions to have a "struct plic_data *" parameter pointing to PLIC details. This allows platforms to use these functions for multiple PLIC instances. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
@@ -15,13 +15,14 @@
|
||||
#include <sbi_utils/irqchip/fdt_irqchip.h>
|
||||
#include <sbi_utils/irqchip/plic.h>
|
||||
|
||||
static struct plic_data plic;
|
||||
static int plic_hartid2context[SBI_HARTMASK_MAX_BITS][2];
|
||||
|
||||
static int irqchip_plic_warm_init(void)
|
||||
{
|
||||
u32 hartid = current_hartid();
|
||||
|
||||
return plic_warm_irqchip_init(plic_hartid2context[hartid][0],
|
||||
return plic_warm_irqchip_init(&plic, plic_hartid2context[hartid][0],
|
||||
plic_hartid2context[hartid][1]);
|
||||
}
|
||||
|
||||
@@ -77,13 +78,12 @@ static int irqchip_plic_cold_init(void *fdt, int nodeoff,
|
||||
const struct fdt_match *match)
|
||||
{
|
||||
int rc;
|
||||
struct platform_plic_data plic;
|
||||
|
||||
rc = fdt_parse_plic_node(fdt, nodeoff, &plic);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = plic_cold_irqchip_init(plic.addr, plic.num_src);
|
||||
rc = plic_cold_irqchip_init(&plic);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
|
Reference in New Issue
Block a user