File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
arch/arm/core/aarch32/cortex_m Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 1919#include <sys/util.h>
2020#include <arch/arm/aarch32/cortex_m/cmsis.h>
2121#include <linker/linker-defs.h>
22+
23+ #if defined(CONFIG_CPU_HAS_NXP_MPU )
24+ #include <fsl_sysmpu.h>
25+ #endif
26+
2227/**
2328 *
2429 * @brief Reset the system
@@ -55,7 +60,21 @@ void z_arm_clear_arm_mpu_config(void)
5560 ARM_MPU_ClrRegion (i );
5661 }
5762}
58- #endif /* CONFIG_CPU_HAS_ARM_MPU */
63+ #elif CONFIG_CPU_HAS_NXP_MPU
64+ void z_arm_clear_arm_mpu_config (void )
65+ {
66+ int i ;
67+
68+ int num_regions = FSL_FEATURE_SYSMPU_DESCRIPTOR_COUNT ;
69+
70+ SYSMPU_Enable (SYSMPU , false);
71+
72+ /* NXP MPU region 0 is reserved for the debugger */
73+ for (i = 1 ; i < num_regions ; i ++ ) {
74+ SYSMPU_RegionEnable (SYSMPU , i , false);
75+ }
76+ }
77+ #endif /* CONFIG_CPU_HAS_NXP_MPU */
5978
6079#if defined(CONFIG_INIT_ARCH_HW_AT_BOOT )
6180/**
@@ -78,7 +97,7 @@ void z_arm_init_arch_hw_at_boot(void)
7897
7998 /* Initialize System Control Block components */
8099
81- #if defined(CONFIG_CPU_HAS_ARM_MPU )
100+ #if defined(CONFIG_CPU_HAS_ARM_MPU ) || defined( CONFIG_CPU_HAS_NXP_MPU )
82101 /* Clear MPU region configuration */
83102 z_arm_clear_arm_mpu_config ();
84103#endif /* CONFIG_CPU_HAS_ARM_MPU */
You can’t perform that action at this time.
0 commit comments