Skip to content

Commit

Permalink
mpfs_head.S: Simplify clearing PMP
Browse files Browse the repository at this point in the history
Initially clear PMP for all harts, this fixes random warm reset issues.

Signed-off-by: Ville Juven <[email protected]>
  • Loading branch information
pussuw authored and xiaoxiang781216 committed Oct 17, 2023
1 parent 4952533 commit 0e75e53
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions arch/risc-v/src/mpfs/mpfs_head.S
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ __start:
.option pop

#ifdef CONFIG_MPFS_BOOTLOADER
/* Clear PMP */

csrw pmpcfg0, zero
csrw pmpcfg2, zero

/* Set all but the boot hart into wfi */

Expand Down Expand Up @@ -175,11 +179,6 @@ __start:
sd x0, 0(a4)
add a4, a4, 8
blt a4, a5, .clear_l2lim

/* Clear PMP */

csrw pmpcfg0, zero
csrw pmpcfg2, zero
#endif

/* Set stack pointer to the idle thread stack */
Expand Down

0 comments on commit 0e75e53

Please sign in to comment.