This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 0e75e53cc8 mpfs_head.S: Simplify clearing PMP
0e75e53cc8 is described below

commit 0e75e53cc8da9777d874f754c02518d2d88923da
Author: Ville Juven <ville.ju...@unikie.com>
AuthorDate: Wed Oct 11 16:37:29 2023 +0300

    mpfs_head.S: Simplify clearing PMP
    
    Initially clear PMP for all harts, this fixes random warm reset issues.
    
    Signed-off-by: Ville Juven <ville.ju...@unikie.com>
---
 arch/risc-v/src/mpfs/mpfs_head.S | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/risc-v/src/mpfs/mpfs_head.S b/arch/risc-v/src/mpfs/mpfs_head.S
index 465cf1f0f6..50dd270922 100644
--- a/arch/risc-v/src/mpfs/mpfs_head.S
+++ b/arch/risc-v/src/mpfs/mpfs_head.S
@@ -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 */
 
@@ -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 */

Reply via email to