diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-05-12 07:44:43 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-05-23 08:06:26 +0300 |
commit | 73d6ef3b2933ccf0b3a8a0ba110bf53ad9720b51 (patch) | |
tree | baa3468336030b1680162ed4e31d3a3fa6d89179 /lib/utils | |
parent | 89ba63493c4ce98861144180e408d6db391fd1c3 (diff) | |
download | opensbi-73d6ef3b2933ccf0b3a8a0ba110bf53ad9720b51.tar.xz |
lib: utils: Remove redundant parameters from PLIC init functions
The "target_hart" and "hart_count" parameters of PLIC cold and
warm init functions are only used for sanity checks and not
required in PLIC initialization.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/irqchip/fdt_irqchip_plic.c | 10 | ||||
-rw-r--r-- | lib/utils/irqchip/plic.c | 9 |
2 files changed, 4 insertions, 15 deletions
diff --git a/lib/utils/irqchip/fdt_irqchip_plic.c b/lib/utils/irqchip/fdt_irqchip_plic.c index 5bac6a7..11ed300 100644 --- a/lib/utils/irqchip/fdt_irqchip_plic.c +++ b/lib/utils/irqchip/fdt_irqchip_plic.c @@ -21,8 +21,7 @@ static int irqchip_plic_warm_init(void) { u32 hartid = current_hartid(); - return plic_warm_irqchip_init(hartid, - plic_hartid2context[hartid][0], + return plic_warm_irqchip_init(plic_hartid2context[hartid][0], plic_hartid2context[hartid][1]); } @@ -78,18 +77,13 @@ static int irqchip_plic_cold_init(void *fdt, int nodeoff, const struct fdt_match *match) { int rc; - u32 max_hartid; struct platform_plic_data plic; - rc = fdt_parse_max_hart_id(fdt, &max_hartid); - if (rc) - return rc; - rc = fdt_parse_plic_node(fdt, nodeoff, &plic); if (rc) return rc; - rc = plic_cold_irqchip_init(plic.addr, plic.num_src, max_hartid + 1); + rc = plic_cold_irqchip_init(plic.addr, plic.num_src); if (rc) return rc; diff --git a/lib/utils/irqchip/plic.c b/lib/utils/irqchip/plic.c index 7c40d28..8975729 100644 --- a/lib/utils/irqchip/plic.c +++ b/lib/utils/irqchip/plic.c @@ -20,7 +20,6 @@ #define PLIC_CONTEXT_BASE 0x200000 #define PLIC_CONTEXT_STRIDE 0x1000 -static u32 plic_hart_count; static u32 plic_num_sources; static volatile void *plic_base; @@ -45,13 +44,10 @@ void plic_set_ie(u32 cntxid, u32 word_index, u32 val) writel(val, plic_ie + word_index * 4); } -int plic_warm_irqchip_init(u32 target_hart, int m_cntx_id, int s_cntx_id) +int plic_warm_irqchip_init(int m_cntx_id, int s_cntx_id) { size_t i, ie_words = plic_num_sources / 32 + 1; - if (plic_hart_count <= target_hart) - return -1; - /* By default, disable all IRQs for M-mode of target HART */ if (m_cntx_id > -1) { for (i = 0; i < ie_words; i++) @@ -75,11 +71,10 @@ int plic_warm_irqchip_init(u32 target_hart, int m_cntx_id, int s_cntx_id) return 0; } -int plic_cold_irqchip_init(unsigned long base, u32 num_sources, u32 hart_count) +int plic_cold_irqchip_init(unsigned long base, u32 num_sources) { int i; - plic_hart_count = hart_count; plic_num_sources = num_sources; plic_base = (void *)base; |