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