1 /*
2  * Copyright (c) 2014-2022, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <plat/arm/common/arm_config.h>
8 #include <plat/arm/common/plat_arm.h>
9 #include <platform_def.h>
10 
11 /*
12  * We assume that all security programming is done by the primary core.
13  */
plat_arm_security_setup(void)14 void plat_arm_security_setup(void)
15 {
16 	/*
17 	 * The Base FVP has a TrustZone address space controller, the Foundation
18 	 * FVP does not. Trying to program the device on the foundation FVP will
19 	 * cause an abort.
20 	 *
21 	 * If the platform had additional peripheral specific security
22 	 * configurations, those would be configured here.
23 	 */
24 
25 	const arm_tzc_regions_info_t fvp_tzc_regions[] = {
26 		ARM_TZC_REGIONS_DEF,
27 #if !SPM_MM && !ENABLE_RME
28 		{FVP_DRAM3_BASE, FVP_DRAM3_END,
29 		 ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS},
30 		{FVP_DRAM4_BASE, FVP_DRAM4_END,
31 		 ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS},
32 		{FVP_DRAM5_BASE, FVP_DRAM5_END,
33 		 ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS},
34 		{FVP_DRAM6_BASE, FVP_DRAM6_END,
35 		 ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS},
36 #endif
37 		{0}
38 	};
39 
40 	if ((get_arm_config()->flags & ARM_CONFIG_HAS_TZC) != 0U)
41 		arm_tzc400_setup(PLAT_ARM_TZC_BASE, fvp_tzc_regions);
42 }
43