Skip to content

Commit 95064ed

Browse files
KennethLiu61Rbb666
authored andcommitted
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 <[email protected]>
1 parent 3790881 commit 95064ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bsp/cvitek/c906_little/board/interrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void plic_init(void)
6363
{
6464
int i;
6565

66-
for (i = 0; i < IRQ_MAX_NR / 4; i = i + 4)
66+
for (i = 0; i < IRQ_MAX_NR * 4; i = i + 4)
6767
{
6868
mmio_write_32(((uintptr_t) PLIC_PRIORITY0 + i), 0);
6969
}

0 commit comments

Comments
 (0)