浏览代码

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 <kenneth.liu@sophgo.com>
kenneth.liu 4 月之前
父节点
当前提交
95064ed449
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      bsp/cvitek/c906_little/board/interrupt.c

+ 1 - 1
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);
     }