blob: 8756f3195875a386b40dfe18498f5081e0cee719 [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
Boyan Karatotevbaff7992023-12-27 15:49:18 +000043 CTX_INCLUDE_PAUTH_REGS := 1
44endif
45
46
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +000047ifneq ($(shell expr $(TARGET_PLATFORM) \<= 1), 0)
Manish V Badarkhec7570d12023-11-20 18:25:49 +000048 $(warning Platform ${PLAT}$(TARGET_PLATFORM) is deprecated. \
49 Some of the features might not work as expected)
50endif
51
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +000052ifeq ($(shell expr $(TARGET_PLATFORM) \<= 3), 0)
53 $(error TARGET_PLATFORM must be less than or equal to 3)
Usama Ariff1513622021-04-09 17:07:41 +010054endif
55
Boyan Karatotev192ad5d2023-12-12 15:59:01 +000056ifeq ($(filter ${TARGET_FLAVOUR}, fvp fpga),)
57 $(error TARGET_FLAVOUR must be fvp or fpga)
58endif
59
60$(eval $(call add_defines, \
61 TARGET_PLATFORM \
62 TARGET_FLAVOUR_$(call uppercase,${TARGET_FLAVOUR}) \
Boyan Karatotev95562762023-11-15 11:54:33 +000063 TC_DPU_USE_SCMI_CLK \
Kshitij Sisodia090a6aa2023-11-22 17:03:45 +000064 TC_SCMI_PD_CTRL_EN \
65 TC_IOMMU_EN \
Boyan Karatotev192ad5d2023-12-12 15:59:01 +000066))
Olivier Deprez7e5597c2022-07-20 17:37:23 +020067
Usama Ariff1513622021-04-09 17:07:41 +010068CSS_LOAD_SCP_IMAGES := 1
69
Usama Ariff1513622021-04-09 17:07:41 +010070# Include GICv3 driver files
71include drivers/arm/gic/v3/gicv3.mk
72
73ENT_GIC_SOURCES := ${GICV3_SOURCES} \
74 plat/common/plat_gicv3.c \
75 plat/arm/common/arm_gicv3.c
76
Usama Ariff1513622021-04-09 17:07:41 +010077TC_BASE = plat/arm/board/tc
78
Boyan Karatotev8dec1f52023-12-20 16:28:23 +000079PLAT_INCLUDES += -I${TC_BASE}/include/ \
80 -I${TC_BASE}/fdts/
Usama Ariff1513622021-04-09 17:07:41 +010081
Usama Ariff1513622021-04-09 17:07:41 +010082# CPU libraries for TARGET_PLATFORM=1
83ifeq (${TARGET_PLATFORM}, 1)
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010084TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \
Rupinderjit Singh7e465552022-08-23 11:55:27 +010085 lib/cpus/aarch64/cortex_a715.S \
86 lib/cpus/aarch64/cortex_x3.S
Usama Ariff1513622021-04-09 17:07:41 +010087endif
88
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010089# CPU libraries for TARGET_PLATFORM=2
90ifeq (${TARGET_PLATFORM}, 2)
Govindraj Rajaca3caf02023-06-28 08:49:21 -050091TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
Govindraj Raja37012fb2023-06-23 11:28:05 -050092 lib/cpus/aarch64/cortex_a720.S \
Govindraj Raja0a120912023-06-23 11:09:31 -050093 lib/cpus/aarch64/cortex_x4.S
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010094endif
95
Boyan Karatotev6ed3bf62023-07-07 13:33:19 +000096# CPU libraries for TARGET_PLATFORM=3
97ifeq (${TARGET_PLATFORM}, 3)
98TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
99 lib/cpus/aarch64/cortex_chaberton.S \
100 lib/cpus/aarch64/cortex_blackhawk.S
101endif
102
Usama Ariff1513622021-04-09 17:07:41 +0100103INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c
104
105PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \
106 ${TC_BASE}/include/tc_helpers.S
107
108BL1_SOURCES += ${INTERCONNECT_SOURCES} \
109 ${TC_CPU_SOURCES} \
110 ${TC_BASE}/tc_trusted_boot.c \
111 ${TC_BASE}/tc_err.c \
112 drivers/arm/sbsa/sbsa.c
113
Usama Ariff1513622021-04-09 17:07:41 +0100114BL2_SOURCES += ${TC_BASE}/tc_security.c \
115 ${TC_BASE}/tc_err.c \
116 ${TC_BASE}/tc_trusted_boot.c \
Usama Arifa49bd492021-08-17 17:57:10 +0100117 ${TC_BASE}/tc_bl2_setup.c \
Usama Ariff1513622021-04-09 17:07:41 +0100118 lib/utils/mem_region.c \
119 drivers/arm/tzc/tzc400.c \
120 plat/arm/common/arm_tzc400.c \
121 plat/arm/common/arm_nor_psci_mem_protect.c
122
123BL31_SOURCES += ${INTERCONNECT_SOURCES} \
124 ${TC_CPU_SOURCES} \
125 ${ENT_GIC_SOURCES} \
126 ${TC_BASE}/tc_bl31_setup.c \
127 ${TC_BASE}/tc_topology.c \
Usama Arifa49bd492021-08-17 17:57:10 +0100128 lib/fconf/fconf.c \
129 lib/fconf/fconf_dyn_cfg_getter.c \
Usama Ariff1513622021-04-09 17:07:41 +0100130 drivers/cfi/v2m/v2m_flash.c \
131 lib/utils/mem_region.c \
Madhukar Pappireddye108df22023-03-22 15:40:40 -0500132 plat/arm/common/arm_nor_psci_mem_protect.c \
133 drivers/arm/sbsa/sbsa.c
Usama Ariff1513622021-04-09 17:07:41 +0100134
Chris Kaye9272152021-09-28 15:52:14 +0100135BL31_SOURCES += ${FDT_WRAPPERS_SOURCES}
136
Usama Ariff1513622021-04-09 17:07:41 +0100137# Add the FDT_SOURCES and options for Dynamic Config
138FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \
Tamas Banf879bf12023-06-12 11:26:28 +0200139 ${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts \
140 ${TC_BASE}/fdts/${PLAT}_nt_fw_config.dts
Usama Ariff1513622021-04-09 17:07:41 +0100141FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
142TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
Tamas Banf879bf12023-06-12 11:26:28 +0200143FVP_NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb
Usama Ariff1513622021-04-09 17:07:41 +0100144
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}))
Tamas Banf879bf12023-06-12 11:26:28 +0200149# Add the NT_FW_CONFIG to FIP and specify the same to certtool
150$(eval $(call TOOL_ADD_PAYLOAD,${FVP_NT_FW_CONFIG},--nt-fw-config,${FVP_NT_FW_CONFIG}))
Usama Ariff1513622021-04-09 17:07:41 +0100151
152ifeq (${SPD},spmd)
153ifeq ($(ARM_SPMC_MANIFEST_DTS),)
Boyan Karatotev8dec1f52023-12-20 16:28:23 +0000154ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_test_manifest.dts
Usama Ariff1513622021-04-09 17:07:41 +0100155endif
156
157FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS}
158TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
159
160# Add the TOS_FW_CONFIG to FIP and specify the same to certtool
161$(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG}))
162endif
163
164#Device tree
165TC_HW_CONFIG_DTS := fdts/tc.dts
166TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb
167FDT_SOURCES += ${TC_HW_CONFIG_DTS}
168$(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS)))
169
170# Add the HW_CONFIG to FIP and specify the same to certtool
171$(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG}))
172
Tamas Banede4f052022-09-16 16:26:15 +0200173# Include Measured Boot makefile before any Crypto library makefile.
174# Crypto library makefile may need default definitions of Measured Boot build
175# flags present in Measured Boot makefile.
Tamas Bandc15bf42024-02-22 11:35:28 +0100176$(info Including rse_comms.mk)
Tamas Banede4f052022-09-16 16:26:15 +0200177ifeq (${MEASURED_BOOT},1)
Tamas Bandc15bf42024-02-22 11:35:28 +0100178 $(info Including rse_comms.mk)
179 include drivers/arm/rse/rse_comms.mk
Tamas Banede4f052022-09-16 16:26:15 +0200180
Tamas Bandc15bf42024-02-22 11:35:28 +0100181 BL1_SOURCES += ${RSE_COMMS_SOURCES}
182 BL2_SOURCES += ${RSE_COMMS_SOURCES}
Tamas Bana4260892023-06-07 13:35:04 +0200183 PLAT_INCLUDES += -Iinclude/lib/psa
184
185 ifeq (${DICE_PROTECTION_ENVIRONMENT},1)
186 $(info Including qcbor.mk)
Tamas Bandc15bf42024-02-22 11:35:28 +0100187 include drivers/measured_boot/rse/qcbor.mk
Tamas Bana4260892023-06-07 13:35:04 +0200188 $(info Including dice_prot_env.mk)
Tamas Bandc15bf42024-02-22 11:35:28 +0100189 include drivers/measured_boot/rse/dice_prot_env.mk
Tamas Bana4260892023-06-07 13:35:04 +0200190
191 BL1_SOURCES += ${QCBOR_SOURCES} \
192 ${DPE_SOURCES} \
193 plat/arm/board/tc/tc_common_dpe.c \
194 plat/arm/board/tc/tc_bl1_dpe.c \
Tamas Banae33fa92023-06-07 14:18:46 +0200195 lib/psa/dice_protection_environment.c \
196 drivers/arm/css/sds/sds.c \
197 drivers/delay_timer/delay_timer.c \
198 drivers/delay_timer/generic_delay_timer.c
Tamas Bana4260892023-06-07 13:35:04 +0200199
200 BL2_SOURCES += ${QCBOR_SOURCES} \
201 ${DPE_SOURCES} \
202 plat/arm/board/tc/tc_common_dpe.c \
203 plat/arm/board/tc/tc_bl2_dpe.c \
204 lib/psa/dice_protection_environment.c
205
206 PLAT_INCLUDES += -I${QCBOR_INCLUDES} \
207 -Iinclude/lib/dice
208 else
Tamas Bandc15bf42024-02-22 11:35:28 +0100209 $(info Including rse_measured_boot.mk)
210 include drivers/measured_boot/rse/rse_measured_boot.mk
Tamas Bana4260892023-06-07 13:35:04 +0200211
212 BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \
Tamas Banede4f052022-09-16 16:26:15 +0200213 plat/arm/board/tc/tc_common_measured_boot.c \
214 plat/arm/board/tc/tc_bl1_measured_boot.c \
Tamas Bana4260892023-06-07 13:35:04 +0200215 lib/psa/measured_boot.c
Tamas Banede4f052022-09-16 16:26:15 +0200216
Tamas Bana4260892023-06-07 13:35:04 +0200217 BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \
Tamas Banede4f052022-09-16 16:26:15 +0200218 plat/arm/board/tc/tc_common_measured_boot.c \
219 plat/arm/board/tc/tc_bl2_measured_boot.c \
Tamas Bana4260892023-06-07 13:35:04 +0200220 lib/psa/measured_boot.c
221 endif
Tamas Banede4f052022-09-16 16:26:15 +0200222endif
223
David Vincze2cbc56b2024-01-04 18:37:12 +0100224ifeq (${TRNG_SUPPORT},1)
225 BL31_SOURCES += plat/arm/board/tc/tc_trng.c
226endif
227
laurenw-arm4c4181c2023-05-04 14:55:37 -0500228ifneq (${PLATFORM_TEST},)
laurenw-arm15aac382023-07-17 12:32:46 -0500229 # Add this include as first, before arm_common.mk. This is necessary
230 # because arm_common.mk builds Mbed TLS, and platform_test.mk can
231 # change the list of Mbed TLS files that are to be compiled
232 # (LIBMBEDTLS_SRCS).
233 include plat/arm/board/tc/platform_test.mk
laurenw-arm2ce1e352023-02-07 13:40:05 -0600234endif
235
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +0200236
Usama Ariff1513622021-04-09 17:07:41 +0100237include plat/arm/common/arm_common.mk
238include plat/arm/css/common/css_common.mk
239include plat/arm/soc/common/soc_css.mk
240include plat/arm/board/common/board_common.mk