1# Copyright (c) 2021-2024, Arm Limited. All rights reserved. 2# 3# SPDX-License-Identifier: BSD-3-Clause 4# 5 6include common/fdt_wrappers.mk 7 8TARGET_FLAVOUR := fvp 9# DPU with SCMI may not necessarily work, so allow its independence 10TC_DPU_USE_SCMI_CLK := 1 11# SCMI power domain control enable 12TC_SCMI_PD_CTRL_EN := 1 13# IOMMU: Enable the use of system or individual MMUs 14TC_IOMMU_EN := 1 15 16ifneq ($(shell expr $(TARGET_PLATFORM) \<= 1), 0) 17 $(warning Platform ${PLAT}$(TARGET_PLATFORM) is deprecated. \ 18 Some of the features might not work as expected) 19endif 20 21ifeq ($(shell expr $(TARGET_PLATFORM) \<= 3), 0) 22 $(error TARGET_PLATFORM must be less than or equal to 3) 23endif 24 25ifeq ($(filter ${TARGET_FLAVOUR}, fvp fpga),) 26 $(error TARGET_FLAVOUR must be fvp or fpga) 27endif 28 29$(eval $(call add_defines, \ 30 TARGET_PLATFORM \ 31 TARGET_FLAVOUR_$(call uppercase,${TARGET_FLAVOUR}) \ 32 TC_DPU_USE_SCMI_CLK \ 33 TC_SCMI_PD_CTRL_EN \ 34 TC_IOMMU_EN \ 35)) 36 37CSS_LOAD_SCP_IMAGES := 1 38 39CSS_USE_SCMI_SDS_DRIVER := 1 40 41ENABLE_FEAT_RAS := 1 42 43SDEI_SUPPORT := 0 44 45EL3_EXCEPTION_HANDLING := 0 46 47HANDLE_EA_EL3_FIRST_NS := 0 48 49# System coherency is managed in hardware 50HW_ASSISTED_COHERENCY := 1 51 52# When building for systems with hardware-assisted coherency, there's no need to 53# use USE_COHERENT_MEM. Require that USE_COHERENT_MEM must be set to 0 too. 54USE_COHERENT_MEM := 0 55 56GIC_ENABLE_V4_EXTN := 1 57 58# GIC-600 configuration 59GICV3_SUPPORT_GIC600 := 1 60 61# Enable SVE 62ENABLE_SVE_FOR_NS := 2 63ENABLE_SVE_FOR_SWD := 1 64 65# enable trace buffer control registers access to NS by default 66ENABLE_TRBE_FOR_NS := 1 67 68# enable trace system registers access to NS by default 69ENABLE_SYS_REG_TRACE_FOR_NS := 1 70 71# enable trace filter control registers access to NS by default 72ENABLE_TRF_FOR_NS := 1 73 74# Include GICv3 driver files 75include drivers/arm/gic/v3/gicv3.mk 76 77ENT_GIC_SOURCES := ${GICV3_SOURCES} \ 78 plat/common/plat_gicv3.c \ 79 plat/arm/common/arm_gicv3.c 80 81override NEED_BL2U := no 82 83override ARM_PLAT_MT := 1 84 85TC_BASE = plat/arm/board/tc 86 87PLAT_INCLUDES += -I${TC_BASE}/include/ \ 88 -I${TC_BASE}/fdts/ 89 90# CPU libraries for TARGET_PLATFORM=1 91ifeq (${TARGET_PLATFORM}, 1) 92TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \ 93 lib/cpus/aarch64/cortex_a715.S \ 94 lib/cpus/aarch64/cortex_x3.S 95endif 96 97# CPU libraries for TARGET_PLATFORM=2 98ifeq (${TARGET_PLATFORM}, 2) 99TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \ 100 lib/cpus/aarch64/cortex_a720.S \ 101 lib/cpus/aarch64/cortex_x4.S 102endif 103 104# CPU libraries for TARGET_PLATFORM=3 105ifeq (${TARGET_PLATFORM}, 3) 106TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \ 107 lib/cpus/aarch64/cortex_chaberton.S \ 108 lib/cpus/aarch64/cortex_blackhawk.S 109endif 110 111INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c 112 113PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \ 114 ${TC_BASE}/include/tc_helpers.S 115 116BL1_SOURCES += ${INTERCONNECT_SOURCES} \ 117 ${TC_CPU_SOURCES} \ 118 ${TC_BASE}/tc_trusted_boot.c \ 119 ${TC_BASE}/tc_err.c \ 120 drivers/arm/sbsa/sbsa.c 121 122BL2_SOURCES += ${TC_BASE}/tc_security.c \ 123 ${TC_BASE}/tc_err.c \ 124 ${TC_BASE}/tc_trusted_boot.c \ 125 ${TC_BASE}/tc_bl2_setup.c \ 126 lib/utils/mem_region.c \ 127 drivers/arm/tzc/tzc400.c \ 128 plat/arm/common/arm_tzc400.c \ 129 plat/arm/common/arm_nor_psci_mem_protect.c 130 131BL31_SOURCES += ${INTERCONNECT_SOURCES} \ 132 ${TC_CPU_SOURCES} \ 133 ${ENT_GIC_SOURCES} \ 134 ${TC_BASE}/tc_bl31_setup.c \ 135 ${TC_BASE}/tc_topology.c \ 136 lib/fconf/fconf.c \ 137 lib/fconf/fconf_dyn_cfg_getter.c \ 138 drivers/cfi/v2m/v2m_flash.c \ 139 lib/utils/mem_region.c \ 140 plat/arm/common/arm_nor_psci_mem_protect.c \ 141 drivers/arm/sbsa/sbsa.c 142 143BL31_SOURCES += ${FDT_WRAPPERS_SOURCES} 144 145# Add the FDT_SOURCES and options for Dynamic Config 146FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \ 147 ${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts 148FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb 149TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb 150 151# Add the FW_CONFIG to FIP and specify the same to certtool 152$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG})) 153# Add the TB_FW_CONFIG to FIP and specify the same to certtool 154$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG})) 155 156ifeq (${SPD},spmd) 157ifeq ($(ARM_SPMC_MANIFEST_DTS),) 158ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_test_manifest.dts 159endif 160 161FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS} 162TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb 163 164# Add the TOS_FW_CONFIG to FIP and specify the same to certtool 165$(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG})) 166endif 167 168#Device tree 169TC_HW_CONFIG_DTS := fdts/tc.dts 170TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb 171FDT_SOURCES += ${TC_HW_CONFIG_DTS} 172$(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS))) 173 174# Add the HW_CONFIG to FIP and specify the same to certtool 175$(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG})) 176 177override CTX_INCLUDE_AARCH32_REGS := 0 178 179override CTX_INCLUDE_PAUTH_REGS := 1 180 181override ENABLE_SPE_FOR_NS := 0 182 183override ENABLE_FEAT_AMU := 1 184ENABLE_AMU_AUXILIARY_COUNTERS := 1 185ENABLE_AMU_FCONF := 1 186 187ENABLE_MPMM := 1 188ENABLE_MPMM_FCONF := 1 189 190# Include Measured Boot makefile before any Crypto library makefile. 191# Crypto library makefile may need default definitions of Measured Boot build 192# flags present in Measured Boot makefile. 193ifeq (${MEASURED_BOOT},1) 194 MEASURED_BOOT_MK := drivers/measured_boot/rss/rss_measured_boot.mk 195 $(info Including ${MEASURED_BOOT_MK}) 196 include ${MEASURED_BOOT_MK} 197 $(info Including rss_comms.mk) 198 include drivers/arm/rss/rss_comms.mk 199 200 BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \ 201 plat/arm/board/tc/tc_common_measured_boot.c \ 202 plat/arm/board/tc/tc_bl1_measured_boot.c \ 203 lib/psa/measured_boot.c \ 204 ${RSS_COMMS_SOURCES} 205 206 BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \ 207 plat/arm/board/tc/tc_common_measured_boot.c \ 208 plat/arm/board/tc/tc_bl2_measured_boot.c \ 209 lib/psa/measured_boot.c \ 210 ${RSS_COMMS_SOURCES} 211 212PLAT_INCLUDES += -Iinclude/lib/psa 213 214endif 215 216ifneq (${PLATFORM_TEST},) 217 # Add this include as first, before arm_common.mk. This is necessary 218 # because arm_common.mk builds Mbed TLS, and platform_test.mk can 219 # change the list of Mbed TLS files that are to be compiled 220 # (LIBMBEDTLS_SRCS). 221 include plat/arm/board/tc/platform_test.mk 222endif 223 224 225include plat/arm/common/arm_common.mk 226include plat/arm/css/common/css_common.mk 227include plat/arm/soc/common/soc_css.mk 228include plat/arm/board/common/board_common.mk 229