| 1 |
# Copyright (c) 2021-2024, Arm Limited. All rights reserved. |
| 2 |
# |
| 3 |
# SPDX-License-Identifier: BSD-3-Clause |
| 4 |
# |
| 5 |
|
| 6 |
include common/fdt_wrappers.mk |
| 7 |
|
| 8 |
TARGET_FLAVOUR := fvp |
| 9 |
# DPU with SCMI may not necessarily work, so allow its independence |
| 10 |
TC_DPU_USE_SCMI_CLK := 1 |
| 11 |
# SCMI power domain control enable |
| 12 |
TC_SCMI_PD_CTRL_EN := 1 |
| 13 |
|
| 14 |
# System setup |
| 15 |
CSS_USE_SCMI_SDS_DRIVER := 1 |
| 16 |
HW_ASSISTED_COHERENCY := 1 |
| 17 |
USE_COHERENT_MEM := 0 |
| 18 |
GIC_ENABLE_V4_EXTN := 1 |
| 19 |
GICV3_SUPPORT_GIC600 := 1 |
| 20 |
override NEED_BL2U := no |
| 21 |
override ARM_PLAT_MT := 1 |
| 22 |
|
| 23 |
# CPU setup |
| 24 |
ARM_ARCH_MINOR := 7 |
| 25 |
BRANCH_PROTECTION := 1 |
| 26 |
ENABLE_FEAT_MPAM := 1 # default is 2, optimise |
| 27 |
ENABLE_SVE_FOR_NS := 2 # to show we use it |
| 28 |
ENABLE_SVE_FOR_SWD := 1 |
| 29 |
ENABLE_SME_FOR_NS := 2 |
| 30 |
ENABLE_SME2_FOR_NS := 2 |
| 31 |
ENABLE_SME_FOR_SWD := 1 |
| 32 |
ENABLE_TRBE_FOR_NS := 1 |
| 33 |
ENABLE_SYS_REG_TRACE_FOR_NS := 1 |
| 34 |
ENABLE_FEAT_AMU := 1 |
| 35 |
ENABLE_AMU_FCONF := 1 |
| 36 |
ENABLE_AMU_AUXILIARY_COUNTERS := 1 |
| 37 |
ENABLE_MPMM := 1 |
| 38 |
ENABLE_MPMM_FCONF := 1 |
| 39 |
ENABLE_FEAT_MTE2 := 2 |
| 40 |
ENABLE_SPE_FOR_NS := 3 |
| 41 |
ENABLE_FEAT_TCR2 := 3 |
| 42 |
|
| 43 |
CTX_INCLUDE_AARCH32_REGS := 0 |
| 44 |
|
| 45 |
ifeq (${SPD},spmd) |
| 46 |
SPMD_SPM_AT_SEL2 := 1 |
| 47 |
CTX_INCLUDE_PAUTH_REGS := 1 |
| 48 |
endif |
| 49 |
|
| 50 |
# TC RESOLUTION - LIST OF VALID OPTIONS (this impacts only FVP) |
| 51 |
TC_RESOLUTION_OPTIONS := 640x480p60 \ |
| 52 |
1920x1080p60 |
| 53 |
# Set default to the 640x480p60 resolution mode |
| 54 |
TC_RESOLUTION ?= $(firstword $(TC_RESOLUTION_OPTIONS)) |
| 55 |
|
| 56 |
# Check resolution option for FVP |
| 57 |
ifneq ($(filter ${TARGET_FLAVOUR}, fvp),) |
| 58 |
ifeq ($(filter ${TC_RESOLUTION}, ${TC_RESOLUTION_OPTIONS}),) |
| 59 |
$(error TC_RESOLUTION is ${TC_RESOLUTION}, it must be: ${TC_RESOLUTION_OPTIONS}) |
| 60 |
endif |
| 61 |
endif |
| 62 |
|
| 63 |
ifneq ($(shell expr $(TARGET_PLATFORM) \<= 1), 0) |
| 64 |
$(error Platform ${PLAT}$(TARGET_PLATFORM) is no longer available.) |
| 65 |
endif |
| 66 |
|
| 67 |
ifneq ($(shell expr $(TARGET_PLATFORM) = 2), 0) |
| 68 |
$(warning Platform ${PLAT}$(TARGET_PLATFORM) is deprecated. \ |
| 69 |
Some of the features might not work as expected) |
| 70 |
endif |
| 71 |
|
| 72 |
ifeq ($(shell expr $(TARGET_PLATFORM) \<= 4), 0) |
| 73 |
$(error TARGET_PLATFORM must be less than or equal to 4) |
| 74 |
endif |
| 75 |
|
| 76 |
ifeq ($(filter ${TARGET_FLAVOUR}, fvp fpga),) |
| 77 |
$(error TARGET_FLAVOUR must be fvp or fpga) |
| 78 |
endif |
| 79 |
|
| 80 |
$(eval $(call add_defines, \ |
| 81 |
TARGET_PLATFORM \ |
| 82 |
TARGET_FLAVOUR_$(call uppercase,${TARGET_FLAVOUR}) \ |
| 83 |
TC_RESOLUTION_$(call uppercase,${TC_RESOLUTION}) \ |
| 84 |
TC_DPU_USE_SCMI_CLK \ |
| 85 |
TC_SCMI_PD_CTRL_EN \ |
| 86 |
)) |
| 87 |
|
| 88 |
CSS_LOAD_SCP_IMAGES := 1 |
| 89 |
|
| 90 |
# Save DSU PMU registers on cluster off and restore them on cluster on |
| 91 |
PRESERVE_DSU_PMU_REGS := 1 |
| 92 |
|
| 93 |
# Specify MHU type based on platform |
| 94 |
ifneq ($(filter ${TARGET_PLATFORM}, 2),) |
| 95 |
PLAT_MHU_VERSION := 2 |
| 96 |
else |
| 97 |
PLAT_MHU_VERSION := 3 |
| 98 |
endif |
| 99 |
|
| 100 |
# Include GICv3 driver files |
| 101 |
include drivers/arm/gic/v3/gicv3.mk |
| 102 |
|
| 103 |
ENT_GIC_SOURCES := ${GICV3_SOURCES} \ |
| 104 |
plat/common/plat_gicv3.c \ |
| 105 |
plat/arm/common/arm_gicv3.c |
| 106 |
|
| 107 |
TC_BASE = plat/arm/board/tc |
| 108 |
|
| 109 |
PLAT_INCLUDES += -I${TC_BASE}/include/ \ |
| 110 |
-I${TC_BASE}/fdts/ |
| 111 |
|
| 112 |
# CPU libraries for TARGET_PLATFORM=1 |
| 113 |
ifeq (${TARGET_PLATFORM}, 1) |
| 114 |
TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \ |
| 115 |
lib/cpus/aarch64/cortex_a715.S \ |
| 116 |
lib/cpus/aarch64/cortex_x3.S |
| 117 |
endif |
| 118 |
|
| 119 |
# CPU libraries for TARGET_PLATFORM=2 |
| 120 |
ifeq (${TARGET_PLATFORM}, 2) |
| 121 |
ERRATA_A520_2938996 := 1 |
| 122 |
ERRATA_X4_2726228 := 1 |
| 123 |
|
| 124 |
TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \ |
| 125 |
lib/cpus/aarch64/cortex_a720.S \ |
| 126 |
lib/cpus/aarch64/cortex_x4.S |
| 127 |
endif |
| 128 |
|
| 129 |
# CPU libraries for TARGET_PLATFORM=3 |
| 130 |
ifeq (${TARGET_PLATFORM}, 3) |
| 131 |
ERRATA_A520_2938996 := 1 |
| 132 |
|
| 133 |
TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \ |
| 134 |
lib/cpus/aarch64/cortex_a725.S \ |
| 135 |
lib/cpus/aarch64/cortex_x925.S |
| 136 |
endif |
| 137 |
|
| 138 |
# CPU libraries for TARGET_PLATFORM=4 |
| 139 |
ifeq (${TARGET_PLATFORM}, 4) |
| 140 |
TC_CPU_SOURCES += lib/cpus/aarch64/cortex_gelas.S \ |
| 141 |
lib/cpus/aarch64/nevis.S \ |
| 142 |
lib/cpus/aarch64/travis.S |
| 143 |
endif |
| 144 |
|
| 145 |
INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c \ |
| 146 |
plat/arm/common/arm_ni.c |
| 147 |
|
| 148 |
PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \ |
| 149 |
${TC_BASE}/include/tc_helpers.S |
| 150 |
|
| 151 |
BL1_SOURCES += ${INTERCONNECT_SOURCES} \ |
| 152 |
${TC_CPU_SOURCES} \ |
| 153 |
${TC_BASE}/tc_trusted_boot.c \ |
| 154 |
${TC_BASE}/tc_bl1_setup.c \ |
| 155 |
${TC_BASE}/tc_err.c \ |
| 156 |
drivers/arm/sbsa/sbsa.c |
| 157 |
|
| 158 |
BL2_SOURCES += ${TC_BASE}/tc_security.c \ |
| 159 |
${TC_BASE}/tc_err.c \ |
| 160 |
${TC_BASE}/tc_trusted_boot.c \ |
| 161 |
${TC_BASE}/tc_bl2_setup.c \ |
| 162 |
lib/utils/mem_region.c \ |
| 163 |
drivers/arm/tzc/tzc400.c \ |
| 164 |
plat/arm/common/arm_nor_psci_mem_protect.c |
| 165 |
|
| 166 |
ifeq ($(shell test $(TARGET_PLATFORM) -le 2; echo $$?),0) |
| 167 |
BL2_SOURCES += plat/arm/common/arm_tzc400.c |
| 168 |
endif |
| 169 |
|
| 170 |
BL31_SOURCES += ${INTERCONNECT_SOURCES} \ |
| 171 |
${TC_CPU_SOURCES} \ |
| 172 |
${ENT_GIC_SOURCES} \ |
| 173 |
${TC_BASE}/tc_bl31_setup.c \ |
| 174 |
${TC_BASE}/tc_topology.c \ |
| 175 |
lib/fconf/fconf.c \ |
| 176 |
lib/fconf/fconf_dyn_cfg_getter.c \ |
| 177 |
drivers/arm/css/dsu/dsu.c \ |
| 178 |
drivers/cfi/v2m/v2m_flash.c \ |
| 179 |
lib/utils/mem_region.c \ |
| 180 |
plat/arm/common/arm_nor_psci_mem_protect.c \ |
| 181 |
drivers/arm/sbsa/sbsa.c |
| 182 |
|
| 183 |
BL31_SOURCES += ${FDT_WRAPPERS_SOURCES} |
| 184 |
|
| 185 |
# Add the FDT_SOURCES and options for Dynamic Config |
| 186 |
FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \ |
| 187 |
${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts \ |
| 188 |
${TC_BASE}/fdts/${PLAT}_nt_fw_config.dts |
| 189 |
FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb |
| 190 |
TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb |
| 191 |
FVP_NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb |
| 192 |
|
| 193 |
# Add the FW_CONFIG to FIP and specify the same to certtool |
| 194 |
$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG})) |
| 195 |
# Add the TB_FW_CONFIG to FIP and specify the same to certtool |
| 196 |
$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG})) |
| 197 |
# Add the NT_FW_CONFIG to FIP and specify the same to certtool |
| 198 |
$(eval $(call TOOL_ADD_PAYLOAD,${FVP_NT_FW_CONFIG},--nt-fw-config,${FVP_NT_FW_CONFIG})) |
| 199 |
|
| 200 |
ifeq (${SPD},spmd) |
| 201 |
ifeq ($(ARM_SPMC_MANIFEST_DTS),) |
| 202 |
ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_test_manifest.dts |
| 203 |
endif |
| 204 |
|
| 205 |
FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS} |
| 206 |
TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb |
| 207 |
|
| 208 |
# Add the TOS_FW_CONFIG to FIP and specify the same to certtool |
| 209 |
$(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG})) |
| 210 |
endif |
| 211 |
|
| 212 |
#Device tree |
| 213 |
TC_HW_CONFIG_DTS := fdts/${PLAT}${TARGET_PLATFORM}.dts |
| 214 |
TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb |
| 215 |
FDT_SOURCES += ${TC_HW_CONFIG_DTS} |
| 216 |
$(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS))) |
| 217 |
|
| 218 |
# Add the HW_CONFIG to FIP and specify the same to certtool |
| 219 |
$(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG})) |
| 220 |
|
| 221 |
# Include Measured Boot makefile before any Crypto library makefile. |
| 222 |
# Crypto library makefile may need default definitions of Measured Boot build |
| 223 |
# flags present in Measured Boot makefile. |
| 224 |
$(info Including rse_comms.mk) |
| 225 |
ifeq (${MEASURED_BOOT},1) |
| 226 |
$(info Including rse_comms.mk) |
| 227 |
include drivers/arm/rse/rse_comms.mk |
| 228 |
|
| 229 |
BL1_SOURCES += ${RSE_COMMS_SOURCES} |
| 230 |
BL2_SOURCES += ${RSE_COMMS_SOURCES} |
| 231 |
PLAT_INCLUDES += -Iinclude/lib/psa |
| 232 |
|
| 233 |
ifeq (${DICE_PROTECTION_ENVIRONMENT},1) |
| 234 |
$(info Including qcbor.mk) |
| 235 |
include drivers/measured_boot/rse/qcbor.mk |
| 236 |
$(info Including dice_prot_env.mk) |
| 237 |
include drivers/measured_boot/rse/dice_prot_env.mk |
| 238 |
|
| 239 |
BL1_SOURCES += ${QCBOR_SOURCES} \ |
| 240 |
${DPE_SOURCES} \ |
| 241 |
plat/arm/board/tc/tc_common_dpe.c \ |
| 242 |
plat/arm/board/tc/tc_bl1_dpe.c \ |
| 243 |
lib/psa/dice_protection_environment.c \ |
| 244 |
drivers/arm/css/sds/sds.c \ |
| 245 |
drivers/delay_timer/delay_timer.c \ |
| 246 |
drivers/delay_timer/generic_delay_timer.c |
| 247 |
|
| 248 |
BL2_SOURCES += ${QCBOR_SOURCES} \ |
| 249 |
${DPE_SOURCES} \ |
| 250 |
plat/arm/board/tc/tc_common_dpe.c \ |
| 251 |
plat/arm/board/tc/tc_bl2_dpe.c \ |
| 252 |
lib/psa/dice_protection_environment.c |
| 253 |
|
| 254 |
PLAT_INCLUDES += -I${QCBOR_INCLUDES} \ |
| 255 |
-Iinclude/lib/dice |
| 256 |
else |
| 257 |
$(info Including rse_measured_boot.mk) |
| 258 |
include drivers/measured_boot/rse/rse_measured_boot.mk |
| 259 |
|
| 260 |
BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \ |
| 261 |
plat/arm/board/tc/tc_common_measured_boot.c \ |
| 262 |
plat/arm/board/tc/tc_bl1_measured_boot.c \ |
| 263 |
lib/psa/measured_boot.c |
| 264 |
|
| 265 |
BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \ |
| 266 |
plat/arm/board/tc/tc_common_measured_boot.c \ |
| 267 |
plat/arm/board/tc/tc_bl2_measured_boot.c \ |
| 268 |
lib/psa/measured_boot.c |
| 269 |
endif |
| 270 |
endif |
| 271 |
|
| 272 |
ifeq (${TRNG_SUPPORT},1) |
| 273 |
BL31_SOURCES += plat/arm/board/tc/tc_trng.c |
| 274 |
endif |
| 275 |
|
| 276 |
ifneq (${PLATFORM_TEST},) |
| 277 |
# Add this include as first, before arm_common.mk. This is necessary |
| 278 |
# because arm_common.mk builds Mbed TLS, and platform_test.mk can |
| 279 |
# change the list of Mbed TLS files that are to be compiled |
| 280 |
# (LIBMBEDTLS_SRCS). |
| 281 |
include plat/arm/board/tc/platform_test.mk |
| 282 |
endif |
| 283 |
|
| 284 |
|
| 285 |
include plat/arm/common/arm_common.mk |
| 286 |
include plat/arm/css/common/css_common.mk |
| 287 |
include plat/arm/board/common/board_common.mk |