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 19
19
#include <sys/util.h>
20
20
#include <arch/arm/aarch32/cortex_m/cmsis.h>
21
21
#include <linker/linker-defs.h>
22
+
23
+ #if defined(CONFIG_CPU_HAS_NXP_MPU )
24
+ #include <fsl_sysmpu.h>
25
+ #endif
26
+
22
27
/**
23
28
*
24
29
* @brief Reset the system
@@ -55,7 +60,21 @@ void z_arm_clear_arm_mpu_config(void)
55
60
ARM_MPU_ClrRegion (i );
56
61
}
57
62
}
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 */
59
78
60
79
#if defined(CONFIG_INIT_ARCH_HW_AT_BOOT )
61
80
/**
@@ -78,7 +97,7 @@ void z_arm_init_arch_hw_at_boot(void)
78
97
79
98
/* Initialize System Control Block components */
80
99
81
- #if defined(CONFIG_CPU_HAS_ARM_MPU )
100
+ #if defined(CONFIG_CPU_HAS_ARM_MPU ) || defined( CONFIG_CPU_HAS_NXP_MPU )
82
101
/* Clear MPU region configuration */
83
102
z_arm_clear_arm_mpu_config ();
84
103
#endif /* CONFIG_CPU_HAS_ARM_MPU */
You can’t perform that action at this time.
0 commit comments