lib: sbi: Disable interrupt and inhibit counting in M-mode during init
authorAtish Patra <atishp@rivosinc.com>
Fri, 7 Jan 2022 18:54:09 +0000 (10:54 -0800)
committerAnup Patel <anup@brainfault.org>
Fri, 4 Feb 2022 04:40:28 +0000 (10:10 +0530)
commita26dc609df04ca4704873b683ac03855f20b056e
tree47a5f435fc1385bd1302fb85a4f6c7fc5159d2d7
parent3b7c204dcaa58e415ad7451c2a690bb88773abbf
lib: sbi: Disable interrupt and inhibit counting in M-mode during init

Currently, the mhpmevent CSRs are untouched during hart init during
cold/warm boot. Ideally, we should clear out all the bits except
overflow and MINH bit. That is required to disable overflow
interrupt and inhibit counting in M-mode to avoid any spurious
interrupts before perf start.

Signed-off-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_hart.c