xref: /rk3399_ARM-atf/plat/arm/board/tc/platform.mk (revision 1b0761130bab90306b48674dcdd86b42543fb81e)
1*1b076113Slaurenw-arm# Copyright (c) 2021-2023, Arm Limited. All rights reserved.
26ec0c65bSUsama Arif#
36ec0c65bSUsama Arif# SPDX-License-Identifier: BSD-3-Clause
46ec0c65bSUsama Arif#
56ec0c65bSUsama Arif
61fa05dabSChris Kayinclude common/fdt_wrappers.mk
71fa05dabSChris Kay
842c70c08SManish V Badarkheifeq ($(TARGET_PLATFORM), 0)
942c70c08SManish V Badarkhe$(warning Platform ${PLAT}$(TARGET_PLATFORM) is deprecated. \
1042c70c08SManish V BadarkheSome of the features might not work as expected)
1142c70c08SManish V Badarkheendif
1242c70c08SManish V Badarkhe
13eebd2c3fSRupinderjit Singhifeq ($(shell expr $(TARGET_PLATFORM) \<= 2), 0)
14eebd2c3fSRupinderjit Singh        $(error TARGET_PLATFORM must be less than or equal to 2)
156ec0c65bSUsama Arifendif
166ec0c65bSUsama Arif
178597a8cbSOlivier Deprez$(eval $(call add_define,TARGET_PLATFORM))
188597a8cbSOlivier Deprez
196ec0c65bSUsama ArifCSS_LOAD_SCP_IMAGES	:=	1
206ec0c65bSUsama Arif
216ec0c65bSUsama ArifCSS_USE_SCMI_SDS_DRIVER	:=	1
226ec0c65bSUsama Arif
236ec0c65bSUsama ArifRAS_EXTENSION		:=	0
246ec0c65bSUsama Arif
256ec0c65bSUsama ArifSDEI_SUPPORT		:=	0
266ec0c65bSUsama Arif
276ec0c65bSUsama ArifEL3_EXCEPTION_HANDLING	:=	0
286ec0c65bSUsama Arif
2946cc41d5SManish PandeyHANDLE_EA_EL3_FIRST_NS	:=	0
306ec0c65bSUsama Arif
316ec0c65bSUsama Arif# System coherency is managed in hardware
326ec0c65bSUsama ArifHW_ASSISTED_COHERENCY	:=	1
336ec0c65bSUsama Arif
346ec0c65bSUsama Arif# When building for systems with hardware-assisted coherency, there's no need to
356ec0c65bSUsama Arif# use USE_COHERENT_MEM. Require that USE_COHERENT_MEM must be set to 0 too.
366ec0c65bSUsama ArifUSE_COHERENT_MEM	:=	0
376ec0c65bSUsama Arif
386ec0c65bSUsama ArifGIC_ENABLE_V4_EXTN	:=      1
396ec0c65bSUsama Arif
406ec0c65bSUsama Arif# GIC-600 configuration
416ec0c65bSUsama ArifGICV3_SUPPORT_GIC600	:=	1
426ec0c65bSUsama Arif
4310198eabSUsama Arif# Enable SVE
4410198eabSUsama ArifENABLE_SVE_FOR_NS	:=	1
4510198eabSUsama ArifENABLE_SVE_FOR_SWD	:=	1
466ec0c65bSUsama Arif
4759da207eSDavidson K# enable trace buffer control registers access to NS by default
4859da207eSDavidson KENABLE_TRBE_FOR_NS              := 1
4959da207eSDavidson K
5059da207eSDavidson K# enable trace system registers access to NS by default
5159da207eSDavidson KENABLE_SYS_REG_TRACE_FOR_NS     := 1
5259da207eSDavidson K
5359da207eSDavidson K# enable trace filter control registers access to NS by default
5459da207eSDavidson KENABLE_TRF_FOR_NS               := 1
5559da207eSDavidson K
566ef63af6SRaef Coles# Enable RSS-required FIP UUIDs
576ef63af6SRaef Coles$(shell cp plat/arm/board/tc/plat_fiptool.mk ${PLAT_DIR})
586ef63af6SRaef Coles
596ec0c65bSUsama Arif# Include GICv3 driver files
606ec0c65bSUsama Arifinclude drivers/arm/gic/v3/gicv3.mk
616ec0c65bSUsama Arif
626ec0c65bSUsama ArifENT_GIC_SOURCES		:=	${GICV3_SOURCES}		\
636ec0c65bSUsama Arif				plat/common/plat_gicv3.c	\
646ec0c65bSUsama Arif				plat/arm/common/arm_gicv3.c
656ec0c65bSUsama Arif
666ec0c65bSUsama Arifoverride NEED_BL2U	:=	no
676ec0c65bSUsama Arif
686ec0c65bSUsama Arifoverride ARM_PLAT_MT	:=	1
696ec0c65bSUsama Arif
706ec0c65bSUsama ArifTC_BASE	=	plat/arm/board/tc
716ec0c65bSUsama Arif
726ec0c65bSUsama ArifPLAT_INCLUDES		+=	-I${TC_BASE}/include/
736ec0c65bSUsama Arif
746ec0c65bSUsama Arif# CPU libraries for TARGET_PLATFORM=0
756ec0c65bSUsama Arififeq (${TARGET_PLATFORM}, 0)
76eebd2c3fSRupinderjit SinghTC_CPU_SOURCES	+=	lib/cpus/aarch64/cortex_a510.S	\
77eebd2c3fSRupinderjit Singh			lib/cpus/aarch64/cortex_a710.S	\
786ec0c65bSUsama Arif			lib/cpus/aarch64/cortex_x2.S
796ec0c65bSUsama Arifendif
806ec0c65bSUsama Arif
816ec0c65bSUsama Arif# CPU libraries for TARGET_PLATFORM=1
826ec0c65bSUsama Arififeq (${TARGET_PLATFORM}, 1)
83eebd2c3fSRupinderjit SinghTC_CPU_SOURCES	+=	lib/cpus/aarch64/cortex_a510.S \
84c58b9a8eSRupinderjit Singh			lib/cpus/aarch64/cortex_a715.S \
85c58b9a8eSRupinderjit Singh			lib/cpus/aarch64/cortex_x3.S
866ec0c65bSUsama Arifendif
876ec0c65bSUsama Arif
88eebd2c3fSRupinderjit Singh# CPU libraries for TARGET_PLATFORM=2
89eebd2c3fSRupinderjit Singhifeq (${TARGET_PLATFORM}, 2)
90eebd2c3fSRupinderjit SinghTC_CPU_SOURCES	+=	lib/cpus/aarch64/cortex_hayes.S \
918c87becbSHarrison Mutai			lib/cpus/aarch64/cortex_hunter.S \
928c87becbSHarrison Mutai			lib/cpus/aarch64/cortex_hunter_elp_arm.S
93eebd2c3fSRupinderjit Singhendif
94eebd2c3fSRupinderjit Singh
956ec0c65bSUsama ArifINTERCONNECT_SOURCES	:=	${TC_BASE}/tc_interconnect.c
966ec0c65bSUsama Arif
976ec0c65bSUsama ArifPLAT_BL_COMMON_SOURCES	+=	${TC_BASE}/tc_plat.c	\
986ec0c65bSUsama Arif				${TC_BASE}/include/tc_helpers.S
996ec0c65bSUsama Arif
1006ec0c65bSUsama ArifBL1_SOURCES		+=	${INTERCONNECT_SOURCES}	\
1016ec0c65bSUsama Arif				${TC_CPU_SOURCES}	\
1026ec0c65bSUsama Arif				${TC_BASE}/tc_trusted_boot.c	\
1036ec0c65bSUsama Arif				${TC_BASE}/tc_err.c	\
1046ec0c65bSUsama Arif				drivers/arm/sbsa/sbsa.c
1056ec0c65bSUsama Arif
1066ec0c65bSUsama ArifBL2_SOURCES		+=	${TC_BASE}/tc_security.c	\
1076ec0c65bSUsama Arif				${TC_BASE}/tc_err.c		\
1086ec0c65bSUsama Arif				${TC_BASE}/tc_trusted_boot.c		\
10934a87d74SUsama Arif				${TC_BASE}/tc_bl2_setup.c		\
1106ec0c65bSUsama Arif				lib/utils/mem_region.c			\
1116ec0c65bSUsama Arif				drivers/arm/tzc/tzc400.c		\
1126ec0c65bSUsama Arif				plat/arm/common/arm_tzc400.c		\
1136ec0c65bSUsama Arif				plat/arm/common/arm_nor_psci_mem_protect.c
1146ec0c65bSUsama Arif
1156ec0c65bSUsama ArifBL31_SOURCES		+=	${INTERCONNECT_SOURCES}	\
1166ec0c65bSUsama Arif				${TC_CPU_SOURCES}	\
1176ec0c65bSUsama Arif				${ENT_GIC_SOURCES}			\
1186ec0c65bSUsama Arif				${TC_BASE}/tc_bl31_setup.c	\
1196ec0c65bSUsama Arif				${TC_BASE}/tc_topology.c	\
12034a87d74SUsama Arif				lib/fconf/fconf.c			\
12134a87d74SUsama Arif				lib/fconf/fconf_dyn_cfg_getter.c	\
1226ec0c65bSUsama Arif				drivers/cfi/v2m/v2m_flash.c		\
1236ec0c65bSUsama Arif				lib/utils/mem_region.c			\
1246ec0c65bSUsama Arif				plat/arm/common/arm_nor_psci_mem_protect.c
1256ec0c65bSUsama Arif
1261fa05dabSChris KayBL31_SOURCES		+=	${FDT_WRAPPERS_SOURCES}
1271fa05dabSChris Kay
1286ec0c65bSUsama Arif# Add the FDT_SOURCES and options for Dynamic Config
1296ec0c65bSUsama ArifFDT_SOURCES		+=	${TC_BASE}/fdts/${PLAT}_fw_config.dts	\
1306ec0c65bSUsama Arif				${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts
1316ec0c65bSUsama ArifFW_CONFIG		:=	${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
1326ec0c65bSUsama ArifTB_FW_CONFIG		:=	${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
1336ec0c65bSUsama Arif
1346ec0c65bSUsama Arif# Add the FW_CONFIG to FIP and specify the same to certtool
1356ec0c65bSUsama Arif$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
1366ec0c65bSUsama Arif# Add the TB_FW_CONFIG to FIP and specify the same to certtool
1376ec0c65bSUsama Arif$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
1386ec0c65bSUsama Arif
1396ec0c65bSUsama Arififeq (${SPD},spmd)
1406ec0c65bSUsama Arififeq ($(ARM_SPMC_MANIFEST_DTS),)
1416ec0c65bSUsama ArifARM_SPMC_MANIFEST_DTS	:=	${TC_BASE}/fdts/${PLAT}_spmc_manifest.dts
1426ec0c65bSUsama Arifendif
1436ec0c65bSUsama Arif
1446ec0c65bSUsama ArifFDT_SOURCES		+=	${ARM_SPMC_MANIFEST_DTS}
1456ec0c65bSUsama ArifTC_TOS_FW_CONFIG	:=	${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
1466ec0c65bSUsama Arif
1476ec0c65bSUsama Arif# Add the TOS_FW_CONFIG to FIP and specify the same to certtool
1486ec0c65bSUsama Arif$(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG}))
1496ec0c65bSUsama Arifendif
1506ec0c65bSUsama Arif
1516ec0c65bSUsama Arif#Device tree
1526ec0c65bSUsama ArifTC_HW_CONFIG_DTS	:=	fdts/tc.dts
1536ec0c65bSUsama ArifTC_HW_CONFIG		:=	${BUILD_PLAT}/fdts/${PLAT}.dtb
1546ec0c65bSUsama ArifFDT_SOURCES		+=	${TC_HW_CONFIG_DTS}
1556ec0c65bSUsama Arif$(eval TC_HW_CONFIG	:=	${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS)))
1566ec0c65bSUsama Arif
1576ec0c65bSUsama Arif# Add the HW_CONFIG to FIP and specify the same to certtool
1586ec0c65bSUsama Arif$(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG}))
1596ec0c65bSUsama Arif
1606ec0c65bSUsama Arifoverride CTX_INCLUDE_AARCH32_REGS	:= 0
1616ec0c65bSUsama Arif
1626ec0c65bSUsama Arifoverride CTX_INCLUDE_PAUTH_REGS	:= 1
1636ec0c65bSUsama Arif
1646ec0c65bSUsama Arifoverride ENABLE_SPE_FOR_LOWER_ELS	:= 0
1656ec0c65bSUsama Arif
1666ec0c65bSUsama Arifoverride ENABLE_AMU := 1
167c19a82beSChris Kayoverride ENABLE_AMU_AUXILIARY_COUNTERS := 1
168c19a82beSChris Kayoverride ENABLE_AMU_FCONF := 1
169c19a82beSChris Kay
170c19a82beSChris Kayoverride ENABLE_MPMM := 1
171c19a82beSChris Kayoverride ENABLE_MPMM_FCONF := 1
1726ec0c65bSUsama Arif
1736cb5d326STamas Ban# Include Measured Boot makefile before any Crypto library makefile.
1746cb5d326STamas Ban# Crypto library makefile may need default definitions of Measured Boot build
1756cb5d326STamas Ban# flags present in Measured Boot makefile.
1766cb5d326STamas Banifeq (${MEASURED_BOOT},1)
1776cb5d326STamas Ban    MEASURED_BOOT_MK := drivers/measured_boot/rss/rss_measured_boot.mk
1786cb5d326STamas Ban    $(info Including ${MEASURED_BOOT_MK})
1796cb5d326STamas Ban    include ${MEASURED_BOOT_MK}
1806cb5d326STamas Ban    $(info Including rss_comms.mk)
1816cb5d326STamas Ban    include drivers/arm/rss/rss_comms.mk
1826cb5d326STamas Ban
1836cb5d326STamas Ban    BL1_SOURCES		+=	${MEASURED_BOOT_SOURCES} \
1846cb5d326STamas Ban				plat/arm/board/tc/tc_common_measured_boot.c \
1856cb5d326STamas Ban				plat/arm/board/tc/tc_bl1_measured_boot.c \
1866cb5d326STamas Ban				lib/psa/measured_boot.c			 \
1876cb5d326STamas Ban				${RSS_COMMS_SOURCES}
1886cb5d326STamas Ban
1896cb5d326STamas Ban    BL2_SOURCES		+=	${MEASURED_BOOT_SOURCES} \
1906cb5d326STamas Ban				plat/arm/board/tc/tc_common_measured_boot.c \
1916cb5d326STamas Ban				plat/arm/board/tc/tc_bl2_measured_boot.c \
1926cb5d326STamas Ban				lib/psa/measured_boot.c			 \
1936cb5d326STamas Ban				${RSS_COMMS_SOURCES}
1946cb5d326STamas Ban
1956cb5d326STamas BanPLAT_INCLUDES		+=	-Iinclude/lib/psa
1966cb5d326STamas Ban
1976cb5d326STamas Banendif
1986cb5d326STamas Ban
199*1b076113Slaurenw-armifeq (${PLATFORM_TEST},rss-nv-counters)
200*1b076113Slaurenw-arm    include drivers/arm/rss/rss_comms.mk
201*1b076113Slaurenw-arm
202*1b076113Slaurenw-arm    # Test code.
203*1b076113Slaurenw-arm    BL31_SOURCES	+=	plat/arm/board/tc/nv_counter_test.c
204*1b076113Slaurenw-arm
205*1b076113Slaurenw-arm    # Code under testing.
206*1b076113Slaurenw-arm    BL31_SOURCES	+=	lib/psa/rss_platform.c \
207*1b076113Slaurenw-arm				drivers/arm/rss/rss_comms.c \
208*1b076113Slaurenw-arm				${RSS_COMMS_SOURCES}
209*1b076113Slaurenw-arm
210*1b076113Slaurenw-arm    PLAT_INCLUDES	+=	-Iinclude/lib/psa
211*1b076113Slaurenw-arm
212*1b076113Slaurenw-arm    $(eval $(call add_define,PLATFORM_TEST))
213*1b076113Slaurenw-armelse ifeq (${PLATFORM_TEST},tfm-testsuite)
214*1b076113Slaurenw-arm    # Add this include as first, before arm_common.mk. This is necessary
215*1b076113Slaurenw-arm    # because arm_common.mk builds Mbed TLS, and platform_test.mk can
216*1b076113Slaurenw-arm    # change the list of Mbed TLS files that are to be compiled
217*1b076113Slaurenw-arm    # (LIBMBEDTLS_SRCS).
21825dd2172SMate Toth-Pal    include plat/arm/board/tc/platform_test.mk
219*1b076113Slaurenw-armelse ifneq (${PLATFORM_TEST},)
220*1b076113Slaurenw-arm    $(error "Unsupported PLATFORM_TEST value")
221*1b076113Slaurenw-armendif
222*1b076113Slaurenw-arm
22325dd2172SMate Toth-Pal
2246ec0c65bSUsama Arifinclude plat/arm/common/arm_common.mk
2256ec0c65bSUsama Arifinclude plat/arm/css/common/css_common.mk
2266ec0c65bSUsama Arifinclude plat/arm/soc/common/soc_css.mk
2276ec0c65bSUsama Arifinclude plat/arm/board/common/board_common.mk
228