mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00

CSR_PMPADDRn lower bits may read all-0 or all-1, depending on the configuration. For TOR it is all-0, for NAPOT - all-1. Thus if PMP entry was pre-configured as NAPOT, original code would stop scanning because value read back not equal to the written one. Mask lower bits before comparison to fix this Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> Reviewed-by: Anup Patel <anup@brainfault.org>