From 95064ed44900815a9ef823bfbeb29768d9acb46a Mon Sep 17 00:00:00 2001 From: "kenneth.liu" Date: Fri, 3 Jan 2025 20:47:02 +0800 Subject: [PATCH] bsp: cvitek: fix bug in setting PLIC_PRIORITY[n] description: In the bsp/cvitek/c906_little/board/interrupt.c, There is an issue with setting the PLIC_PRIORITY[n]. analysis: PLIC_PRIORITY[n] each register corresponds to the priority of a hardware interrupt number. Solution: Each register is 4 bytes. Multiply the total number of IRQs by 4 instead of dividing by 4. Signed-off-by: Liu Gui --- bsp/cvitek/c906_little/board/interrupt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/cvitek/c906_little/board/interrupt.c b/bsp/cvitek/c906_little/board/interrupt.c index 9a6625cf25f..49a23662118 100755 --- a/bsp/cvitek/c906_little/board/interrupt.c +++ b/bsp/cvitek/c906_little/board/interrupt.c @@ -63,7 +63,7 @@ void plic_init(void) { int i; - for (i = 0; i < IRQ_MAX_NR / 4; i = i + 4) + for (i = 0; i < IRQ_MAX_NR * 4; i = i + 4) { mmio_write_32(((uintptr_t) PLIC_PRIORITY0 + i), 0); }