lib: sbi: Fix PMP address bits detection
authorVasan VS <vasan.vs@gmail.com>
Mon, 8 Nov 2021 04:54:56 +0000 (10:24 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 11 Nov 2021 12:57:53 +0000 (18:27 +0530)
commit31fe5a7a3d80f0ceb25005740313cee1ef3fd4f6
tree1879794074da80210363b7df3ff55806ecb4eca8
parentb8845e420453531f92414b91828c58d6d4f90fff
lib: sbi: Fix PMP address bits detection

We should ensure that pmpcfg0.pmp0cfg is set to zero before using
pmpaddr0 CSR for detecting implemented PMP address bits.

Fixes: bf21632860b4 ("lib: sbi: Detect PMP granularity and number
of address bits")
Signed-off-by: Vasan VS <vasan.vs@gmail.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>
lib/sbi/sbi_hart.c