1 /* 2 * Arm SCP/MCP Software 3 * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 #include "scp_mmap.h" 9 #include "scp_software_mmap.h" 10 11 #include <mod_armv7m_mpu.h> 12 13 #include <fwk_macros.h> 14 #include <fwk_module.h> 15 16 #include <fmw_cmsis.h> 17 18 static const ARM_MPU_Region_t regions[] = { 19 { 20 /* 0x0000_0000 - 0xFFFF_FFFF */ 21 .RBAR = ARM_MPU_RBAR(0, 0x00000000), 22 .RASR = ARM_MPU_RASR( 23 1, 24 ARM_MPU_AP_PRIV, 25 0, 26 1, 27 0, 28 1, 29 0, 30 ARM_MPU_REGION_SIZE_4GB), 31 }, 32 { 33 /* 0x1000_0000 - 0x1007_FFFF */ 34 .RBAR = ARM_MPU_RBAR(1, SCP_RAM_BASE), 35 .RASR = ARM_MPU_RASR( 36 0, 37 ARM_MPU_AP_PRIV, 38 0, 39 0, 40 1, 41 1, 42 0, 43 ARM_MPU_REGION_SIZE_512KB), 44 }, 45 { 46 /* 0xA400_0000 - 0xA400_7FFF*/ 47 .RBAR = ARM_MPU_RBAR(2, SCP_TRUSTED_RAM_BASE), 48 .RASR = ARM_MPU_RASR( 49 1, 50 ARM_MPU_AP_PRIV, 51 0, 52 1, 53 1, 54 1, 55 0, 56 ARM_MPU_REGION_SIZE_4KB), 57 }, 58 { 59 /* 0xA600_0000 - 0xA600_7FFF */ 60 .RBAR = ARM_MPU_RBAR(3, SCP_NONTRUSTED_RAM_BASE), 61 .RASR = ARM_MPU_RASR( 62 1, 63 ARM_MPU_AP_PRIV, 64 0, 65 1, 66 1, 67 1, 68 0, 69 ARM_MPU_REGION_SIZE_256B), 70 }, 71 }; 72 73 const struct fwk_module_config config_armv7m_mpu = { 74 .data = &((struct mod_armv7m_mpu_config){ 75 .region_count = FWK_ARRAY_SIZE(regions), 76 .regions = regions, 77 }), 78 }; 79