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 <mod_armv7m_mpu.h> 9 10 #include <fwk_macros.h> 11 #include <fwk_module.h> 12 13 #include <fmw_cmsis.h> 14 15 #include <stdint.h> 16 17 #define ROM_BASE 0x00000000UL 18 #define AP_RAM_BASE UINT32_C(0xA4000000) 19 20 static const ARM_MPU_Region_t regions[] = { 21 { 22 /* 0x0000_0000 - 0xFFFF_FFFF */ 23 .RBAR = ARM_MPU_RBAR(0, ROM_BASE), 24 .RASR = ARM_MPU_RASR( 25 1, 26 ARM_MPU_AP_FULL, 27 0, 28 1, 29 0, 30 0, 31 0, 32 ARM_MPU_REGION_SIZE_4GB), 33 }, 34 { 35 /* 0x0000_0000 - 0x1FFF_FFFF */ 36 .RBAR = ARM_MPU_RBAR(1, ROM_BASE), 37 .RASR = ARM_MPU_RASR( 38 0, 39 ARM_MPU_AP_FULL, 40 0, 41 0, 42 1, 43 1, 44 0, 45 ARM_MPU_REGION_SIZE_512MB), 46 }, 47 { 48 /* 0xA400_0000 - 0xA407_FFFF */ 49 .RBAR = ARM_MPU_RBAR(2, AP_RAM_BASE), 50 .RASR = ARM_MPU_RASR( 51 0, 52 ARM_MPU_AP_FULL, 53 0, 54 0, 55 1, 56 1, 57 0, 58 ARM_MPU_REGION_SIZE_512KB), 59 }, 60 }; 61 62 const struct fwk_module_config config_armv7m_mpu = { 63 .data = &((struct mod_armv7m_mpu_config){ 64 .region_count = FWK_ARRAY_SIZE(regions), 65 .regions = regions, 66 }), 67 }; 68