From 446a9c6d1eb97fcedd6a94ac76d15e941a6087a8 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Tue, 12 May 2020 12:57:52 +0530 Subject: 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 Reviewed-by: Atish Patra --- platform/nuclei/ux600/platform.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'platform/nuclei') diff --git a/platform/nuclei/ux600/platform.c b/platform/nuclei/ux600/platform.c index 914cf99..f999c99 100644 --- a/platform/nuclei/ux600/platform.c +++ b/platform/nuclei/ux600/platform.c @@ -43,6 +43,11 @@ /* clang-format on */ +static struct plic_data plic = { + .addr = UX600_PLIC_ADDR, + .num_src = UX600_PLIC_NUM_SOURCES, +}; + static void ux600_modify_dt(void *fdt) { fdt_fixups(fdt); @@ -73,13 +78,12 @@ static int ux600_irqchip_init(bool cold_boot) u32 hartid = current_hartid(); if (cold_boot) { - rc = plic_cold_irqchip_init(UX600_PLIC_ADDR, - UX600_PLIC_NUM_SOURCES); + rc = plic_cold_irqchip_init(&plic); if (rc) return rc; } - return plic_warm_irqchip_init((hartid) ? (2 * hartid - 1) : 0, + return plic_warm_irqchip_init(&plic, (hartid) ? (2 * hartid - 1) : 0, (hartid) ? (2 * hartid) : -1); } -- cgit v1.1