blob: 573d92efbc2ed142e5080c029eb8ee38895dc5f8 [file] [log] [blame]
Harry Liebelcef93392014-04-01 19:27:38 +01001/*
Federico Recanatife09a422021-12-23 11:01:11 +01002 * Copyright (c) 2014-2022, Arm Limited and Contributors. All rights reserved.
Harry Liebelcef93392014-04-01 19:27:38 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Harry Liebelcef93392014-04-01 19:27:38 +01005 */
6
Antonio Nino Diazbd7b7402019-01-25 14:30:04 +00007#include <plat/arm/common/arm_config.h>
8#include <plat/arm/common/plat_arm.h>
Federico Recanatife09a422021-12-23 11:01:11 +01009#include <platform_def.h>
Harry Liebelcef93392014-04-01 19:27:38 +010010
11/*
Dan Handley2b6b5742015-03-19 19:17:53 +000012 * We assume that all security programming is done by the primary core.
Harry Liebelcef93392014-04-01 19:27:38 +010013 */
Dan Handley2b6b5742015-03-19 19:17:53 +000014void plat_arm_security_setup(void)
Harry Liebelcef93392014-04-01 19:27:38 +010015{
Harry Liebelcef93392014-04-01 19:27:38 +010016 /*
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
Federico Recanatife09a422021-12-23 11:01:11 +010025 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
Sathees Balya30952cc2018-09-27 14:41:02 +010040 if ((get_arm_config()->flags & ARM_CONFIG_HAS_TZC) != 0U)
Federico Recanatife09a422021-12-23 11:01:11 +010041 arm_tzc400_setup(PLAT_ARM_TZC_BASE, fvp_tzc_regions);
Harry Liebelcef93392014-04-01 19:27:38 +010042}