blob: 28b98c2818ba830bbe4cec4b11fc0c1e6708bd25 [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
Boyan Karatotev192ad5d2023-12-12 15:59:01 +000013
Boyan Karatotevbaff7992023-12-27 15:49:18 +000014# System setup
15CSS_USE_SCMI_SDS_DRIVER := 1
16HW_ASSISTED_COHERENCY := 1
17USE_COHERENT_MEM := 0
18GIC_ENABLE_V4_EXTN := 1
19GICV3_SUPPORT_GIC600 := 1
20override NEED_BL2U := no
21override ARM_PLAT_MT := 1
22
23# CPU setup
24ARM_ARCH_MINOR := 7
25BRANCH_PROTECTION := 1
26ENABLE_FEAT_MPAM := 1 # default is 2, optimise
27ENABLE_SVE_FOR_NS := 2 # to show we use it
28ENABLE_SVE_FOR_SWD := 1
29ENABLE_TRBE_FOR_NS := 1
30ENABLE_SYS_REG_TRACE_FOR_NS := 1
31ENABLE_FEAT_AMU := 1
32ENABLE_AMU_FCONF := 1
33ENABLE_AMU_AUXILIARY_COUNTERS := 1
34ENABLE_MPMM := 1
35ENABLE_MPMM_FCONF := 1
36
37CTX_INCLUDE_AARCH32_REGS := 0
38
39ifeq (${SPD},spmd)
40 SPMD_SPM_AT_SEL2 := 1
Leo Yan1ee60eb2024-04-29 14:20:35 +010041 ENABLE_FEAT_MTE2 := 1
Boyan Karatotevbaff7992023-12-27 15:49:18 +000042 CTX_INCLUDE_PAUTH_REGS := 1
43endif
44
Sergio Alves4dd0e512023-12-06 15:24:44 +000045# TC RESOLUTION - LIST OF VALID OPTIONS (this impacts only FVP)
46TC_RESOLUTION_OPTIONS := 640x480p60 \
47 1920x1080p60
48# Set default to the 640x480p60 resolution mode
49TC_RESOLUTION ?= $(firstword $(TC_RESOLUTION_OPTIONS))
50
51# Check resolution option for FVP
52ifneq ($(filter ${TARGET_FLAVOUR}, fvp),)
53ifeq ($(filter ${TC_RESOLUTION}, ${TC_RESOLUTION_OPTIONS}),)
54 $(error TC_RESOLUTION is ${TC_RESOLUTION}, it must be: ${TC_RESOLUTION_OPTIONS})
55endif
56endif
Boyan Karatotevbaff7992023-12-27 15:49:18 +000057
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +000058ifneq ($(shell expr $(TARGET_PLATFORM) \<= 1), 0)
Manish V Badarkhec7570d12023-11-20 18:25:49 +000059 $(warning Platform ${PLAT}$(TARGET_PLATFORM) is deprecated. \
60 Some of the features might not work as expected)
61endif
62
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +000063ifeq ($(shell expr $(TARGET_PLATFORM) \<= 3), 0)
64 $(error TARGET_PLATFORM must be less than or equal to 3)
Usama Ariff1513622021-04-09 17:07:41 +010065endif
66
Boyan Karatotev192ad5d2023-12-12 15:59:01 +000067ifeq ($(filter ${TARGET_FLAVOUR}, fvp fpga),)
68 $(error TARGET_FLAVOUR must be fvp or fpga)
69endif
70
71$(eval $(call add_defines, \
72 TARGET_PLATFORM \
73 TARGET_FLAVOUR_$(call uppercase,${TARGET_FLAVOUR}) \
Sergio Alves4dd0e512023-12-06 15:24:44 +000074 TC_RESOLUTION_$(call uppercase,${TC_RESOLUTION}) \
Boyan Karatotev95562762023-11-15 11:54:33 +000075 TC_DPU_USE_SCMI_CLK \
Kshitij Sisodia090a6aa2023-11-22 17:03:45 +000076 TC_SCMI_PD_CTRL_EN \
Boyan Karatotev192ad5d2023-12-12 15:59:01 +000077))
Olivier Deprez7e5597c2022-07-20 17:37:23 +020078
Usama Ariff1513622021-04-09 17:07:41 +010079CSS_LOAD_SCP_IMAGES := 1
80
Arvind Ram Prakashb4419202024-05-07 10:33:46 -050081# Save DSU PMU registers on cluster off and restore them on cluster on
82PRESERVE_DSU_PMU_REGS := 1
83
Jackson Cooper-Drivere1ce8452024-03-11 09:23:17 +000084# Specify MHU type based on platform
85ifneq ($(filter ${TARGET_PLATFORM}, 2),)
86 PLAT_MHU_VERSION := 2
87else
88 PLAT_MHU_VERSION := 3
89endif
90
Usama Ariff1513622021-04-09 17:07:41 +010091# Include GICv3 driver files
92include drivers/arm/gic/v3/gicv3.mk
93
94ENT_GIC_SOURCES := ${GICV3_SOURCES} \
95 plat/common/plat_gicv3.c \
96 plat/arm/common/arm_gicv3.c
97
Usama Ariff1513622021-04-09 17:07:41 +010098TC_BASE = plat/arm/board/tc
99
Boyan Karatotev8dec1f52023-12-20 16:28:23 +0000100PLAT_INCLUDES += -I${TC_BASE}/include/ \
101 -I${TC_BASE}/fdts/
Usama Ariff1513622021-04-09 17:07:41 +0100102
Usama Ariff1513622021-04-09 17:07:41 +0100103# CPU libraries for TARGET_PLATFORM=1
104ifeq (${TARGET_PLATFORM}, 1)
Rupinderjit Singh820b3b62022-04-04 17:28:41 +0100105TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \
Rupinderjit Singh7e465552022-08-23 11:55:27 +0100106 lib/cpus/aarch64/cortex_a715.S \
107 lib/cpus/aarch64/cortex_x3.S
Usama Ariff1513622021-04-09 17:07:41 +0100108endif
109
Rupinderjit Singh820b3b62022-04-04 17:28:41 +0100110# CPU libraries for TARGET_PLATFORM=2
111ifeq (${TARGET_PLATFORM}, 2)
Govindraj Rajaca3caf02023-06-28 08:49:21 -0500112TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
Govindraj Raja37012fb2023-06-23 11:28:05 -0500113 lib/cpus/aarch64/cortex_a720.S \
Govindraj Raja0a120912023-06-23 11:09:31 -0500114 lib/cpus/aarch64/cortex_x4.S
Rupinderjit Singh820b3b62022-04-04 17:28:41 +0100115endif
116
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +0000117# CPU libraries for TARGET_PLATFORM=3
118ifeq (${TARGET_PLATFORM}, 3)
119TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
Govindraj Raja106437d2024-05-17 13:35:19 -0500120 lib/cpus/aarch64/cortex_a725.S \
Govindraj Raja82760142024-05-17 13:39:07 -0500121 lib/cpus/aarch64/cortex_x925.S
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +0000122endif
123
Usama Ariff1513622021-04-09 17:07:41 +0100124INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c
125
126PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \
127 ${TC_BASE}/include/tc_helpers.S
128
129BL1_SOURCES += ${INTERCONNECT_SOURCES} \
130 ${TC_CPU_SOURCES} \
131 ${TC_BASE}/tc_trusted_boot.c \
132 ${TC_BASE}/tc_err.c \
133 drivers/arm/sbsa/sbsa.c
134
Usama Ariff1513622021-04-09 17:07:41 +0100135BL2_SOURCES += ${TC_BASE}/tc_security.c \
136 ${TC_BASE}/tc_err.c \
137 ${TC_BASE}/tc_trusted_boot.c \
Usama Arifa49bd492021-08-17 17:57:10 +0100138 ${TC_BASE}/tc_bl2_setup.c \
Usama Ariff1513622021-04-09 17:07:41 +0100139 lib/utils/mem_region.c \
140 drivers/arm/tzc/tzc400.c \
141 plat/arm/common/arm_tzc400.c \
142 plat/arm/common/arm_nor_psci_mem_protect.c
143
144BL31_SOURCES += ${INTERCONNECT_SOURCES} \
145 ${TC_CPU_SOURCES} \
146 ${ENT_GIC_SOURCES} \
147 ${TC_BASE}/tc_bl31_setup.c \
148 ${TC_BASE}/tc_topology.c \
Usama Arifa49bd492021-08-17 17:57:10 +0100149 lib/fconf/fconf.c \
150 lib/fconf/fconf_dyn_cfg_getter.c \
Arvind Ram Prakashb4419202024-05-07 10:33:46 -0500151 drivers/arm/css/dsu/dsu.c \
Usama Ariff1513622021-04-09 17:07:41 +0100152 drivers/cfi/v2m/v2m_flash.c \
153 lib/utils/mem_region.c \
Madhukar Pappireddye108df22023-03-22 15:40:40 -0500154 plat/arm/common/arm_nor_psci_mem_protect.c \
155 drivers/arm/sbsa/sbsa.c
Usama Ariff1513622021-04-09 17:07:41 +0100156
Chris Kaye9272152021-09-28 15:52:14 +0100157BL31_SOURCES += ${FDT_WRAPPERS_SOURCES}
158
Usama Ariff1513622021-04-09 17:07:41 +0100159# Add the FDT_SOURCES and options for Dynamic Config
160FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \
Tamas Banf879bf12023-06-12 11:26:28 +0200161 ${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts \
162 ${TC_BASE}/fdts/${PLAT}_nt_fw_config.dts
Usama Ariff1513622021-04-09 17:07:41 +0100163FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
164TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
Tamas Banf879bf12023-06-12 11:26:28 +0200165FVP_NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb
Usama Ariff1513622021-04-09 17:07:41 +0100166
167# Add the FW_CONFIG to FIP and specify the same to certtool
168$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
169# Add the TB_FW_CONFIG to FIP and specify the same to certtool
170$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
Tamas Banf879bf12023-06-12 11:26:28 +0200171# Add the NT_FW_CONFIG to FIP and specify the same to certtool
172$(eval $(call TOOL_ADD_PAYLOAD,${FVP_NT_FW_CONFIG},--nt-fw-config,${FVP_NT_FW_CONFIG}))
Usama Ariff1513622021-04-09 17:07:41 +0100173
174ifeq (${SPD},spmd)
175ifeq ($(ARM_SPMC_MANIFEST_DTS),)
Boyan Karatotev8dec1f52023-12-20 16:28:23 +0000176ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_test_manifest.dts
Usama Ariff1513622021-04-09 17:07:41 +0100177endif
178
179FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS}
180TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
181
182# Add the TOS_FW_CONFIG to FIP and specify the same to certtool
183$(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG}))
184endif
185
186#Device tree
Leo Yanb4d71342024-04-14 08:27:39 +0100187TC_HW_CONFIG_DTS := fdts/${PLAT}${TARGET_PLATFORM}.dts
Usama Ariff1513622021-04-09 17:07:41 +0100188TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb
189FDT_SOURCES += ${TC_HW_CONFIG_DTS}
190$(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS)))
191
192# Add the HW_CONFIG to FIP and specify the same to certtool
193$(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG}))
194
Tamas Banede4f052022-09-16 16:26:15 +0200195# Include Measured Boot makefile before any Crypto library makefile.
196# Crypto library makefile may need default definitions of Measured Boot build
197# flags present in Measured Boot makefile.
Tamas Bandc15bf42024-02-22 11:35:28 +0100198$(info Including rse_comms.mk)
Tamas Banede4f052022-09-16 16:26:15 +0200199ifeq (${MEASURED_BOOT},1)
Tamas Bandc15bf42024-02-22 11:35:28 +0100200 $(info Including rse_comms.mk)
201 include drivers/arm/rse/rse_comms.mk
Tamas Banede4f052022-09-16 16:26:15 +0200202
Tamas Bandc15bf42024-02-22 11:35:28 +0100203 BL1_SOURCES += ${RSE_COMMS_SOURCES}
204 BL2_SOURCES += ${RSE_COMMS_SOURCES}
Tamas Bana4260892023-06-07 13:35:04 +0200205 PLAT_INCLUDES += -Iinclude/lib/psa
206
207 ifeq (${DICE_PROTECTION_ENVIRONMENT},1)
208 $(info Including qcbor.mk)
Tamas Bandc15bf42024-02-22 11:35:28 +0100209 include drivers/measured_boot/rse/qcbor.mk
Tamas Bana4260892023-06-07 13:35:04 +0200210 $(info Including dice_prot_env.mk)
Tamas Bandc15bf42024-02-22 11:35:28 +0100211 include drivers/measured_boot/rse/dice_prot_env.mk
Tamas Bana4260892023-06-07 13:35:04 +0200212
213 BL1_SOURCES += ${QCBOR_SOURCES} \
214 ${DPE_SOURCES} \
215 plat/arm/board/tc/tc_common_dpe.c \
216 plat/arm/board/tc/tc_bl1_dpe.c \
Tamas Banae33fa92023-06-07 14:18:46 +0200217 lib/psa/dice_protection_environment.c \
218 drivers/arm/css/sds/sds.c \
219 drivers/delay_timer/delay_timer.c \
220 drivers/delay_timer/generic_delay_timer.c
Tamas Bana4260892023-06-07 13:35:04 +0200221
222 BL2_SOURCES += ${QCBOR_SOURCES} \
223 ${DPE_SOURCES} \
224 plat/arm/board/tc/tc_common_dpe.c \
225 plat/arm/board/tc/tc_bl2_dpe.c \
226 lib/psa/dice_protection_environment.c
227
228 PLAT_INCLUDES += -I${QCBOR_INCLUDES} \
229 -Iinclude/lib/dice
230 else
Tamas Bandc15bf42024-02-22 11:35:28 +0100231 $(info Including rse_measured_boot.mk)
232 include drivers/measured_boot/rse/rse_measured_boot.mk
Tamas Bana4260892023-06-07 13:35:04 +0200233
234 BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \
Tamas Banede4f052022-09-16 16:26:15 +0200235 plat/arm/board/tc/tc_common_measured_boot.c \
236 plat/arm/board/tc/tc_bl1_measured_boot.c \
Tamas Bana4260892023-06-07 13:35:04 +0200237 lib/psa/measured_boot.c
Tamas Banede4f052022-09-16 16:26:15 +0200238
Tamas Bana4260892023-06-07 13:35:04 +0200239 BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \
Tamas Banede4f052022-09-16 16:26:15 +0200240 plat/arm/board/tc/tc_common_measured_boot.c \
241 plat/arm/board/tc/tc_bl2_measured_boot.c \
Tamas Bana4260892023-06-07 13:35:04 +0200242 lib/psa/measured_boot.c
243 endif
Tamas Banede4f052022-09-16 16:26:15 +0200244endif
245
David Vincze2cbc56b2024-01-04 18:37:12 +0100246ifeq (${TRNG_SUPPORT},1)
247 BL31_SOURCES += plat/arm/board/tc/tc_trng.c
248endif
249
laurenw-arm4c4181c2023-05-04 14:55:37 -0500250ifneq (${PLATFORM_TEST},)
laurenw-arm15aac382023-07-17 12:32:46 -0500251 # Add this include as first, before arm_common.mk. This is necessary
252 # because arm_common.mk builds Mbed TLS, and platform_test.mk can
253 # change the list of Mbed TLS files that are to be compiled
254 # (LIBMBEDTLS_SRCS).
255 include plat/arm/board/tc/platform_test.mk
laurenw-arm2ce1e352023-02-07 13:40:05 -0600256endif
257
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +0200258
Usama Ariff1513622021-04-09 17:07:41 +0100259include plat/arm/common/arm_common.mk
260include plat/arm/css/common/css_common.mk
261include plat/arm/soc/common/soc_css.mk
262include plat/arm/board/common/board_common.mk