Skip to content

Commit

Permalink
IRQ Claim OK yay! riscv_dispatch_irq: claim=0x14
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Dec 5, 2023
1 parent e982d00 commit ea6ca0c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/risc-v/src/jh7110/jh7110_irq_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ void *riscv_dispatch_irq(uintptr_t vector, uintptr_t *regs)
uintptr_t val = getreg32(JH7110_PLIC_CLAIM);

//// Begin Test
_info("claim=%p\n", val);
#ifdef NOTUSED
if (val == 0) { // If Interrupt Claimed is 0...
// Check Pending Interrupts
uintptr_t ip0 = getreg32(0xe0001000); // PLIC_IP0: Interrupt Pending for interrupts 1 to 31
Expand All @@ -71,6 +73,7 @@ void *riscv_dispatch_irq(uintptr_t vector, uintptr_t *regs)
// _info("rx=%p\n", rx);
}
}
#endif // NOTUSED
//// End Test

/* Add the value to nuttx irq which is offset to the mext */
Expand All @@ -96,13 +99,15 @@ void *riscv_dispatch_irq(uintptr_t vector, uintptr_t *regs)

putreg32(irq - RISCV_IRQ_EXT, JH7110_PLIC_CLAIM);

#ifdef NOTUSED
//// Begin Test
// Clear Pending Interrupts
putreg32(0, 0xe0001000); // PLIC_IP0: Interrupt Pending for interrupts 1 to 31
putreg32(0, 0xe0001004); // PLIC_IP1: Interrupt Pending for interrupts 32 to 63
_info("Clear Pending Interrupts, irq=%d, claim=%p\n", irq, claim);
infodumpbuffer("PLIC Interrupt Pending", 0xe0001000, 2 * 4);
//// End Test
#endif // NOTUSED
}

return regs;
Expand Down

0 comments on commit ea6ca0c

Please sign in to comment.