blob: 8db6f1d6b44e3be7bb73e0e3658dd6ed35c0936f [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
Usama Ariff1513622021-04-09 17:07:41 +010024SDEI_SUPPORT := 0
25
26EL3_EXCEPTION_HANDLING := 0
27
Manish Pandey0e3379d2022-10-10 11:43:08 +010028HANDLE_EA_EL3_FIRST_NS := 0
Usama Ariff1513622021-04-09 17:07:41 +010029
30# System coherency is managed in hardware
31HW_ASSISTED_COHERENCY := 1
32
33# When building for systems with hardware-assisted coherency, there's no need to
34# use USE_COHERENT_MEM. Require that USE_COHERENT_MEM must be set to 0 too.
35USE_COHERENT_MEM := 0
36
37GIC_ENABLE_V4_EXTN := 1
38
39# GIC-600 configuration
40GICV3_SUPPORT_GIC600 := 1
41
Usama Arif1925c782021-08-20 20:53:34 +010042# Enable SVE
Jayanth Dodderi Chidanand4e169e72023-03-31 10:39:22 +010043ENABLE_SVE_FOR_NS := 2
Usama Arif1925c782021-08-20 20:53:34 +010044ENABLE_SVE_FOR_SWD := 1
Usama Ariff1513622021-04-09 17:07:41 +010045
Davidson K65361052021-10-13 18:49:41 +053046# enable trace buffer control registers access to NS by default
47ENABLE_TRBE_FOR_NS := 1
48
49# enable trace system registers access to NS by default
50ENABLE_SYS_REG_TRACE_FOR_NS := 1
51
52# enable trace filter control registers access to NS by default
53ENABLE_TRF_FOR_NS := 1
54
Usama Ariff1513622021-04-09 17:07:41 +010055# Include GICv3 driver files
56include drivers/arm/gic/v3/gicv3.mk
57
58ENT_GIC_SOURCES := ${GICV3_SOURCES} \
59 plat/common/plat_gicv3.c \
60 plat/arm/common/arm_gicv3.c
61
62override NEED_BL2U := no
63
64override ARM_PLAT_MT := 1
65
66TC_BASE = plat/arm/board/tc
67
68PLAT_INCLUDES += -I${TC_BASE}/include/
69
Usama Ariff1513622021-04-09 17:07:41 +010070# CPU libraries for TARGET_PLATFORM=1
71ifeq (${TARGET_PLATFORM}, 1)
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010072TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \
Rupinderjit Singh7e465552022-08-23 11:55:27 +010073 lib/cpus/aarch64/cortex_a715.S \
74 lib/cpus/aarch64/cortex_x3.S
Usama Ariff1513622021-04-09 17:07:41 +010075endif
76
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010077# CPU libraries for TARGET_PLATFORM=2
78ifeq (${TARGET_PLATFORM}, 2)
Govindraj Rajaca3caf02023-06-28 08:49:21 -050079TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
Govindraj Raja37012fb2023-06-23 11:28:05 -050080 lib/cpus/aarch64/cortex_a720.S \
Govindraj Raja0a120912023-06-23 11:09:31 -050081 lib/cpus/aarch64/cortex_x4.S
Rupinderjit Singh820b3b62022-04-04 17:28:41 +010082endif
83
Usama Ariff1513622021-04-09 17:07:41 +010084INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c
85
86PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \
87 ${TC_BASE}/include/tc_helpers.S
88
89BL1_SOURCES += ${INTERCONNECT_SOURCES} \
90 ${TC_CPU_SOURCES} \
91 ${TC_BASE}/tc_trusted_boot.c \
92 ${TC_BASE}/tc_err.c \
93 drivers/arm/sbsa/sbsa.c
94
Usama Ariff1513622021-04-09 17:07:41 +010095BL2_SOURCES += ${TC_BASE}/tc_security.c \
96 ${TC_BASE}/tc_err.c \
97 ${TC_BASE}/tc_trusted_boot.c \
Usama Arifa49bd492021-08-17 17:57:10 +010098 ${TC_BASE}/tc_bl2_setup.c \
Usama Ariff1513622021-04-09 17:07:41 +010099 lib/utils/mem_region.c \
100 drivers/arm/tzc/tzc400.c \
101 plat/arm/common/arm_tzc400.c \
102 plat/arm/common/arm_nor_psci_mem_protect.c
103
104BL31_SOURCES += ${INTERCONNECT_SOURCES} \
105 ${TC_CPU_SOURCES} \
106 ${ENT_GIC_SOURCES} \
107 ${TC_BASE}/tc_bl31_setup.c \
108 ${TC_BASE}/tc_topology.c \
Usama Arifa49bd492021-08-17 17:57:10 +0100109 lib/fconf/fconf.c \
110 lib/fconf/fconf_dyn_cfg_getter.c \
Usama Ariff1513622021-04-09 17:07:41 +0100111 drivers/cfi/v2m/v2m_flash.c \
112 lib/utils/mem_region.c \
Madhukar Pappireddye108df22023-03-22 15:40:40 -0500113 plat/arm/common/arm_nor_psci_mem_protect.c \
114 drivers/arm/sbsa/sbsa.c
Usama Ariff1513622021-04-09 17:07:41 +0100115
Chris Kaye9272152021-09-28 15:52:14 +0100116BL31_SOURCES += ${FDT_WRAPPERS_SOURCES}
117
Usama Ariff1513622021-04-09 17:07:41 +0100118# Add the FDT_SOURCES and options for Dynamic Config
119FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \
120 ${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts
121FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
122TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
123
124# Add the FW_CONFIG to FIP and specify the same to certtool
125$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
126# Add the TB_FW_CONFIG to FIP and specify the same to certtool
127$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
128
129ifeq (${SPD},spmd)
130ifeq ($(ARM_SPMC_MANIFEST_DTS),)
131ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_manifest.dts
132endif
133
134FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS}
135TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
136
137# Add the TOS_FW_CONFIG to FIP and specify the same to certtool
138$(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG}))
139endif
140
141#Device tree
142TC_HW_CONFIG_DTS := fdts/tc.dts
143TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb
144FDT_SOURCES += ${TC_HW_CONFIG_DTS}
145$(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS)))
146
147# Add the HW_CONFIG to FIP and specify the same to certtool
148$(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG}))
149
150override CTX_INCLUDE_AARCH32_REGS := 0
151
152override CTX_INCLUDE_PAUTH_REGS := 1
153
Andre Przywara30661a92023-02-03 15:30:14 +0000154override ENABLE_SPE_FOR_NS := 0
Usama Ariff1513622021-04-09 17:07:41 +0100155
Andre Przywara0b7f1b02023-03-21 13:53:19 +0000156override ENABLE_FEAT_AMU := 1
Chris Kayc2d29ba2021-05-18 18:49:51 +0100157override ENABLE_AMU_AUXILIARY_COUNTERS := 1
158override ENABLE_AMU_FCONF := 1
159
160override ENABLE_MPMM := 1
161override ENABLE_MPMM_FCONF := 1
Usama Ariff1513622021-04-09 17:07:41 +0100162
Tamas Banede4f052022-09-16 16:26:15 +0200163# Include Measured Boot makefile before any Crypto library makefile.
164# Crypto library makefile may need default definitions of Measured Boot build
165# flags present in Measured Boot makefile.
166ifeq (${MEASURED_BOOT},1)
167 MEASURED_BOOT_MK := drivers/measured_boot/rss/rss_measured_boot.mk
168 $(info Including ${MEASURED_BOOT_MK})
169 include ${MEASURED_BOOT_MK}
170 $(info Including rss_comms.mk)
171 include drivers/arm/rss/rss_comms.mk
172
173 BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \
174 plat/arm/board/tc/tc_common_measured_boot.c \
175 plat/arm/board/tc/tc_bl1_measured_boot.c \
176 lib/psa/measured_boot.c \
177 ${RSS_COMMS_SOURCES}
178
179 BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \
180 plat/arm/board/tc/tc_common_measured_boot.c \
181 plat/arm/board/tc/tc_bl2_measured_boot.c \
182 lib/psa/measured_boot.c \
183 ${RSS_COMMS_SOURCES}
184
185PLAT_INCLUDES += -Iinclude/lib/psa
186
187endif
188
laurenw-arm4c4181c2023-05-04 14:55:37 -0500189ifneq (${PLATFORM_TEST},)
laurenw-arm15aac382023-07-17 12:32:46 -0500190 # Add this include as first, before arm_common.mk. This is necessary
191 # because arm_common.mk builds Mbed TLS, and platform_test.mk can
192 # change the list of Mbed TLS files that are to be compiled
193 # (LIBMBEDTLS_SRCS).
194 include plat/arm/board/tc/platform_test.mk
laurenw-arm2ce1e352023-02-07 13:40:05 -0600195endif
196
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +0200197
Usama Ariff1513622021-04-09 17:07:41 +0100198include plat/arm/common/arm_common.mk
199include plat/arm/css/common/css_common.mk
200include plat/arm/soc/common/soc_css.mk
201include plat/arm/board/common/board_common.mk