Skip to content
Permalink
Browse files

soc: arm: stm32: Updated SRAM Region Definitions

This updates the SRAM region definition for stm32

Signed-off-by: Habib Zaid <habibzaid@gmail.com>
  • Loading branch information...
Hobbs1210 authored and galak committed Mar 16, 2019
1 parent 2a798bb commit 32367c0dfcb75468808198c90086dac1a0583afd
Showing with 8 additions and 12 deletions.
  1. +6 −12 soc/arm/st_stm32/common/arm_mpu_mem_cfg.h
  2. +2 −0 soc/arm/st_stm32/common/arm_mpu_regions.c
@@ -38,25 +38,19 @@
#define REGION_SRAM_1_START 0x4000
#define REGION_SRAM_1_SIZE REGION_4K
#elif CONFIG_SRAM_SIZE == 32
#define REGION_SRAM_0_SIZE REGION_16K
#define REGION_SRAM_1_START 0x4000
#define REGION_SRAM_1_SIZE REGION_16K
#define REGION_SRAM_0_SIZE REGION_32K
#elif CONFIG_SRAM_SIZE == 40
#define REGION_SRAM_0_SIZE REGION_32K
#define REGION_SRAM_1_START 0x8000
#define REGION_SRAM_1_SIZE REGION_8K
#elif CONFIG_SRAM_SIZE == 64
#define REGION_SRAM_0_SIZE REGION_32K
#define REGION_SRAM_1_START 0x8000
#define REGION_SRAM_1_SIZE REGION_32K
#define REGION_SRAM_0_SIZE REGION_64K
#elif CONFIG_SRAM_SIZE == 96
#define REGION_SRAM_0_SIZE REGION_64K
#define REGION_SRAM_1_START 0x10000
#define REGION_SRAM_1_SIZE REGION_32K
#elif CONFIG_SRAM_SIZE == 128
#define REGION_SRAM_0_SIZE REGION_64K
#define REGION_SRAM_1_START 0x10000
#define REGION_SRAM_1_SIZE REGION_64K
#define REGION_SRAM_0_SIZE REGION_128K
#elif CONFIG_SRAM_SIZE == 160
#define REGION_SRAM_0_SIZE REGION_128K
#define REGION_SRAM_1_START 0x20000
@@ -66,9 +60,7 @@
#define REGION_SRAM_1_START 0x20000
#define REGION_SRAM_1_SIZE REGION_64K
#elif CONFIG_SRAM_SIZE == 256
#define REGION_SRAM_0_SIZE REGION_128K
#define REGION_SRAM_1_START 0x20000
#define REGION_SRAM_1_SIZE REGION_128K
#define REGION_SRAM_0_SIZE REGION_256K
#elif CONFIG_SRAM_SIZE == 320
#define REGION_SRAM_0_SIZE REGION_256K
#define REGION_SRAM_1_START 0x40000
@@ -77,6 +69,8 @@
#define REGION_SRAM_0_SIZE REGION_256K
#define REGION_SRAM_1_START 0x40000
#define REGION_SRAM_1_SIZE REGION_128K
#elif CONFIG_SRAM_SIZE == 512
#define REGION_SRAM_0_SIZE REGION_512K
#elif CONFIG_SRAM_SIZE == 640
#define REGION_SRAM_0_SIZE REGION_512K
#define REGION_SRAM_1_START 0x80000
@@ -22,9 +22,11 @@ static const struct arm_mpu_region mpu_regions[] = {
CONFIG_SRAM_BASE_ADDRESS,
REGION_RAM_ATTR(REGION_SRAM_0_SIZE)),
/* Region 2 */
#ifdef REGION_SRAM_1_SIZE
MPU_REGION_ENTRY("RAM_1",
(CONFIG_SRAM_BASE_ADDRESS + REGION_SRAM_1_START),
REGION_RAM_ATTR(REGION_SRAM_1_SIZE)),
#endif
};

const struct arm_mpu_config mpu_config = {

0 comments on commit 32367c0

Please sign in to comment.
You can’t perform that action at this time.