Skip to content

Commit

Permalink
arch/riscv: fix PMP in sbi_start()
Browse files Browse the repository at this point in the history
This fixes PMP setting for open everything before going S-mode, which
has been broken since pull/12398.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 authored and xiaoxiang781216 committed Jul 24, 2024
1 parent 2fa7b9c commit bfd93d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arch/risc-v/src/nuttsbi/sbi_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@

#include "sbi_internal.h"

/****************************************************************************
* Preprocecssor definitions
****************************************************************************/

#define NAPOT_OPENALL (PMPCFG_A_NAPOT | PMPCFG_RWX_MASK)

/****************************************************************************
* Private Functions
****************************************************************************/
Expand Down Expand Up @@ -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 */

Expand Down

0 comments on commit bfd93d4

Please sign in to comment.