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

commit 7d30afa5893a885e90c304e359d03117dbafe403
Author: hujun5 <[email protected]>
AuthorDate: Tue Jul 8 16:17:07 2025 +0800

    arm64: enable mpu background region
    
    Enable SCTLR_EL1.BR bit to activate MPU background region support. This 
simplifies MPU
    configuration by providing a default MAIR attribute for unmapped regions, 
reducing the
    need for exhaustive region coverage and improving MPU flexibility.
    
    Signed-off-by: hujun5 <[email protected]>
---
 arch/arm64/src/common/arm64_arch.h | 1 +
 arch/arm64/src/common/arm64_mpu.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm64/src/common/arm64_arch.h 
b/arch/arm64/src/common/arm64_arch.h
index abf7a472d69..fa891ae6361 100644
--- a/arch/arm64/src/common/arm64_arch.h
+++ b/arch/arm64/src/common/arm64_arch.h
@@ -97,6 +97,7 @@
 #define SCTLR_C_BIT         BIT(2)
 #define SCTLR_SA_BIT        BIT(3)
 #define SCTLR_I_BIT         BIT(12)
+#define SCTLR_BR_BIT        BIT(17)
 
 /* Controls the impact of tag check faults
  * due to loads and stores in EL0 EL1.
diff --git a/arch/arm64/src/common/arm64_mpu.c 
b/arch/arm64/src/common/arm64_mpu.c
index e9cd12e44f9..35bed5c0bc1 100644
--- a/arch/arm64/src/common/arm64_mpu.c
+++ b/arch/arm64/src/common/arm64_mpu.c
@@ -222,6 +222,7 @@ void arm64_mpu_enable(void)
 #ifndef CONFIG_ARM64_DCACHE_DISABLE
           | SCTLR_C_BIT
 #endif
+          | SCTLR_BR_BIT             /* Background region enable */
          );
   write_sysreg(val, sctlr_el1);
   UP_MB();

Reply via email to