xref: /arm-trusted-firmware/plat/arm/board/fvp/platform.mk (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700Schasinglulu#
2*91f16700Schasinglulu# Copyright (c) 2013-2023, Arm Limited and Contributors. All rights reserved.
3*91f16700Schasinglulu#
4*91f16700Schasinglulu# SPDX-License-Identifier: BSD-3-Clause
5*91f16700Schasinglulu#
6*91f16700Schasinglulu
7*91f16700Schasingluluinclude common/fdt_wrappers.mk
8*91f16700Schasinglulu
9*91f16700Schasinglulu# Use the GICv3 driver on the FVP by default
10*91f16700SchasingluluFVP_USE_GIC_DRIVER	:= FVP_GICV3
11*91f16700Schasinglulu
12*91f16700Schasinglulu# Default cluster count for FVP
13*91f16700SchasingluluFVP_CLUSTER_COUNT	:= 2
14*91f16700Schasinglulu
15*91f16700Schasinglulu# Default number of CPUs per cluster on FVP
16*91f16700SchasingluluFVP_MAX_CPUS_PER_CLUSTER	:= 4
17*91f16700Schasinglulu
18*91f16700Schasinglulu# Default number of threads per CPU on FVP
19*91f16700SchasingluluFVP_MAX_PE_PER_CPU	:= 1
20*91f16700Schasinglulu
21*91f16700Schasinglulu# Disable redistributor frame of inactive/fused CPU cores by marking it as read
22*91f16700Schasinglulu# only; enable redistributor frames of all CPU cores by default.
23*91f16700SchasingluluFVP_GICR_REGION_PROTECTION		:= 0
24*91f16700Schasinglulu
25*91f16700SchasingluluFVP_DT_PREFIX		:= fvp-base-gicv3-psci
26*91f16700Schasinglulu
27*91f16700Schasinglulu# Size (in kilobytes) of the Trusted SRAM region to  utilize when building for
28*91f16700Schasinglulu# the FVP platform. This option defaults to 256.
29*91f16700SchasingluluFVP_TRUSTED_SRAM_SIZE	:= 256
30*91f16700Schasinglulu
31*91f16700Schasinglulu# Macro to enable helpers for running SPM tests. Disabled by default.
32*91f16700SchasingluluPLAT_TEST_SPM	:= 0
33*91f16700Schasinglulu
34*91f16700Schasinglulu# This is a very trickly TEMPORARY fix. Enabling ALL features exceeds BL31's
35*91f16700Schasinglulu# progbits limit. We need a way to build all useful configurations while waiting
36*91f16700Schasinglulu# on the fvp to increase its SRAM size. The problem is twofild:
37*91f16700Schasinglulu#  1. the cleanup that introduced these enables cleaned up tf-a a little too
38*91f16700Schasinglulu#     well and things that previously (incorrectly) were enabled, no longer are.
39*91f16700Schasinglulu#     A bunch of CI configs build subtly incorrectly and this combo makes it
40*91f16700Schasinglulu#     necessary to forcefully and unconditionally enable them here.
41*91f16700Schasinglulu#  2. the progbits limit is exceeded only when the tsp is involved. However,
42*91f16700Schasinglulu#     there are tsp CI configs that run on very high architecture revisions so
43*91f16700Schasinglulu#     disabling everything isn't an option.
44*91f16700Schasinglulu# The fix is to enable everything, as before. When the tsp is included, though,
45*91f16700Schasinglulu# we need to slim the size down. In that case, disable all optional features,
46*91f16700Schasinglulu# that will not be present in CI when the tsp is.
47*91f16700Schasinglulu# Similarly, DRTM support is only tested on v8.0 models. Disable everything just
48*91f16700Schasinglulu# for it.
49*91f16700Schasinglulu# TODO: make all of this unconditional (or only base the condition on
50*91f16700Schasinglulu# ARM_ARCH_* when the makefile supports it).
51*91f16700Schasingluluifneq (${DRTM_SUPPORT}, 1)
52*91f16700Schasingluluifneq (${SPD}, tspd)
53*91f16700Schasinglulu	ENABLE_FEAT_AMU			:= 2
54*91f16700Schasinglulu	ENABLE_FEAT_AMUv1p1		:= 2
55*91f16700Schasinglulu	ENABLE_FEAT_HCX			:= 2
56*91f16700Schasinglulu	ENABLE_FEAT_RNG			:= 2
57*91f16700Schasinglulu	ENABLE_FEAT_TWED		:= 2
58*91f16700Schasinglulu	ENABLE_FEAT_GCS			:= 2
59*91f16700Schasingluluifeq (${ARCH}, aarch64)
60*91f16700Schasingluluifneq (${SPD}, spmd)
61*91f16700Schasingluluifeq (${SPM_MM}, 0)
62*91f16700Schasingluluifeq (${CTX_INCLUDE_FPREGS}, 0)
63*91f16700Schasinglulu	ENABLE_SME_FOR_NS		:= 2
64*91f16700Schasinglulu	ENABLE_SME2_FOR_NS		:= 2
65*91f16700Schasingluluendif
66*91f16700Schasingluluendif
67*91f16700Schasingluluendif
68*91f16700Schasingluluendif
69*91f16700Schasingluluendif
70*91f16700Schasinglulu
71*91f16700Schasinglulu# enable unconditionally for all builds
72*91f16700Schasingluluifeq (${ARCH}, aarch64)
73*91f16700Schasinglulu    ENABLE_BRBE_FOR_NS		:= 2
74*91f16700Schasinglulu    ENABLE_TRBE_FOR_NS		:= 2
75*91f16700Schasingluluendif
76*91f16700SchasingluluENABLE_SYS_REG_TRACE_FOR_NS	:= 2
77*91f16700SchasingluluENABLE_FEAT_CSV2_2		:= 2
78*91f16700SchasingluluENABLE_FEAT_DIT			:= 2
79*91f16700SchasingluluENABLE_FEAT_PAN			:= 2
80*91f16700SchasingluluENABLE_FEAT_MTE_PERM		:= 2
81*91f16700SchasingluluENABLE_FEAT_VHE			:= 2
82*91f16700SchasingluluCTX_INCLUDE_NEVE_REGS		:= 2
83*91f16700SchasingluluENABLE_FEAT_SEL2		:= 2
84*91f16700SchasingluluENABLE_TRF_FOR_NS		:= 2
85*91f16700SchasingluluENABLE_FEAT_ECV			:= 2
86*91f16700SchasingluluENABLE_FEAT_FGT			:= 2
87*91f16700SchasingluluENABLE_FEAT_TCR2		:= 2
88*91f16700SchasingluluENABLE_FEAT_S2PIE		:= 2
89*91f16700SchasingluluENABLE_FEAT_S1PIE		:= 2
90*91f16700SchasingluluENABLE_FEAT_S2POE		:= 2
91*91f16700SchasingluluENABLE_FEAT_S1POE		:= 2
92*91f16700Schasingluluendif
93*91f16700Schasinglulu
94*91f16700Schasinglulu# The FVP platform depends on this macro to build with correct GIC driver.
95*91f16700Schasinglulu$(eval $(call add_define,FVP_USE_GIC_DRIVER))
96*91f16700Schasinglulu
97*91f16700Schasinglulu# Pass FVP_CLUSTER_COUNT to the build system.
98*91f16700Schasinglulu$(eval $(call add_define,FVP_CLUSTER_COUNT))
99*91f16700Schasinglulu
100*91f16700Schasinglulu# Pass FVP_MAX_CPUS_PER_CLUSTER to the build system.
101*91f16700Schasinglulu$(eval $(call add_define,FVP_MAX_CPUS_PER_CLUSTER))
102*91f16700Schasinglulu
103*91f16700Schasinglulu# Pass FVP_MAX_PE_PER_CPU to the build system.
104*91f16700Schasinglulu$(eval $(call add_define,FVP_MAX_PE_PER_CPU))
105*91f16700Schasinglulu
106*91f16700Schasinglulu# Pass FVP_GICR_REGION_PROTECTION to the build system.
107*91f16700Schasinglulu$(eval $(call add_define,FVP_GICR_REGION_PROTECTION))
108*91f16700Schasinglulu
109*91f16700Schasinglulu# Pass FVP_TRUSTED_SRAM_SIZE to the build system.
110*91f16700Schasinglulu$(eval $(call add_define,FVP_TRUSTED_SRAM_SIZE))
111*91f16700Schasinglulu
112*91f16700Schasinglulu# Sanity check the cluster count and if FVP_CLUSTER_COUNT <= 2,
113*91f16700Schasinglulu# choose the CCI driver , else the CCN driver
114*91f16700Schasingluluifeq ($(FVP_CLUSTER_COUNT), 0)
115*91f16700Schasinglulu$(error "Incorrect cluster count specified for FVP port")
116*91f16700Schasingluluelse ifeq ($(FVP_CLUSTER_COUNT),$(filter $(FVP_CLUSTER_COUNT),1 2))
117*91f16700SchasingluluFVP_INTERCONNECT_DRIVER := FVP_CCI
118*91f16700Schasingluluelse
119*91f16700SchasingluluFVP_INTERCONNECT_DRIVER := FVP_CCN
120*91f16700Schasingluluendif
121*91f16700Schasinglulu
122*91f16700Schasinglulu$(eval $(call add_define,FVP_INTERCONNECT_DRIVER))
123*91f16700Schasinglulu
124*91f16700Schasinglulu# Choose the GIC sources depending upon the how the FVP will be invoked
125*91f16700Schasingluluifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3)
126*91f16700Schasinglulu
127*91f16700Schasinglulu# The GIC model (GIC-600 or GIC-500) will be detected at runtime
128*91f16700SchasingluluGICV3_SUPPORT_GIC600		:=	1
129*91f16700SchasingluluGICV3_OVERRIDE_DISTIF_PWR_OPS	:=	1
130*91f16700Schasinglulu
131*91f16700Schasinglulu# Include GICv3 driver files
132*91f16700Schasingluluinclude drivers/arm/gic/v3/gicv3.mk
133*91f16700Schasinglulu
134*91f16700SchasingluluFVP_GIC_SOURCES		:=	${GICV3_SOURCES}			\
135*91f16700Schasinglulu				plat/common/plat_gicv3.c		\
136*91f16700Schasinglulu				plat/arm/common/arm_gicv3.c
137*91f16700Schasinglulu
138*91f16700Schasinglulu	ifeq ($(filter 1,${RESET_TO_BL2} \
139*91f16700Schasinglulu		${RESET_TO_BL31} ${RESET_TO_SP_MIN}),)
140*91f16700Schasinglulu		FVP_GIC_SOURCES += plat/arm/board/fvp/fvp_gicv3.c
141*91f16700Schasinglulu	endif
142*91f16700Schasinglulu
143*91f16700Schasingluluelse ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV2)
144*91f16700Schasinglulu
145*91f16700Schasinglulu# No GICv4 extension
146*91f16700SchasingluluGIC_ENABLE_V4_EXTN	:=	0
147*91f16700Schasinglulu$(eval $(call add_define,GIC_ENABLE_V4_EXTN))
148*91f16700Schasinglulu
149*91f16700Schasinglulu# Include GICv2 driver files
150*91f16700Schasingluluinclude drivers/arm/gic/v2/gicv2.mk
151*91f16700Schasinglulu
152*91f16700SchasingluluFVP_GIC_SOURCES		:=	${GICV2_SOURCES}			\
153*91f16700Schasinglulu				plat/common/plat_gicv2.c		\
154*91f16700Schasinglulu				plat/arm/common/arm_gicv2.c
155*91f16700Schasinglulu
156*91f16700SchasingluluFVP_DT_PREFIX		:=	fvp-base-gicv2-psci
157*91f16700Schasingluluelse
158*91f16700Schasinglulu$(error "Incorrect GIC driver chosen on FVP port")
159*91f16700Schasingluluendif
160*91f16700Schasinglulu
161*91f16700Schasingluluifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCI)
162*91f16700SchasingluluFVP_INTERCONNECT_SOURCES	:= 	drivers/arm/cci/cci.c
163*91f16700Schasingluluelse ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCN)
164*91f16700SchasingluluFVP_INTERCONNECT_SOURCES	:= 	drivers/arm/ccn/ccn.c		\
165*91f16700Schasinglulu					plat/arm/common/arm_ccn.c
166*91f16700Schasingluluelse
167*91f16700Schasinglulu$(error "Incorrect CCN driver chosen on FVP port")
168*91f16700Schasingluluendif
169*91f16700Schasinglulu
170*91f16700SchasingluluFVP_SECURITY_SOURCES	:=	drivers/arm/tzc/tzc400.c		\
171*91f16700Schasinglulu				plat/arm/board/fvp/fvp_security.c	\
172*91f16700Schasinglulu				plat/arm/common/arm_tzc400.c
173*91f16700Schasinglulu
174*91f16700Schasinglulu
175*91f16700SchasingluluPLAT_INCLUDES		:=	-Iplat/arm/board/fvp/include		\
176*91f16700Schasinglulu				-Iinclude/lib/psa
177*91f16700Schasinglulu
178*91f16700Schasinglulu
179*91f16700SchasingluluPLAT_BL_COMMON_SOURCES	:=	plat/arm/board/fvp/fvp_common.c
180*91f16700Schasinglulu
181*91f16700SchasingluluFVP_CPU_LIBS		:=	lib/cpus/${ARCH}/aem_generic.S
182*91f16700Schasinglulu
183*91f16700Schasingluluifeq (${ARCH}, aarch64)
184*91f16700Schasinglulu
185*91f16700Schasinglulu# select a different set of CPU files, depending on whether we compile for
186*91f16700Schasinglulu# hardware assisted coherency cores or not
187*91f16700Schasingluluifeq (${HW_ASSISTED_COHERENCY}, 0)
188*91f16700Schasinglulu# Cores used without DSU
189*91f16700Schasinglulu	FVP_CPU_LIBS	+=	lib/cpus/aarch64/cortex_a35.S			\
190*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a53.S			\
191*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a57.S			\
192*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a72.S			\
193*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a73.S
194*91f16700Schasingluluelse
195*91f16700Schasinglulu# Cores used with DSU only
196*91f16700Schasinglulu	ifeq (${CTX_INCLUDE_AARCH32_REGS}, 0)
197*91f16700Schasinglulu	# AArch64-only cores
198*91f16700Schasinglulu	# TODO: add all cores to the appropriate lists
199*91f16700Schasinglulu		FVP_CPU_LIBS	+=	lib/cpus/aarch64/cortex_a65.S		\
200*91f16700Schasinglulu					lib/cpus/aarch64/cortex_a65ae.S		\
201*91f16700Schasinglulu					lib/cpus/aarch64/cortex_a76.S		\
202*91f16700Schasinglulu					lib/cpus/aarch64/cortex_a76ae.S		\
203*91f16700Schasinglulu					lib/cpus/aarch64/cortex_a77.S		\
204*91f16700Schasinglulu					lib/cpus/aarch64/cortex_a78.S		\
205*91f16700Schasinglulu					lib/cpus/aarch64/cortex_a78_ae.S	\
206*91f16700Schasinglulu					lib/cpus/aarch64/cortex_a78c.S		\
207*91f16700Schasinglulu					lib/cpus/aarch64/cortex_a710.S		\
208*91f16700Schasinglulu					lib/cpus/aarch64/neoverse_n_common.S	\
209*91f16700Schasinglulu					lib/cpus/aarch64/neoverse_n1.S		\
210*91f16700Schasinglulu					lib/cpus/aarch64/neoverse_n2.S		\
211*91f16700Schasinglulu					lib/cpus/aarch64/neoverse_v1.S		\
212*91f16700Schasinglulu					lib/cpus/aarch64/neoverse_e1.S		\
213*91f16700Schasinglulu					lib/cpus/aarch64/cortex_x2.S		\
214*91f16700Schasinglulu					lib/cpus/aarch64/cortex_gelas.S		\
215*91f16700Schasinglulu					lib/cpus/aarch64/nevis.S		\
216*91f16700Schasinglulu					lib/cpus/aarch64/travis.S
217*91f16700Schasinglulu	endif
218*91f16700Schasinglulu	# AArch64/AArch32 cores
219*91f16700Schasinglulu	FVP_CPU_LIBS	+=	lib/cpus/aarch64/cortex_a55.S		\
220*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a75.S
221*91f16700Schasingluluendif
222*91f16700Schasinglulu
223*91f16700Schasingluluelse
224*91f16700SchasingluluFVP_CPU_LIBS		+=	lib/cpus/aarch32/cortex_a32.S			\
225*91f16700Schasinglulu				lib/cpus/aarch32/cortex_a57.S			\
226*91f16700Schasinglulu				lib/cpus/aarch32/cortex_a53.S
227*91f16700Schasingluluendif
228*91f16700Schasinglulu
229*91f16700SchasingluluBL1_SOURCES		+=	drivers/arm/smmu/smmu_v3.c			\
230*91f16700Schasinglulu				drivers/arm/sp805/sp805.c			\
231*91f16700Schasinglulu				drivers/delay_timer/delay_timer.c		\
232*91f16700Schasinglulu				drivers/io/io_semihosting.c			\
233*91f16700Schasinglulu				lib/semihosting/semihosting.c			\
234*91f16700Schasinglulu				lib/semihosting/${ARCH}/semihosting_call.S	\
235*91f16700Schasinglulu				plat/arm/board/fvp/${ARCH}/fvp_helpers.S	\
236*91f16700Schasinglulu				plat/arm/board/fvp/fvp_bl1_setup.c		\
237*91f16700Schasinglulu				plat/arm/board/fvp/fvp_err.c			\
238*91f16700Schasinglulu				plat/arm/board/fvp/fvp_io_storage.c		\
239*91f16700Schasinglulu				${FVP_CPU_LIBS}					\
240*91f16700Schasinglulu				${FVP_INTERCONNECT_SOURCES}
241*91f16700Schasinglulu
242*91f16700Schasingluluifeq (${USE_SP804_TIMER},1)
243*91f16700SchasingluluBL1_SOURCES		+=	drivers/arm/sp804/sp804_delay_timer.c
244*91f16700Schasingluluelse
245*91f16700SchasingluluBL1_SOURCES		+=	drivers/delay_timer/generic_delay_timer.c
246*91f16700Schasingluluendif
247*91f16700Schasinglulu
248*91f16700Schasinglulu
249*91f16700SchasingluluBL2_SOURCES		+=	drivers/arm/sp805/sp805.c			\
250*91f16700Schasinglulu				drivers/io/io_semihosting.c			\
251*91f16700Schasinglulu				lib/utils/mem_region.c				\
252*91f16700Schasinglulu				lib/semihosting/semihosting.c			\
253*91f16700Schasinglulu				lib/semihosting/${ARCH}/semihosting_call.S	\
254*91f16700Schasinglulu				plat/arm/board/fvp/fvp_bl2_setup.c		\
255*91f16700Schasinglulu				plat/arm/board/fvp/fvp_err.c			\
256*91f16700Schasinglulu				plat/arm/board/fvp/fvp_io_storage.c		\
257*91f16700Schasinglulu				plat/arm/common/arm_nor_psci_mem_protect.c	\
258*91f16700Schasinglulu				${FVP_SECURITY_SOURCES}
259*91f16700Schasinglulu
260*91f16700Schasinglulu
261*91f16700Schasingluluifeq (${COT_DESC_IN_DTB},1)
262*91f16700SchasingluluBL2_SOURCES		+=	plat/arm/common/fconf/fconf_nv_cntr_getter.c
263*91f16700Schasingluluendif
264*91f16700Schasinglulu
265*91f16700Schasingluluifeq (${ENABLE_RME},1)
266*91f16700SchasingluluBL2_SOURCES		+=	plat/arm/board/fvp/aarch64/fvp_helpers.S
267*91f16700Schasinglulu
268*91f16700SchasingluluBL31_SOURCES		+=	plat/arm/board/fvp/fvp_plat_attest_token.c	\
269*91f16700Schasinglulu				plat/arm/board/fvp/fvp_realm_attest_key.c
270*91f16700Schasingluluendif
271*91f16700Schasinglulu
272*91f16700Schasingluluifeq (${ENABLE_FEAT_RNG_TRAP},1)
273*91f16700SchasingluluBL31_SOURCES		+=	plat/arm/board/fvp/fvp_sync_traps.c
274*91f16700Schasingluluendif
275*91f16700Schasinglulu
276*91f16700Schasingluluifeq (${RESET_TO_BL2},1)
277*91f16700SchasingluluBL2_SOURCES		+=	plat/arm/board/fvp/${ARCH}/fvp_helpers.S	\
278*91f16700Schasinglulu				plat/arm/board/fvp/fvp_bl2_el3_setup.c		\
279*91f16700Schasinglulu				${FVP_CPU_LIBS}					\
280*91f16700Schasinglulu				${FVP_INTERCONNECT_SOURCES}
281*91f16700Schasingluluendif
282*91f16700Schasinglulu
283*91f16700Schasingluluifeq (${USE_SP804_TIMER},1)
284*91f16700SchasingluluBL2_SOURCES		+=	drivers/arm/sp804/sp804_delay_timer.c
285*91f16700Schasingluluendif
286*91f16700Schasinglulu
287*91f16700SchasingluluBL2U_SOURCES		+=	plat/arm/board/fvp/fvp_bl2u_setup.c		\
288*91f16700Schasinglulu				${FVP_SECURITY_SOURCES}
289*91f16700Schasinglulu
290*91f16700Schasingluluifeq (${USE_SP804_TIMER},1)
291*91f16700SchasingluluBL2U_SOURCES		+=	drivers/arm/sp804/sp804_delay_timer.c
292*91f16700Schasingluluendif
293*91f16700Schasinglulu
294*91f16700SchasingluluBL31_SOURCES		+=	drivers/arm/fvp/fvp_pwrc.c			\
295*91f16700Schasinglulu				drivers/arm/smmu/smmu_v3.c			\
296*91f16700Schasinglulu				drivers/delay_timer/delay_timer.c		\
297*91f16700Schasinglulu				drivers/cfi/v2m/v2m_flash.c			\
298*91f16700Schasinglulu				lib/utils/mem_region.c				\
299*91f16700Schasinglulu				plat/arm/board/fvp/fvp_bl31_setup.c		\
300*91f16700Schasinglulu				plat/arm/board/fvp/fvp_console.c		\
301*91f16700Schasinglulu				plat/arm/board/fvp/fvp_pm.c			\
302*91f16700Schasinglulu				plat/arm/board/fvp/fvp_topology.c		\
303*91f16700Schasinglulu				plat/arm/board/fvp/aarch64/fvp_helpers.S	\
304*91f16700Schasinglulu				plat/arm/common/arm_nor_psci_mem_protect.c	\
305*91f16700Schasinglulu				${FVP_CPU_LIBS}					\
306*91f16700Schasinglulu				${FVP_GIC_SOURCES}				\
307*91f16700Schasinglulu				${FVP_INTERCONNECT_SOURCES}			\
308*91f16700Schasinglulu				${FVP_SECURITY_SOURCES}
309*91f16700Schasinglulu
310*91f16700Schasinglulu# Support for fconf in BL31
311*91f16700Schasinglulu# Added separately from the above list for better readability
312*91f16700Schasingluluifeq ($(filter 1,${RESET_TO_BL2} ${RESET_TO_BL31}),)
313*91f16700SchasingluluBL31_SOURCES		+=	lib/fconf/fconf.c				\
314*91f16700Schasinglulu				lib/fconf/fconf_dyn_cfg_getter.c		\
315*91f16700Schasinglulu				plat/arm/board/fvp/fconf/fconf_hw_config_getter.c
316*91f16700Schasinglulu
317*91f16700SchasingluluBL31_SOURCES		+=	${FDT_WRAPPERS_SOURCES}
318*91f16700Schasinglulu
319*91f16700Schasingluluifeq (${SEC_INT_DESC_IN_FCONF},1)
320*91f16700SchasingluluBL31_SOURCES		+=	plat/arm/common/fconf/fconf_sec_intr_config.c
321*91f16700Schasingluluendif
322*91f16700Schasinglulu
323*91f16700Schasingluluendif
324*91f16700Schasinglulu
325*91f16700Schasingluluifeq (${USE_SP804_TIMER},1)
326*91f16700SchasingluluBL31_SOURCES		+=	drivers/arm/sp804/sp804_delay_timer.c
327*91f16700Schasingluluelse
328*91f16700SchasingluluBL31_SOURCES		+=	drivers/delay_timer/generic_delay_timer.c
329*91f16700Schasingluluendif
330*91f16700Schasinglulu
331*91f16700Schasinglulu# Add the FDT_SOURCES and options for Dynamic Config (only for Unix env)
332*91f16700Schasingluluifdef UNIX_MK
333*91f16700SchasingluluFVP_HW_CONFIG_DTS	:=	fdts/${FVP_DT_PREFIX}.dts
334*91f16700SchasingluluFDT_SOURCES		+=	$(addprefix plat/arm/board/fvp/fdts/,	\
335*91f16700Schasinglulu					${PLAT}_fw_config.dts		\
336*91f16700Schasinglulu					${PLAT}_tb_fw_config.dts	\
337*91f16700Schasinglulu					${PLAT}_soc_fw_config.dts	\
338*91f16700Schasinglulu					${PLAT}_nt_fw_config.dts	\
339*91f16700Schasinglulu				)
340*91f16700Schasinglulu
341*91f16700SchasingluluFVP_FW_CONFIG		:=	${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
342*91f16700SchasingluluFVP_TB_FW_CONFIG	:=	${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
343*91f16700SchasingluluFVP_SOC_FW_CONFIG	:=	${BUILD_PLAT}/fdts/${PLAT}_soc_fw_config.dtb
344*91f16700SchasingluluFVP_NT_FW_CONFIG	:=	${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb
345*91f16700Schasinglulu
346*91f16700Schasingluluifeq (${SPD},tspd)
347*91f16700SchasingluluFDT_SOURCES		+=	plat/arm/board/fvp/fdts/${PLAT}_tsp_fw_config.dts
348*91f16700SchasingluluFVP_TOS_FW_CONFIG	:=	${BUILD_PLAT}/fdts/${PLAT}_tsp_fw_config.dtb
349*91f16700Schasinglulu
350*91f16700Schasinglulu# Add the TOS_FW_CONFIG to FIP and specify the same to certtool
351*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${FVP_TOS_FW_CONFIG},--tos-fw-config,${FVP_TOS_FW_CONFIG}))
352*91f16700Schasingluluendif
353*91f16700Schasinglulu
354*91f16700Schasingluluifeq (${TRANSFER_LIST}, 1)
355*91f16700Schasingluluinclude lib/transfer_list/transfer_list.mk
356*91f16700Schasingluluendif
357*91f16700Schasinglulu
358*91f16700Schasingluluifeq (${SPD},spmd)
359*91f16700Schasinglulu
360*91f16700Schasingluluifeq ($(ARM_SPMC_MANIFEST_DTS),)
361*91f16700SchasingluluARM_SPMC_MANIFEST_DTS	:=	plat/arm/board/fvp/fdts/${PLAT}_spmc_manifest.dts
362*91f16700Schasingluluendif
363*91f16700Schasinglulu
364*91f16700SchasingluluFDT_SOURCES		+=	${ARM_SPMC_MANIFEST_DTS}
365*91f16700SchasingluluFVP_TOS_FW_CONFIG	:=	${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
366*91f16700Schasinglulu
367*91f16700Schasinglulu# Add the TOS_FW_CONFIG to FIP and specify the same to certtool
368*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${FVP_TOS_FW_CONFIG},--tos-fw-config,${FVP_TOS_FW_CONFIG}))
369*91f16700Schasingluluendif
370*91f16700Schasinglulu
371*91f16700Schasinglulu# Add the FW_CONFIG to FIP and specify the same to certtool
372*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${FVP_FW_CONFIG},--fw-config,${FVP_FW_CONFIG}))
373*91f16700Schasinglulu# Add the TB_FW_CONFIG to FIP and specify the same to certtool
374*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${FVP_TB_FW_CONFIG},--tb-fw-config,${FVP_TB_FW_CONFIG}))
375*91f16700Schasinglulu# Add the SOC_FW_CONFIG to FIP and specify the same to certtool
376*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${FVP_SOC_FW_CONFIG},--soc-fw-config,${FVP_SOC_FW_CONFIG}))
377*91f16700Schasinglulu# Add the NT_FW_CONFIG to FIP and specify the same to certtool
378*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${FVP_NT_FW_CONFIG},--nt-fw-config,${FVP_NT_FW_CONFIG}))
379*91f16700Schasinglulu
380*91f16700SchasingluluFDT_SOURCES		+=	${FVP_HW_CONFIG_DTS}
381*91f16700Schasinglulu$(eval FVP_HW_CONFIG	:=	${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(FVP_HW_CONFIG_DTS)))
382*91f16700Schasinglulu
383*91f16700Schasinglulu# Add the HW_CONFIG to FIP and specify the same to certtool
384*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${FVP_HW_CONFIG},--hw-config,${FVP_HW_CONFIG}))
385*91f16700Schasingluluendif
386*91f16700Schasinglulu
387*91f16700Schasinglulu# Enable dynamic mitigation support by default
388*91f16700SchasingluluDYNAMIC_WORKAROUND_CVE_2018_3639	:=	1
389*91f16700Schasinglulu
390*91f16700Schasingluluifneq (${ENABLE_FEAT_AMU},0)
391*91f16700SchasingluluBL31_SOURCES		+=	lib/cpus/aarch64/cpuamu.c		\
392*91f16700Schasinglulu				lib/cpus/aarch64/cpuamu_helpers.S
393*91f16700Schasinglulu
394*91f16700Schasingluluifeq (${HW_ASSISTED_COHERENCY}, 1)
395*91f16700SchasingluluBL31_SOURCES		+=	lib/cpus/aarch64/cortex_a75_pubsub.c	\
396*91f16700Schasinglulu				lib/cpus/aarch64/neoverse_n1_pubsub.c
397*91f16700Schasingluluendif
398*91f16700Schasingluluendif
399*91f16700Schasinglulu
400*91f16700Schasingluluifeq (${HANDLE_EA_EL3_FIRST_NS},1)
401*91f16700Schasingluluifeq (${ENABLE_FEAT_RAS},1)
402*91f16700SchasingluluBL31_SOURCES		+=	plat/arm/board/fvp/aarch64/fvp_ras.c
403*91f16700Schasingluluelse
404*91f16700SchasingluluBL31_SOURCES		+= 	plat/arm/board/fvp/aarch64/fvp_ea.c
405*91f16700Schasingluluendif
406*91f16700Schasingluluendif
407*91f16700Schasinglulu
408*91f16700Schasingluluifneq (${ENABLE_STACK_PROTECTOR},0)
409*91f16700SchasingluluPLAT_BL_COMMON_SOURCES	+=	plat/arm/board/fvp/fvp_stack_protector.c
410*91f16700Schasingluluendif
411*91f16700Schasinglulu
412*91f16700Schasinglulu# Enable the dynamic translation tables library.
413*91f16700Schasingluluifeq ($(filter 1,${RESET_TO_BL2} ${ARM_XLAT_TABLES_LIB_V1}),)
414*91f16700Schasinglulu    ifeq (${ARCH},aarch32)
415*91f16700Schasinglulu        BL32_CPPFLAGS	+=	-DPLAT_XLAT_TABLES_DYNAMIC
416*91f16700Schasinglulu    else # AArch64
417*91f16700Schasinglulu        BL31_CPPFLAGS	+=	-DPLAT_XLAT_TABLES_DYNAMIC
418*91f16700Schasinglulu    endif
419*91f16700Schasingluluendif
420*91f16700Schasinglulu
421*91f16700Schasingluluifeq (${ALLOW_RO_XLAT_TABLES}, 1)
422*91f16700Schasinglulu    ifeq (${ARCH},aarch32)
423*91f16700Schasinglulu        BL32_CPPFLAGS	+=	-DPLAT_RO_XLAT_TABLES
424*91f16700Schasinglulu    else # AArch64
425*91f16700Schasinglulu        BL31_CPPFLAGS	+=	-DPLAT_RO_XLAT_TABLES
426*91f16700Schasinglulu        ifeq (${SPD},tspd)
427*91f16700Schasinglulu            BL32_CPPFLAGS +=	-DPLAT_RO_XLAT_TABLES
428*91f16700Schasinglulu        endif
429*91f16700Schasinglulu    endif
430*91f16700Schasingluluendif
431*91f16700Schasinglulu
432*91f16700Schasingluluifeq (${USE_DEBUGFS},1)
433*91f16700Schasinglulu    BL31_CPPFLAGS	+=	-DPLAT_XLAT_TABLES_DYNAMIC
434*91f16700Schasingluluendif
435*91f16700Schasinglulu
436*91f16700Schasinglulu# Add support for platform supplied linker script for BL31 build
437*91f16700Schasinglulu$(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
438*91f16700Schasinglulu
439*91f16700Schasingluluifneq (${RESET_TO_BL2}, 0)
440*91f16700Schasinglulu    override BL1_SOURCES =
441*91f16700Schasingluluendif
442*91f16700Schasinglulu
443*91f16700Schasinglulu# RSS is not supported on FVP right now. Thus, we use the mocked version
444*91f16700Schasinglulu# of the provided PSA APIs. They return with success and hard-coded token/key.
445*91f16700SchasingluluPLAT_RSS_NOT_SUPPORTED	:= 1
446*91f16700Schasinglulu
447*91f16700Schasinglulu# Include Measured Boot makefile before any Crypto library makefile.
448*91f16700Schasinglulu# Crypto library makefile may need default definitions of Measured Boot build
449*91f16700Schasinglulu# flags present in Measured Boot makefile.
450*91f16700Schasingluluifeq (${MEASURED_BOOT},1)
451*91f16700Schasinglulu    RSS_MEASURED_BOOT_MK := drivers/measured_boot/rss/rss_measured_boot.mk
452*91f16700Schasinglulu    $(info Including ${RSS_MEASURED_BOOT_MK})
453*91f16700Schasinglulu    include ${RSS_MEASURED_BOOT_MK}
454*91f16700Schasinglulu
455*91f16700Schasinglulu    ifneq (${MBOOT_RSS_HASH_ALG}, sha256)
456*91f16700Schasinglulu        $(eval $(call add_define,TF_MBEDTLS_MBOOT_USE_SHA512))
457*91f16700Schasinglulu    endif
458*91f16700Schasinglulu
459*91f16700Schasinglulu    BL1_SOURCES		+=	${MEASURED_BOOT_SOURCES}
460*91f16700Schasinglulu    BL2_SOURCES		+=	${MEASURED_BOOT_SOURCES}
461*91f16700Schasingluluendif
462*91f16700Schasinglulu
463*91f16700Schasingluluinclude plat/arm/board/common/board_common.mk
464*91f16700Schasingluluinclude plat/arm/common/arm_common.mk
465*91f16700Schasinglulu
466*91f16700Schasingluluifeq (${MEASURED_BOOT},1)
467*91f16700SchasingluluBL1_SOURCES		+=	plat/arm/board/fvp/fvp_common_measured_boot.c	\
468*91f16700Schasinglulu				plat/arm/board/fvp/fvp_bl1_measured_boot.c	\
469*91f16700Schasinglulu				lib/psa/measured_boot.c
470*91f16700Schasinglulu
471*91f16700SchasingluluBL2_SOURCES		+=	plat/arm/board/fvp/fvp_common_measured_boot.c	\
472*91f16700Schasinglulu				plat/arm/board/fvp/fvp_bl2_measured_boot.c	\
473*91f16700Schasinglulu				lib/psa/measured_boot.c
474*91f16700Schasinglulu
475*91f16700Schasinglulu# Even though RSS is not supported on FVP (see above), we support overriding
476*91f16700Schasinglulu# PLAT_RSS_NOT_SUPPORTED from the command line, just for the purpose of building
477*91f16700Schasinglulu# the code to detect any build regressions. The resulting firmware will not be
478*91f16700Schasinglulu# functional.
479*91f16700Schasingluluifneq (${PLAT_RSS_NOT_SUPPORTED},1)
480*91f16700Schasinglulu    $(warning "RSS is not supported on FVP. The firmware will not be functional.")
481*91f16700Schasinglulu    include drivers/arm/rss/rss_comms.mk
482*91f16700Schasinglulu    BL1_SOURCES		+=	${RSS_COMMS_SOURCES}
483*91f16700Schasinglulu    BL2_SOURCES		+=	${RSS_COMMS_SOURCES}
484*91f16700Schasinglulu    BL31_SOURCES	+=	${RSS_COMMS_SOURCES}
485*91f16700Schasinglulu
486*91f16700Schasinglulu    BL1_CFLAGS		+=	-DPLAT_RSS_COMMS_PAYLOAD_MAX_SIZE=0
487*91f16700Schasinglulu    BL2_CFLAGS		+=	-DPLAT_RSS_COMMS_PAYLOAD_MAX_SIZE=0
488*91f16700Schasinglulu    BL31_CFLAGS		+=	-DPLAT_RSS_COMMS_PAYLOAD_MAX_SIZE=0
489*91f16700Schasingluluendif
490*91f16700Schasinglulu
491*91f16700Schasingluluendif
492*91f16700Schasinglulu
493*91f16700Schasingluluifeq (${DRTM_SUPPORT}, 1)
494*91f16700SchasingluluBL31_SOURCES   += plat/arm/board/fvp/fvp_drtm_addr.c	\
495*91f16700Schasinglulu		  plat/arm/board/fvp/fvp_drtm_dma_prot.c	\
496*91f16700Schasinglulu		  plat/arm/board/fvp/fvp_drtm_err.c	\
497*91f16700Schasinglulu		  plat/arm/board/fvp/fvp_drtm_measurement.c	\
498*91f16700Schasinglulu		  plat/arm/board/fvp/fvp_drtm_stub.c	\
499*91f16700Schasinglulu		  plat/arm/common/arm_dyn_cfg.c		\
500*91f16700Schasinglulu		  plat/arm/board/fvp/fvp_err.c
501*91f16700Schasingluluendif
502*91f16700Schasinglulu
503*91f16700Schasingluluifeq (${TRUSTED_BOARD_BOOT}, 1)
504*91f16700SchasingluluBL1_SOURCES		+=	plat/arm/board/fvp/fvp_trusted_boot.c
505*91f16700SchasingluluBL2_SOURCES		+=	plat/arm/board/fvp/fvp_trusted_boot.c
506*91f16700Schasinglulu
507*91f16700Schasinglulu# FVP being a development platform, enable capability to disable Authentication
508*91f16700Schasinglulu# dynamically if TRUSTED_BOARD_BOOT is set.
509*91f16700SchasingluluDYN_DISABLE_AUTH	:=	1
510*91f16700Schasingluluendif
511*91f16700Schasinglulu
512*91f16700Schasingluluifeq (${SPMC_AT_EL3}, 1)
513*91f16700SchasingluluPLAT_BL_COMMON_SOURCES	+=	plat/arm/board/fvp/fvp_el3_spmc.c
514*91f16700Schasingluluendif
515*91f16700Schasinglulu
516*91f16700SchasingluluPSCI_OS_INIT_MODE	:=	1
517*91f16700Schasinglulu
518*91f16700Schasingluluifeq (${SPD},spmd)
519*91f16700SchasingluluBL31_SOURCES	+=	plat/arm/board/fvp/fvp_spmd.c
520*91f16700Schasingluluendif
521*91f16700Schasinglulu
522*91f16700Schasinglulu# Test specific macros, keep them at bottom of this file
523*91f16700Schasinglulu$(eval $(call add_define,PLATFORM_TEST_EA_FFH))
524*91f16700Schasingluluifeq (${PLATFORM_TEST_EA_FFH}, 1)
525*91f16700Schasinglulu    ifeq (${FFH_SUPPORT}, 0)
526*91f16700Schasinglulu         $(error "PLATFORM_TEST_EA_FFH expects FFH_SUPPORT to be 1")
527*91f16700Schasinglulu    endif
528*91f16700Schasinglulu
529*91f16700Schasingluluendif
530*91f16700Schasinglulu
531*91f16700Schasinglulu$(eval $(call add_define,PLATFORM_TEST_RAS_FFH))
532*91f16700Schasingluluifeq (${PLATFORM_TEST_RAS_FFH}, 1)
533*91f16700Schasinglulu    ifeq (${ENABLE_FEAT_RAS}, 0)
534*91f16700Schasinglulu         $(error "PLATFORM_TEST_RAS_FFH expects ENABLE_FEAT_RAS to be 1")
535*91f16700Schasinglulu    endif
536*91f16700Schasinglulu    ifeq (${HANDLE_EA_EL3_FIRST_NS}, 0)
537*91f16700Schasinglulu         $(error "PLATFORM_TEST_RAS_FFH expects HANDLE_EA_EL3_FIRST_NS to be 1")
538*91f16700Schasinglulu    endif
539*91f16700Schasingluluendif
540*91f16700Schasinglulu
541*91f16700Schasingluluifeq (${ERRATA_ABI_SUPPORT}, 1)
542*91f16700Schasingluluinclude plat/arm/board/fvp/fvp_cpu_errata.mk
543*91f16700Schasingluluendif
544*91f16700Schasinglulu
545*91f16700Schasinglulu# Build macro necessary for running SPM tests on FVP platform
546*91f16700Schasinglulu$(eval $(call add_define,PLAT_TEST_SPM))
547