summaryrefslogtreecommitdiff
path: root/include/sbi_utils
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-05-12 10:27:52 +0300
committerAnup Patel <anup@brainfault.org>2020-05-23 08:06:29 +0300
commit446a9c6d1eb97fcedd6a94ac76d15e941a6087a8 (patch)
treeb8b8d6e8fec3fb2caf01913b0f2139c4f8695846 /include/sbi_utils
parent73d6ef3b2933ccf0b3a8a0ba110bf53ad9720b51 (diff)
downloadopensbi-446a9c6d1eb97fcedd6a94ac76d15e941a6087a8.tar.xz
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 'include/sbi_utils')
-rw-r--r--include/sbi_utils/fdt/fdt_helper.h13
-rw-r--r--include/sbi_utils/irqchip/plic.h14
2 files changed, 14 insertions, 13 deletions
diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h
index 6be942a..42390e8 100644
--- a/include/sbi_utils/fdt/fdt_helper.h
+++ b/include/sbi_utils/fdt/fdt_helper.h
@@ -25,11 +25,6 @@ struct platform_uart_data {
unsigned long reg_io_width;
};
-struct platform_plic_data {
- unsigned long addr;
- unsigned long num_src;
-};
-
const struct fdt_match *fdt_match_node(void *fdt, int nodeoff,
const struct fdt_match *match_table);
@@ -52,11 +47,11 @@ int fdt_parse_uart8250_node(void *fdt, int nodeoffset,
int fdt_parse_uart8250(void *fdt, struct platform_uart_data *uart,
const char *compatible);
-int fdt_parse_plic_node(void *fdt, int nodeoffset,
- struct platform_plic_data *plic);
+struct plic_data;
+
+int fdt_parse_plic_node(void *fdt, int nodeoffset, struct plic_data *plic);
-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 fdt_parse_compat_addr(void *fdt, unsigned long *addr,
const char *compatible);
diff --git a/include/sbi_utils/irqchip/plic.h b/include/sbi_utils/irqchip/plic.h
index 68034be..0e56d80 100644
--- a/include/sbi_utils/irqchip/plic.h
+++ b/include/sbi_utils/irqchip/plic.h
@@ -12,12 +12,18 @@
#include <sbi/sbi_types.h>
-int plic_warm_irqchip_init(int m_cntx_id, int s_cntx_id);
+struct plic_data {
+ unsigned long addr;
+ unsigned long num_src;
+};
-int plic_cold_irqchip_init(unsigned long base, u32 num_sources);
+int plic_warm_irqchip_init(struct plic_data *plic,
+ int m_cntx_id, int s_cntx_id);
-void plic_set_thresh(u32 cntxid, u32 val);
+int plic_cold_irqchip_init(struct plic_data *plic);
-void plic_set_ie(u32 cntxid, u32 word_index, u32 val);
+void plic_set_thresh(struct plic_data *plic, u32 cntxid, u32 val);
+
+void plic_set_ie(struct plic_data *plic, u32 cntxid, u32 word_index, u32 val);
#endif