Skip to content

Commit

Permalink
[nrf temphack] soc: use PM when configuring MPU regions
Browse files Browse the repository at this point in the history
Temporary solution for using partition manager defines when configuring
the MPU regions.

This fixes assert seen when configuring dynamic regions.

Ref: NCSDK-6718

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
  • Loading branch information
hakonfam authored and carlescufi committed Oct 26, 2020
1 parent 746d14a commit d910949
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions soc/arm/common/cortex_m/arm_mpu_regions.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include <arch/arm/aarch32/cortex_m/mpu/arm_mpu.h>

#include "arm_mpu_mem_cfg.h"
#if USE_PARTITION_MANAGER
#include <pm_config.h>
#endif

static const struct arm_mpu_region mpu_regions[] = {
/* Region 0 */
Expand All @@ -21,13 +24,24 @@ static const struct arm_mpu_region mpu_regions[] = {
#endif
/* Region 1 */
MPU_REGION_ENTRY("SRAM_0",
#if USE_PARTITION_MANAGER
PM_SRAM_ADDRESS,
#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE)
REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)),
#else
REGION_RAM_ATTR(REGION_SRAM_SIZE)),
#endif
#else
CONFIG_SRAM_BASE_ADDRESS,
#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE)
REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \
CONFIG_SRAM_SIZE * 1024)),
#else
REGION_RAM_ATTR(REGION_SRAM_SIZE)),
#endif

#endif /* USE_PARTITION_MANAGER */

};

const struct arm_mpu_config mpu_config = {
Expand Down

0 comments on commit d910949

Please sign in to comment.