1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include "n1sdp_mcp_system_mmap.h"
9 
10 #include <mod_armv7m_mpu.h>
11 
12 #include <fwk_macros.h>
13 #include <fwk_module.h>
14 
15 #include <fmw_cmsis.h>
16 
17 static const ARM_MPU_Region_t regions[] = {
18     { /* 0x0000_0000 - 0xFFFF_FFFF */
19         .RBAR = ARM_MPU_RBAR(0, 0x00000000),
20         .RASR = ARM_MPU_RASR(
21             1, ARM_MPU_AP_PRIV, 0, 1, 0, 1, 0, ARM_MPU_REGION_SIZE_4GB),
22     },
23     { /* 0x0080_0000 - 0x0087_FFFF */
24         .RBAR = ARM_MPU_RBAR(1, MCP_RAM0_BASE),
25         .RASR = ARM_MPU_RASR(
26             0, ARM_MPU_AP_PRO, 0, 0, 1, 0, 0, ARM_MPU_REGION_SIZE_512KB),
27     },
28     { /* 0x2000_0000 - 0x2003_FFFF */
29         .RBAR = ARM_MPU_RBAR(2, MCP_RAM1_BASE),
30         .RASR = ARM_MPU_RASR(
31             1, ARM_MPU_AP_PRIV, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_256KB),
32     },
33 };
34 
35 const struct fwk_module_config config_armv7m_mpu = {
36     .data = &((struct mod_armv7m_mpu_config){
37         .region_count = FWK_ARRAY_SIZE(regions),
38         .regions = regions,
39     }),
40 };
41