blob: 4c4ff823688fa13f404eac9c67b0bda187c94f8f [file] [log] [blame]
Harry Liebelf2199d92014-04-01 19:27:38 +01001/*
Federico Recanatie8035422021-12-23 11:01:11 +01002 * Copyright (c) 2014-2022, Arm Limited and Contributors. All rights reserved.
Harry Liebelf2199d92014-04-01 19:27:38 +01003 *
dp-arm82cb2c12017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Harry Liebelf2199d92014-04-01 19:27:38 +01005 */
6
Antonio Nino Diazbd9344f2019-01-25 14:30:04 +00007#include <plat/arm/common/arm_config.h>
8#include <plat/arm/common/plat_arm.h>
Federico Recanatie8035422021-12-23 11:01:11 +01009#include <platform_def.h>
Tushar Khandelwal9547f0a2024-03-15 15:00:29 +000010#include <arch_features.h>
Harry Liebelf2199d92014-04-01 19:27:38 +010011
12/*
Dan Handley60eea552015-03-19 19:17:53 +000013 * We assume that all security programming is done by the primary core.
Harry Liebelf2199d92014-04-01 19:27:38 +010014 */
Dan Handley60eea552015-03-19 19:17:53 +000015void plat_arm_security_setup(void)
Harry Liebelf2199d92014-04-01 19:27:38 +010016{
Harry Liebelf2199d92014-04-01 19:27:38 +010017 /*
18 * The Base FVP has a TrustZone address space controller, the Foundation
19 * FVP does not. Trying to program the device on the foundation FVP will
20 * cause an abort.
21 *
22 * If the platform had additional peripheral specific security
23 * configurations, those would be configured here.
24 */
25
Federico Recanatie8035422021-12-23 11:01:11 +010026 const arm_tzc_regions_info_t fvp_tzc_regions[] = {
27 ARM_TZC_REGIONS_DEF,
Levi Yun06cec932024-08-08 13:13:23 +010028#if !SPM_MM && !ENABLE_RME && !(SPMC_AT_EL3 && SPMC_AT_EL3_SEL0_SP)
Federico Recanatie8035422021-12-23 11:01:11 +010029 {FVP_DRAM3_BASE, FVP_DRAM3_END,
30 ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS},
31 {FVP_DRAM4_BASE, FVP_DRAM4_END,
32 ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS},
33 {FVP_DRAM5_BASE, FVP_DRAM5_END,
34 ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS},
35 {FVP_DRAM6_BASE, FVP_DRAM6_END,
36 ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS},
37#endif
38 {0}
39 };
40
Sathees Balya89509902018-09-27 14:41:02 +010041 if ((get_arm_config()->flags & ARM_CONFIG_HAS_TZC) != 0U)
Federico Recanatie8035422021-12-23 11:01:11 +010042 arm_tzc400_setup(PLAT_ARM_TZC_BASE, fvp_tzc_regions);
Harry Liebelf2199d92014-04-01 19:27:38 +010043}