Skip to content

Commit

Permalink
FIXME: iterating thru the nr of contexts in the plic driver
Browse files Browse the repository at this point in the history
Signed-off-by: Conor Paxton <conor.paxton@microchip.com>
  • Loading branch information
con-pax committed Nov 24, 2023
1 parent 183ae06 commit 2ee7256
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/interrupt_controller/intc_plic.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,14 @@ static int plic_init(const struct device *dev)
mem_addr_t prio_addr = config->prio;
mem_addr_t thres_prio_addr = get_threshold_priority_addr(dev);

/* Ensure that all interrupts are disabled initially */

uint16_t nr_contexts = DT_NUM_IRQS(DT_NODELABEL(plic));
uint16_t adder = 0;

for (uint16_t ab = 0; ab < nr_contexts; ab++) {
adder += ab;
}

for (uint32_t i = 0; i < get_plic_enabled_size(dev); i++) {
sys_write32(0U, en_addr + (i * sizeof(uint32_t)));
}
Expand Down Expand Up @@ -355,7 +362,7 @@ static int plic_init(const struct device *dev)
.trig = PLIC_BASE_ADDR(n) + PLIC_REG_TRIG_TYPE_OFFSET, \
.max_prio = DT_INST_PROP(n, riscv_max_priority), \
.num_irqs = DT_INST_PROP(n, riscv_ndev), \
.irq_config_func = plic_irq_config_func_##n, \
.irq_config_func = plic_irq_config_func_##n \
}; \
PLIC_INTC_IRQ_FUNC_DEFINE(n)

Expand Down

0 comments on commit 2ee7256

Please sign in to comment.