arch/riscv: fix PMP in sbi_start()

This fixes PMP setting for open everything before going S-mode, which
has been broken since pull/12398.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
Yanfeng Liu 2024-06-28 10:45:35 +08:00 committed by Xiang Xiao
parent 13bbea0f1c
commit 28eaa08cbc

View File

@ -32,6 +32,12 @@
#include "sbi_internal.h"
/****************************************************************************
* Preprocecssor definitions
****************************************************************************/
#define NAPOT_OPENALL (PMPCFG_A_NAPOT | PMPCFG_RWX_MASK)
/****************************************************************************
* Private Functions
****************************************************************************/
@ -119,7 +125,7 @@ void sbi_start(void)
/* Open everything for PMP */
riscv_append_pmp_region(PMPCFG_A_NAPOT | PMPCFG_RWX_MASK, 0, -1);
DEBUGASSERT(riscv_append_pmp_region(NAPOT_OPENALL, 0, 0) == 0);
/* Then jump to the S-mode start function */