blob: cd5abd013049f695147b2447c6f1ae54afbf83b3 [file] [log] [blame]
Davidson Kd103f002023-07-03 11:54:45 +05301# Copyright (c) 2021-2024, Arm Limited. All rights reserved.
Usama Ariff1513622021-04-09 17:07:41 +01002#
3# SPDX-License-Identifier: BSD-3-Clause
4#
5
Chris Kaye9272152021-09-28 15:52:14 +01006include common/fdt_wrappers.mk
7
Boyan Karatotev192ad5d2023-12-12 15:59:01 +00008TARGET_FLAVOUR := fvp
Boyan Karatotev95562762023-11-15 11:54:33 +00009# DPU with SCMI may not necessarily work, so allow its independence
10TC_DPU_USE_SCMI_CLK := 1
Kshitij Sisodia090a6aa2023-11-22 17:03:45 +000011# 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
Boyan Karatotev192ad5d2023-12-12 15:59:01 +000015
Boyan Karatotevbaff7992023-12-27 15:49:18 +000016# System setup
17CSS_USE_SCMI_SDS_DRIVER := 1
18HW_ASSISTED_COHERENCY := 1
19USE_COHERENT_MEM := 0
20GIC_ENABLE_V4_EXTN := 1
21GICV3_SUPPORT_GIC600 := 1
22override NEED_BL2U := no
23override ARM_PLAT_MT := 1
24
25# CPU setup
26ARM_ARCH_MINOR := 7
27BRANCH_PROTECTION := 1
28ENABLE_FEAT_MPAM := 1 # default is 2, optimise
29ENABLE_SVE_FOR_NS := 2 # to show we use it
30ENABLE_SVE_FOR_SWD := 1
31ENABLE_TRBE_FOR_NS := 1
32ENABLE_SYS_REG_TRACE_FOR_NS := 1
33ENABLE_FEAT_AMU := 1
34ENABLE_AMU_FCONF := 1
35ENABLE_AMU_AUXILIARY_COUNTERS := 1
36ENABLE_MPMM := 1
37ENABLE_MPMM_FCONF := 1
38
39CTX_INCLUDE_AARCH32_REGS := 0
40
41ifeq (${SPD},spmd)
42 SPMD_SPM_AT_SEL2 := 1
Leo Yan1ee60eb2024-04-29 14:20:35 +010043 ENABLE_FEAT_MTE2 := 1
Boyan Karatotevbaff7992023-12-27 15:49:18 +000044 CTX_INCLUDE_PAUTH_REGS := 1
45endif
46
Sergio Alves4dd0e512023-12-06 15:24:44 +000047# TC RESOLUTION - LIST OF VALID OPTIONS (this impacts only FVP)
48TC_RESOLUTION_OPTIONS := 640x480p60 \
49 1920x1080p60
50# Set default to the 640x480p60 resolution mode
51TC_RESOLUTION ?= $(firstword $(TC_RESOLUTION_OPTIONS))
52
53# Check resolution option for FVP
54ifneq ($(filter ${TARGET_FLAVOUR}, fvp),)
55ifeq ($(filter ${TC_RESOLUTION}, ${TC_RESOLUTION_OPTIONS}),)
56 $(error TC_RESOLUTION is ${TC_RESOLUTION}, it must be: ${TC_RESOLUTION_OPTIONS})
57endif
58endif
Boyan Karatotevbaff7992023-12-27 15:49:18 +000059
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +000060ifneq ($(shell expr $(TARGET_PLATFORM) \<= 1), 0)
Manish V Badarkhec7570d12023-11-20 18:25:49 +000061 $(warning Platform ${PLAT}$(TARGET_PLATFORM) is deprecated. \
62 Some of the features might not work as expected)
63endif
64
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +000065ifeq ($(shell expr $(TARGET_PLATFORM) \<= 3), 0)
66 $(error TARGET_PLATFORM must be less than or equal to 3)
Usama Ariff1513622021-04-09 17:07:41 +010067endif
68
Boyan Karatotev192ad5d2023-12-12 15:59:01 +000069ifeq ($(filter ${TARGET_FLAVOUR}, fvp fpga),)
70 $(error TARGET_FLAVOUR must be fvp or fpga)
71endif
72
73$(eval $(call add_defines, \
74 TARGET_PLATFORM \
75 TARGET_FLAVOUR_$(call uppercase,${TARGET_FLAVOUR}) \
Sergio Alves4dd0e512023-12-06 15:24:44 +000076 TC_RESOLUTION_$(call uppercase,${TC_RESOLUTION}) \
Boyan Karatotev95562762023-11-15 11:54:33 +000077 TC_DPU_USE_SCMI_CLK \
Kshitij Sisodia090a6aa2023-11-22 17:03:45 +000078 TC_SCMI_PD_CTRL_EN \
79 TC_IOMMU_EN \
Boyan Karatotev192ad5d2023-12-12 15:59:01 +000080))
Olivier Deprez7e5597c2022-07-20 17:37:23 +020081
Usama Ariff1513622021-04-09 17:07:41 +010082CSS_LOAD_SCP_IMAGES := 1
83
Arvind Ram Prakashb4419202024-05-07 10:33:46 -050084# Save DSU PMU registers on cluster off and restore them on cluster on
85PRESERVE_DSU_PMU_REGS := 1
86
Jackson Cooper-Drivere1ce8452024-03-11 09:23:17 +000087# Specify MHU type based on platform
88ifneq ($(filter ${TARGET_PLATFORM}, 2),)
89 PLAT_MHU_VERSION := 2
90else
91 PLAT_MHU_VERSION := 3
92endif
93
Usama Ariff1513622021-04-09 17:07:41 +010094# Include GICv3 driver files
95include drivers/arm/gic/v3/gicv3.mk
96
97ENT_GIC_SOURCES := ${GICV3_SOURCES} \
98 plat/common/plat_gicv3.c \
99 plat/arm/common/arm_gicv3.c
100
Usama Ariff1513622021-04-09 17:07:41 +0100101TC_BASE = plat/arm/board/tc
102
Boyan Karatotev8dec1f52023-12-20 16:28:23 +0000103PLAT_INCLUDES += -I${TC_BASE}/include/ \
104 -I${TC_BASE}/fdts/
Usama Ariff1513622021-04-09 17:07:41 +0100105
Usama Ariff1513622021-04-09 17:07:41 +0100106# CPU libraries for TARGET_PLATFORM=1
107ifeq (${TARGET_PLATFORM}, 1)
Rupinderjit Singh820b3b62022-04-04 17:28:41 +0100108TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \
Rupinderjit Singh7e465552022-08-23 11:55:27 +0100109 lib/cpus/aarch64/cortex_a715.S \
110 lib/cpus/aarch64/cortex_x3.S
Usama Ariff1513622021-04-09 17:07:41 +0100111endif
112
Rupinderjit Singh820b3b62022-04-04 17:28:41 +0100113# CPU libraries for TARGET_PLATFORM=2
114ifeq (${TARGET_PLATFORM}, 2)
Govindraj Rajaca3caf02023-06-28 08:49:21 -0500115TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
Govindraj Raja37012fb2023-06-23 11:28:05 -0500116 lib/cpus/aarch64/cortex_a720.S \
Govindraj Raja0a120912023-06-23 11:09:31 -0500117 lib/cpus/aarch64/cortex_x4.S
Rupinderjit Singh820b3b62022-04-04 17:28:41 +0100118endif
119
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +0000120# CPU libraries for TARGET_PLATFORM=3
121ifeq (${TARGET_PLATFORM}, 3)
122TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
Govindraj Raja106437d2024-05-17 13:35:19 -0500123 lib/cpus/aarch64/cortex_a725.S \
Govindraj Raja82760142024-05-17 13:39:07 -0500124 lib/cpus/aarch64/cortex_x925.S
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +0000125endif
126
Usama Ariff1513622021-04-09 17:07:41 +0100127INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c
128
129PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \
130 ${TC_BASE}/include/tc_helpers.S
131
132BL1_SOURCES += ${INTERCONNECT_SOURCES} \
133 ${TC_CPU_SOURCES} \
134 ${TC_BASE}/tc_trusted_boot.c \
135 ${TC_BASE}/tc_err.c \
136 drivers/arm/sbsa/sbsa.c
137
Usama Ariff1513622021-04-09 17:07:41 +0100138BL2_SOURCES += ${TC_BASE}/tc_security.c \
139 ${TC_BASE}/tc_err.c \
140 ${TC_BASE}/tc_trusted_boot.c \
Usama Arifa49bd492021-08-17 17:57:10 +0100141 ${TC_BASE}/tc_bl2_setup.c \
Usama Ariff1513622021-04-09 17:07:41 +0100142 lib/utils/mem_region.c \
143 drivers/arm/tzc/tzc400.c \
144 plat/arm/common/arm_tzc400.c \
145 plat/arm/common/arm_nor_psci_mem_protect.c
146
147BL31_SOURCES += ${INTERCONNECT_SOURCES} \
148 ${TC_CPU_SOURCES} \
149 ${ENT_GIC_SOURCES} \
150 ${TC_BASE}/tc_bl31_setup.c \
151 ${TC_BASE}/tc_topology.c \
Usama Arifa49bd492021-08-17 17:57:10 +0100152 lib/fconf/fconf.c \
153 lib/fconf/fconf_dyn_cfg_getter.c \
Arvind Ram Prakashb4419202024-05-07 10:33:46 -0500154 drivers/arm/css/dsu/dsu.c \
Usama Ariff1513622021-04-09 17:07:41 +0100155 drivers/cfi/v2m/v2m_flash.c \
156 lib/utils/mem_region.c \
Madhukar Pappireddye108df22023-03-22 15:40:40 -0500157 plat/arm/common/arm_nor_psci_mem_protect.c \
158 drivers/arm/sbsa/sbsa.c
Usama Ariff1513622021-04-09 17:07:41 +0100159
Chris Kaye9272152021-09-28 15:52:14 +0100160BL31_SOURCES += ${FDT_WRAPPERS_SOURCES}
161
Usama Ariff1513622021-04-09 17:07:41 +0100162# Add the FDT_SOURCES and options for Dynamic Config
163FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \
Tamas Banf879bf12023-06-12 11:26:28 +0200164 ${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts \
165 ${TC_BASE}/fdts/${PLAT}_nt_fw_config.dts
Usama Ariff1513622021-04-09 17:07:41 +0100166FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
167TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
Tamas Banf879bf12023-06-12 11:26:28 +0200168FVP_NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb
Usama Ariff1513622021-04-09 17:07:41 +0100169
170# Add the FW_CONFIG to FIP and specify the same to certtool
171$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
172# Add the TB_FW_CONFIG to FIP and specify the same to certtool
173$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
Tamas Banf879bf12023-06-12 11:26:28 +0200174# Add the NT_FW_CONFIG to FIP and specify the same to certtool
175$(eval $(call TOOL_ADD_PAYLOAD,${FVP_NT_FW_CONFIG},--nt-fw-config,${FVP_NT_FW_CONFIG}))
Usama Ariff1513622021-04-09 17:07:41 +0100176
177ifeq (${SPD},spmd)
178ifeq ($(ARM_SPMC_MANIFEST_DTS),)
Boyan Karatotev8dec1f52023-12-20 16:28:23 +0000179ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_test_manifest.dts
Usama Ariff1513622021-04-09 17:07:41 +0100180endif
181
182FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS}
183TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
184
185# Add the TOS_FW_CONFIG to FIP and specify the same to certtool
186$(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG}))
187endif
188
189#Device tree
Leo Yanb4d71342024-04-14 08:27:39 +0100190TC_HW_CONFIG_DTS := fdts/${PLAT}${TARGET_PLATFORM}.dts
Usama Ariff1513622021-04-09 17:07:41 +0100191TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb
192FDT_SOURCES += ${TC_HW_CONFIG_DTS}
193$(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS)))
194
195# Add the HW_CONFIG to FIP and specify the same to certtool
196$(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG}))
197
Tamas Banede4f052022-09-16 16:26:15 +0200198# Include Measured Boot makefile before any Crypto library makefile.
199# Crypto library makefile may need default definitions of Measured Boot build
200# flags present in Measured Boot makefile.
Tamas Bandc15bf42024-02-22 11:35:28 +0100201$(info Including rse_comms.mk)
Tamas Banede4f052022-09-16 16:26:15 +0200202ifeq (${MEASURED_BOOT},1)
Tamas Bandc15bf42024-02-22 11:35:28 +0100203 $(info Including rse_comms.mk)
204 include drivers/arm/rse/rse_comms.mk
Tamas Banede4f052022-09-16 16:26:15 +0200205
Tamas Bandc15bf42024-02-22 11:35:28 +0100206 BL1_SOURCES += ${RSE_COMMS_SOURCES}
207 BL2_SOURCES += ${RSE_COMMS_SOURCES}
Tamas Bana4260892023-06-07 13:35:04 +0200208 PLAT_INCLUDES += -Iinclude/lib/psa
209
210 ifeq (${DICE_PROTECTION_ENVIRONMENT},1)
211 $(info Including qcbor.mk)
Tamas Bandc15bf42024-02-22 11:35:28 +0100212 include drivers/measured_boot/rse/qcbor.mk
Tamas Bana4260892023-06-07 13:35:04 +0200213 $(info Including dice_prot_env.mk)
Tamas Bandc15bf42024-02-22 11:35:28 +0100214 include drivers/measured_boot/rse/dice_prot_env.mk
Tamas Bana4260892023-06-07 13:35:04 +0200215
216 BL1_SOURCES += ${QCBOR_SOURCES} \
217 ${DPE_SOURCES} \
218 plat/arm/board/tc/tc_common_dpe.c \
219 plat/arm/board/tc/tc_bl1_dpe.c \
Tamas Banae33fa92023-06-07 14:18:46 +0200220 lib/psa/dice_protection_environment.c \
221 drivers/arm/css/sds/sds.c \
222 drivers/delay_timer/delay_timer.c \
223 drivers/delay_timer/generic_delay_timer.c
Tamas Bana4260892023-06-07 13:35:04 +0200224
225 BL2_SOURCES += ${QCBOR_SOURCES} \
226 ${DPE_SOURCES} \
227 plat/arm/board/tc/tc_common_dpe.c \
228 plat/arm/board/tc/tc_bl2_dpe.c \
229 lib/psa/dice_protection_environment.c
230
231 PLAT_INCLUDES += -I${QCBOR_INCLUDES} \
232 -Iinclude/lib/dice
233 else
Tamas Bandc15bf42024-02-22 11:35:28 +0100234 $(info Including rse_measured_boot.mk)
235 include drivers/measured_boot/rse/rse_measured_boot.mk
Tamas Bana4260892023-06-07 13:35:04 +0200236
237 BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \
Tamas Banede4f052022-09-16 16:26:15 +0200238 plat/arm/board/tc/tc_common_measured_boot.c \
239 plat/arm/board/tc/tc_bl1_measured_boot.c \
Tamas Bana4260892023-06-07 13:35:04 +0200240 lib/psa/measured_boot.c
Tamas Banede4f052022-09-16 16:26:15 +0200241
Tamas Bana4260892023-06-07 13:35:04 +0200242 BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \
Tamas Banede4f052022-09-16 16:26:15 +0200243 plat/arm/board/tc/tc_common_measured_boot.c \
244 plat/arm/board/tc/tc_bl2_measured_boot.c \
Tamas Bana4260892023-06-07 13:35:04 +0200245 lib/psa/measured_boot.c
246 endif
Tamas Banede4f052022-09-16 16:26:15 +0200247endif
248
David Vincze2cbc56b2024-01-04 18:37:12 +0100249ifeq (${TRNG_SUPPORT},1)
250 BL31_SOURCES += plat/arm/board/tc/tc_trng.c
251endif
252
laurenw-arm4c4181c2023-05-04 14:55:37 -0500253ifneq (${PLATFORM_TEST},)
laurenw-arm15aac382023-07-17 12:32:46 -0500254 # Add this include as first, before arm_common.mk. This is necessary
255 # because arm_common.mk builds Mbed TLS, and platform_test.mk can
256 # change the list of Mbed TLS files that are to be compiled
257 # (LIBMBEDTLS_SRCS).
258 include plat/arm/board/tc/platform_test.mk
laurenw-arm2ce1e352023-02-07 13:40:05 -0600259endif
260
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +0200261
Usama Ariff1513622021-04-09 17:07:41 +0100262include plat/arm/common/arm_common.mk
263include plat/arm/css/common/css_common.mk
264include plat/arm/soc/common/soc_css.mk
265include plat/arm/board/common/board_common.mk