projects
/
platform
/
kernel
/
opensbi-spacemit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f374496
)
lib: sbi: clear pmpcfg.A before setting in pmp_set()
author
Xiang W
<wxjstz@126.com>
Mon, 8 Nov 2021 09:43:03 +0000
(17:43 +0800)
committer
Anup Patel
<anup@brainfault.org>
Fri, 12 Nov 2021 06:49:00 +0000
(12:19 +0530)
We should clear A bits in prot variable before enabling A_NA4 or A_NAPOT.
Signed-off-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
lib/sbi/riscv_asm.c
patch
|
blob
|
history
diff --git
a/lib/sbi/riscv_asm.c
b/lib/sbi/riscv_asm.c
index
25b40cf
..
1642ac6
100644
(file)
--- a/
lib/sbi/riscv_asm.c
+++ b/
lib/sbi/riscv_asm.c
@@
-268,6
+268,7
@@
int pmp_set(unsigned int n, unsigned long prot, unsigned long addr,
return SBI_ENOTSUPP;
/* encode PMP config */
+ prot &= ~PMP_A;
prot |= (log2len == PMP_SHIFT) ? PMP_A_NA4 : PMP_A_NAPOT;
cfgmask = ~(0xffUL << pmpcfg_shift);
pmpcfg = (csr_read_num(pmpcfg_csr) & cfgmask);