aboutsummaryrefslogtreecommitdiff
path: root/lib/utils/fdt
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-05-12 12:57:52 +0530
committerAnup Patel <anup@brainfault.org>2020-05-23 10:36:29 +0530
commit446a9c6d1eb97fcedd6a94ac76d15e941a6087a8 (patch)
treeb8b8d6e8fec3fb2caf01913b0f2139c4f8695846 /lib/utils/fdt
parent73d6ef3b2933ccf0b3a8a0ba110bf53ad9720b51 (diff)
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>
Diffstat (limited to 'lib/utils/fdt')
-rw-r--r--lib/utils/fdt/fdt_helper.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c
index ee733e7..61d70d9 100644
--- a/lib/utils/fdt/fdt_helper.c
+++ b/lib/utils/fdt/fdt_helper.c
@@ -12,6 +12,7 @@
#include <sbi/sbi_platform.h>
#include <sbi/sbi_scratch.h>
#include <sbi_utils/fdt/fdt_helper.h>
+#include <sbi_utils/irqchip/plic.h>
#define DEFAULT_UART_FREQ 0
#define DEFAULT_UART_BAUD 115200
@@ -259,8 +260,7 @@ int fdt_parse_uart8250(void *fdt, struct platform_uart_data *uart,
return fdt_parse_uart8250_node(fdt, nodeoffset, uart);
}
-int fdt_parse_plic_node(void *fdt, int nodeoffset,
- struct platform_plic_data *plic)
+int fdt_parse_plic_node(void *fdt, int nodeoffset, struct plic_data *plic)
{
int len, rc;
const fdt32_t *val;
@@ -281,15 +281,14 @@ int fdt_parse_plic_node(void *fdt, int nodeoffset,
return 0;
}
-int fdt_parse_plic(void *fdt, struct platform_plic_data *plic,
- const char *compatible)
+int fdt_parse_plic(void *fdt, struct plic_data *plic, const char *compat)
{
int nodeoffset;
- if (!compatible || !plic || !fdt)
+ if (!compat || !plic || !fdt)
return SBI_ENODEV;
- nodeoffset = fdt_node_offset_by_compatible(fdt, -1, compatible);
+ nodeoffset = fdt_node_offset_by_compatible(fdt, -1, compat);
if (nodeoffset < 0)
return nodeoffset;