blob: 8ca33cac4b5a998c96783d5c14ab5c144fd2f056 [file] [log] [blame]
laurenw-arm2ce1e352023-02-07 13:40:05 -06001# Copyright (c) 2021-2023, 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
Manish V Badarkhe9bd11932022-11-11 09:36:29 +00008ifeq ($(TARGET_PLATFORM), 0)
Daniel Boulby1f7786b2023-06-22 15:26:07 +01009 $(error Platform ${PLAT}$(TARGET_PLATFORM) is deprecated.)
Manish V Badarkhe9bd11932022-11-11 09:36:29 +000010endif
11
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010012ifeq ($(shell expr $(TARGET_PLATFORM) \<= 2), 0)
13 $(error TARGET_PLATFORM must be less than or equal to 2)
Usama Ariff1513622021-04-09 17:07:41 +010014endif
15
Olivier Deprez7e5597c2022-07-20 17:37:23 +020016$(eval $(call add_define,TARGET_PLATFORM))
17
Usama Ariff1513622021-04-09 17:07:41 +010018CSS_LOAD_SCP_IMAGES := 1
19
20CSS_USE_SCMI_SDS_DRIVER := 1
21
Manish Pandeyd419e222023-02-13 12:39:17 +000022ENABLE_FEAT_RAS := 1
23
24RAS_FFH_SUPPORT := 0
Usama Ariff1513622021-04-09 17:07:41 +010025
26SDEI_SUPPORT := 0
27
28EL3_EXCEPTION_HANDLING := 0
29
Manish Pandey0e3379d2022-10-10 11:43:08 +010030HANDLE_EA_EL3_FIRST_NS := 0
Usama Ariff1513622021-04-09 17:07:41 +010031
32# System coherency is managed in hardware
33HW_ASSISTED_COHERENCY := 1
34
35# When building for systems with hardware-assisted coherency, there's no need to
36# use USE_COHERENT_MEM. Require that USE_COHERENT_MEM must be set to 0 too.
37USE_COHERENT_MEM := 0
38
39GIC_ENABLE_V4_EXTN := 1
40
41# GIC-600 configuration
42GICV3_SUPPORT_GIC600 := 1
43
Usama Arif1925c782021-08-20 20:53:34 +010044# Enable SVE
Jayanth Dodderi Chidanand4e169e72023-03-31 10:39:22 +010045ENABLE_SVE_FOR_NS := 2
Usama Arif1925c782021-08-20 20:53:34 +010046ENABLE_SVE_FOR_SWD := 1
Usama Ariff1513622021-04-09 17:07:41 +010047
Davidson K65361052021-10-13 18:49:41 +053048# enable trace buffer control registers access to NS by default
49ENABLE_TRBE_FOR_NS := 1
50
51# enable trace system registers access to NS by default
52ENABLE_SYS_REG_TRACE_FOR_NS := 1
53
54# enable trace filter control registers access to NS by default
55ENABLE_TRF_FOR_NS := 1
56
Usama Ariff1513622021-04-09 17:07:41 +010057# Include GICv3 driver files
58include drivers/arm/gic/v3/gicv3.mk
59
60ENT_GIC_SOURCES := ${GICV3_SOURCES} \
61 plat/common/plat_gicv3.c \
62 plat/arm/common/arm_gicv3.c
63
64override NEED_BL2U := no
65
66override ARM_PLAT_MT := 1
67
68TC_BASE = plat/arm/board/tc
69
70PLAT_INCLUDES += -I${TC_BASE}/include/
71
Usama Ariff1513622021-04-09 17:07:41 +010072# CPU libraries for TARGET_PLATFORM=1
73ifeq (${TARGET_PLATFORM}, 1)
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010074TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \
Rupinderjit Singh7e465552022-08-23 11:55:27 +010075 lib/cpus/aarch64/cortex_a715.S \
76 lib/cpus/aarch64/cortex_x3.S
Usama Ariff1513622021-04-09 17:07:41 +010077endif
78
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010079# CPU libraries for TARGET_PLATFORM=2
80ifeq (${TARGET_PLATFORM}, 2)
Govindraj Rajaca3caf02023-06-28 08:49:21 -050081TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
Govindraj Raja37012fb2023-06-23 11:28:05 -050082 lib/cpus/aarch64/cortex_a720.S \
Govindraj Raja0a120912023-06-23 11:09:31 -050083 lib/cpus/aarch64/cortex_x4.S
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010084endif
85
Usama Ariff1513622021-04-09 17:07:41 +010086INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c
87
88PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \
89 ${TC_BASE}/include/tc_helpers.S
90
91BL1_SOURCES += ${INTERCONNECT_SOURCES} \
92 ${TC_CPU_SOURCES} \
93 ${TC_BASE}/tc_trusted_boot.c \
94 ${TC_BASE}/tc_err.c \
95 drivers/arm/sbsa/sbsa.c
96
Usama Ariff1513622021-04-09 17:07:41 +010097BL2_SOURCES += ${TC_BASE}/tc_security.c \
98 ${TC_BASE}/tc_err.c \
99 ${TC_BASE}/tc_trusted_boot.c \
Usama Arifa49bd492021-08-17 17:57:10 +0100100 ${TC_BASE}/tc_bl2_setup.c \
Usama Ariff1513622021-04-09 17:07:41 +0100101 lib/utils/mem_region.c \
102 drivers/arm/tzc/tzc400.c \
103 plat/arm/common/arm_tzc400.c \
104 plat/arm/common/arm_nor_psci_mem_protect.c
105
106BL31_SOURCES += ${INTERCONNECT_SOURCES} \
107 ${TC_CPU_SOURCES} \
108 ${ENT_GIC_SOURCES} \
109 ${TC_BASE}/tc_bl31_setup.c \
110 ${TC_BASE}/tc_topology.c \
Usama Arifa49bd492021-08-17 17:57:10 +0100111 lib/fconf/fconf.c \
112 lib/fconf/fconf_dyn_cfg_getter.c \
Usama Ariff1513622021-04-09 17:07:41 +0100113 drivers/cfi/v2m/v2m_flash.c \
114 lib/utils/mem_region.c \
Madhukar Pappireddye108df22023-03-22 15:40:40 -0500115 plat/arm/common/arm_nor_psci_mem_protect.c \
116 drivers/arm/sbsa/sbsa.c
Usama Ariff1513622021-04-09 17:07:41 +0100117
Chris Kaye9272152021-09-28 15:52:14 +0100118BL31_SOURCES += ${FDT_WRAPPERS_SOURCES}
119
Usama Ariff1513622021-04-09 17:07:41 +0100120# Add the FDT_SOURCES and options for Dynamic Config
121FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \
122 ${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts
123FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
124TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
125
126# Add the FW_CONFIG to FIP and specify the same to certtool
127$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
128# Add the TB_FW_CONFIG to FIP and specify the same to certtool
129$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
130
131ifeq (${SPD},spmd)
132ifeq ($(ARM_SPMC_MANIFEST_DTS),)
133ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_manifest.dts
134endif
135
136FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS}
137TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
138
139# Add the TOS_FW_CONFIG to FIP and specify the same to certtool
140$(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG}))
141endif
142
143#Device tree
144TC_HW_CONFIG_DTS := fdts/tc.dts
145TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb
146FDT_SOURCES += ${TC_HW_CONFIG_DTS}
147$(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS)))
148
149# Add the HW_CONFIG to FIP and specify the same to certtool
150$(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG}))
151
152override CTX_INCLUDE_AARCH32_REGS := 0
153
154override CTX_INCLUDE_PAUTH_REGS := 1
155
Andre Przywara30661a92023-02-03 15:30:14 +0000156override ENABLE_SPE_FOR_NS := 0
Usama Ariff1513622021-04-09 17:07:41 +0100157
Andre Przywara0b7f1b02023-03-21 13:53:19 +0000158override ENABLE_FEAT_AMU := 1
Chris Kayc2d29ba2021-05-18 18:49:51 +0100159override ENABLE_AMU_AUXILIARY_COUNTERS := 1
160override ENABLE_AMU_FCONF := 1
161
162override ENABLE_MPMM := 1
163override ENABLE_MPMM_FCONF := 1
Usama Ariff1513622021-04-09 17:07:41 +0100164
Tamas Banede4f052022-09-16 16:26:15 +0200165# Include Measured Boot makefile before any Crypto library makefile.
166# Crypto library makefile may need default definitions of Measured Boot build
167# flags present in Measured Boot makefile.
168ifeq (${MEASURED_BOOT},1)
169 MEASURED_BOOT_MK := drivers/measured_boot/rss/rss_measured_boot.mk
170 $(info Including ${MEASURED_BOOT_MK})
171 include ${MEASURED_BOOT_MK}
172 $(info Including rss_comms.mk)
173 include drivers/arm/rss/rss_comms.mk
174
175 BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \
176 plat/arm/board/tc/tc_common_measured_boot.c \
177 plat/arm/board/tc/tc_bl1_measured_boot.c \
178 lib/psa/measured_boot.c \
179 ${RSS_COMMS_SOURCES}
180
181 BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \
182 plat/arm/board/tc/tc_common_measured_boot.c \
183 plat/arm/board/tc/tc_bl2_measured_boot.c \
184 lib/psa/measured_boot.c \
185 ${RSS_COMMS_SOURCES}
186
187PLAT_INCLUDES += -Iinclude/lib/psa
188
189endif
190
laurenw-arm4c4181c2023-05-04 14:55:37 -0500191ifneq (${PLATFORM_TEST},)
laurenw-arm15aac382023-07-17 12:32:46 -0500192 # Add this include as first, before arm_common.mk. This is necessary
193 # because arm_common.mk builds Mbed TLS, and platform_test.mk can
194 # change the list of Mbed TLS files that are to be compiled
195 # (LIBMBEDTLS_SRCS).
196 include plat/arm/board/tc/platform_test.mk
laurenw-arm2ce1e352023-02-07 13:40:05 -0600197endif
198
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +0200199
Usama Ariff1513622021-04-09 17:07:41 +0100200include plat/arm/common/arm_common.mk
201include plat/arm/css/common/css_common.mk
202include plat/arm/soc/common/soc_css.mk
203include plat/arm/board/common/board_common.mk