2017-11-11 22:54:34 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017, NXP
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
#ifndef _IMX_RT_MPU_MEM_CFG_H_
|
|
|
|
#define _IMX_RT_MPU_MEM_CFG_H_
|
|
|
|
|
|
|
|
#include <soc.h>
|
|
|
|
#include <arch/arm/cortex_m/mpu/arm_mpu.h>
|
|
|
|
|
|
|
|
/* Flash Region Definitions */
|
2019-04-19 19:07:14 +08:00
|
|
|
#if CONFIG_FLASH_SIZE == 32
|
|
|
|
#define REGION_FLASH_SIZE REGION_32K
|
|
|
|
#elif CONFIG_FLASH_SIZE == 64
|
2017-11-11 22:54:34 +08:00
|
|
|
#define REGION_FLASH_SIZE REGION_64K
|
|
|
|
#elif CONFIG_FLASH_SIZE == 128
|
|
|
|
#define REGION_FLASH_SIZE REGION_128K
|
|
|
|
#elif CONFIG_FLASH_SIZE == 256
|
|
|
|
#define REGION_FLASH_SIZE REGION_256K
|
|
|
|
#elif CONFIG_FLASH_SIZE == 512
|
|
|
|
#define REGION_FLASH_SIZE REGION_512K
|
|
|
|
#elif CONFIG_FLASH_SIZE == 1024
|
|
|
|
#define REGION_FLASH_SIZE REGION_1M
|
|
|
|
#elif CONFIG_FLASH_SIZE == 2048
|
|
|
|
#define REGION_FLASH_SIZE REGION_2M
|
2019-02-21 20:18:06 +08:00
|
|
|
#elif CONFIG_FLASH_SIZE == 4096
|
|
|
|
#define REGION_FLASH_SIZE REGION_4M
|
2018-04-05 07:06:50 +08:00
|
|
|
#elif CONFIG_FLASH_SIZE == 8192
|
|
|
|
#define REGION_FLASH_SIZE REGION_8M
|
2019-03-04 22:59:15 +08:00
|
|
|
#elif CONFIG_FLASH_SIZE == 16384
|
|
|
|
#define REGION_FLASH_SIZE REGION_16M
|
2018-04-05 07:06:50 +08:00
|
|
|
#elif CONFIG_FLASH_SIZE == 65536
|
|
|
|
#define REGION_FLASH_SIZE REGION_64M
|
2017-11-11 22:54:34 +08:00
|
|
|
#else
|
|
|
|
#error "Unsupported configuration"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* SRAM Region Definitions */
|
|
|
|
#if CONFIG_SRAM_SIZE == 32
|
|
|
|
#define REGION_SRAM_0_SIZE REGION_32K
|
|
|
|
#elif CONFIG_SRAM_SIZE == 64
|
|
|
|
#define REGION_SRAM_0_SIZE REGION_64K
|
|
|
|
#elif CONFIG_SRAM_SIZE == 128
|
|
|
|
#define REGION_SRAM_0_SIZE REGION_128K
|
|
|
|
#elif CONFIG_SRAM_SIZE == 256
|
|
|
|
#define REGION_SRAM_0_SIZE REGION_256K
|
2019-03-15 17:08:15 +08:00
|
|
|
#elif CONFIG_SRAM_SIZE == 512
|
|
|
|
#define REGION_SRAM_0_SIZE REGION_512K
|
|
|
|
#elif CONFIG_SRAM_SIZE == 768
|
|
|
|
#define REGION_SRAM_0_SIZE REGION_1M /* MPU expects power of two size */
|
2018-04-05 07:06:50 +08:00
|
|
|
#elif CONFIG_SRAM_SIZE == 32768
|
|
|
|
#define REGION_SRAM_0_SIZE REGION_32M
|
2017-11-11 22:54:34 +08:00
|
|
|
#else
|
|
|
|
#error "Unsupported configuration"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _IMX_RT_MPU_MEM_CFG_H_ */
|