xref: /arm-trusted-firmware/plat/arm/board/juno/platform.mk (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700Schasinglulu#
2*91f16700Schasinglulu# Copyright (c) 2013-2023, Arm Limited and Contributors. All rights reserved.
3*91f16700Schasinglulu#
4*91f16700Schasinglulu# SPDX-License-Identifier: BSD-3-Clause
5*91f16700Schasinglulu#
6*91f16700Schasinglulu
7*91f16700Schasingluluinclude common/fdt_wrappers.mk
8*91f16700Schasinglulu
9*91f16700Schasinglulu# Include GICv2 driver files
10*91f16700Schasingluluinclude drivers/arm/gic/v2/gicv2.mk
11*91f16700Schasinglulu
12*91f16700SchasingluluJUNO_GIC_SOURCES	:=	${GICV2_SOURCES}			\
13*91f16700Schasinglulu				plat/common/plat_gicv2.c		\
14*91f16700Schasinglulu				plat/arm/common/arm_gicv2.c
15*91f16700Schasinglulu
16*91f16700SchasingluluJUNO_INTERCONNECT_SOURCES	:=	drivers/arm/cci/cci.c		\
17*91f16700Schasinglulu					plat/arm/common/arm_cci.c
18*91f16700Schasinglulu
19*91f16700SchasingluluJUNO_SECURITY_SOURCES	:=	drivers/arm/tzc/tzc400.c		\
20*91f16700Schasinglulu				plat/arm/board/juno/juno_security.c	\
21*91f16700Schasinglulu				plat/arm/board/juno/juno_trng.c		\
22*91f16700Schasinglulu				plat/arm/common/arm_tzc400.c
23*91f16700Schasinglulu
24*91f16700Schasingluluifneq (${ENABLE_STACK_PROTECTOR}, 0)
25*91f16700SchasingluluJUNO_SECURITY_SOURCES	+=	plat/arm/board/juno/juno_stack_protector.c
26*91f16700Schasingluluendif
27*91f16700Schasinglulu
28*91f16700Schasinglulu# Select SCMI/SDS drivers instead of SCPI/BOM driver for communicating with the
29*91f16700Schasinglulu# SCP during power management operations and for SCP RAM Firmware transfer.
30*91f16700SchasingluluCSS_USE_SCMI_SDS_DRIVER		:=	1
31*91f16700Schasinglulu
32*91f16700SchasingluluPLAT_INCLUDES		:=	-Iplat/arm/board/juno/include
33*91f16700Schasinglulu
34*91f16700SchasingluluPLAT_BL_COMMON_SOURCES	:=	plat/arm/board/juno/${ARCH}/juno_helpers.S \
35*91f16700Schasinglulu				plat/arm/board/juno/juno_common.c
36*91f16700Schasinglulu
37*91f16700Schasinglulu# Flag to enable support for AArch32 state on JUNO
38*91f16700SchasingluluJUNO_AARCH32_EL3_RUNTIME	:=	0
39*91f16700Schasinglulu$(eval $(call assert_boolean,JUNO_AARCH32_EL3_RUNTIME))
40*91f16700Schasinglulu$(eval $(call add_define,JUNO_AARCH32_EL3_RUNTIME))
41*91f16700Schasinglulu
42*91f16700Schasinglulu# Flag to enable support for TZMP1 on JUNO
43*91f16700SchasingluluJUNO_TZMP1		:=	0
44*91f16700Schasinglulu$(eval $(call assert_boolean,JUNO_TZMP1))
45*91f16700Schasingluluifeq (${JUNO_TZMP1}, 1)
46*91f16700Schasinglulu  ifeq (${ETHOSN_NPU_TZMP1},1)
47*91f16700Schasinglulu    $(error JUNO_TZMP1 cannot be used together with ETHOSN_NPU_TZMP1)
48*91f16700Schasinglulu  else
49*91f16700Schasinglulu    $(eval $(call add_define,JUNO_TZMP1))
50*91f16700Schasinglulu  endif
51*91f16700Schasingluluendif
52*91f16700Schasinglulu
53*91f16700SchasingluluTRNG_SUPPORT		:=	1
54*91f16700Schasinglulu
55*91f16700Schasingluluifeq (${JUNO_AARCH32_EL3_RUNTIME}, 1)
56*91f16700Schasinglulu# Include BL32 in FIP
57*91f16700SchasingluluNEED_BL32		:= yes
58*91f16700Schasinglulu# BL31 is not required
59*91f16700Schasingluluoverride BL31_SOURCES =
60*91f16700Schasinglulu
61*91f16700Schasinglulu# The BL32 needs to be built separately invoking the AARCH32 compiler and
62*91f16700Schasinglulu# be specifed via `BL32` build option.
63*91f16700Schasinglulu  ifneq (${ARCH}, aarch32)
64*91f16700Schasinglulu    override BL32_SOURCES =
65*91f16700Schasinglulu  endif
66*91f16700Schasingluluelse
67*91f16700Schasinglulu  ifeq (${ARCH}, aarch32)
68*91f16700Schasinglulu    $(error JUNO_AARCH32_EL3_RUNTIME has to be enabled to build BL32 for AArch32)
69*91f16700Schasinglulu  endif
70*91f16700Schasingluluendif
71*91f16700Schasinglulu
72*91f16700Schasingluluifeq (${ARCH},aarch64)
73*91f16700SchasingluluBL1_SOURCES		+=	lib/cpus/aarch64/cortex_a53.S		\
74*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a57.S		\
75*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a72.S		\
76*91f16700Schasinglulu				plat/arm/board/juno/juno_err.c		\
77*91f16700Schasinglulu				plat/arm/board/juno/juno_bl1_setup.c	\
78*91f16700Schasinglulu				drivers/arm/sp805/sp805.c		\
79*91f16700Schasinglulu				${JUNO_INTERCONNECT_SOURCES}		\
80*91f16700Schasinglulu				${JUNO_SECURITY_SOURCES}
81*91f16700Schasinglulu
82*91f16700SchasingluluBL2_SOURCES		+=	drivers/arm/sp805/sp805.c		\
83*91f16700Schasinglulu				lib/utils/mem_region.c			\
84*91f16700Schasinglulu				plat/arm/board/juno/juno_err.c		\
85*91f16700Schasinglulu				plat/arm/board/juno/juno_bl2_setup.c	\
86*91f16700Schasinglulu				plat/arm/common/arm_nor_psci_mem_protect.c \
87*91f16700Schasinglulu				${JUNO_SECURITY_SOURCES}
88*91f16700Schasinglulu
89*91f16700SchasingluluBL2U_SOURCES		+=	${JUNO_SECURITY_SOURCES}
90*91f16700Schasinglulu
91*91f16700SchasingluluBL31_SOURCES		+=	drivers/cfi/v2m/v2m_flash.c		\
92*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a53.S		\
93*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a57.S		\
94*91f16700Schasinglulu				lib/cpus/aarch64/cortex_a72.S		\
95*91f16700Schasinglulu				lib/utils/mem_region.c			\
96*91f16700Schasinglulu				lib/fconf/fconf.c			\
97*91f16700Schasinglulu				lib/fconf/fconf_dyn_cfg_getter.c	\
98*91f16700Schasinglulu				plat/arm/board/juno/juno_bl31_setup.c	\
99*91f16700Schasinglulu				plat/arm/board/juno/juno_pm.c		\
100*91f16700Schasinglulu				plat/arm/board/juno/juno_topology.c	\
101*91f16700Schasinglulu				plat/arm/common/arm_nor_psci_mem_protect.c \
102*91f16700Schasinglulu				${JUNO_GIC_SOURCES}			\
103*91f16700Schasinglulu				${JUNO_INTERCONNECT_SOURCES}		\
104*91f16700Schasinglulu				${JUNO_SECURITY_SOURCES}
105*91f16700Schasinglulu
106*91f16700SchasingluluBL31_SOURCES		+=	${FDT_WRAPPERS_SOURCES}
107*91f16700Schasinglulu
108*91f16700Schasingluluifeq (${CSS_USE_SCMI_SDS_DRIVER},1)
109*91f16700SchasingluluBL1_SOURCES		+=	drivers/arm/css/sds/sds.c
110*91f16700Schasingluluendif
111*91f16700Schasinglulu
112*91f16700Schasingluluifeq (${TRUSTED_BOARD_BOOT}, 1)
113*91f16700Schasinglulu   # Enable Juno specific TBBR images
114*91f16700Schasinglulu   $(eval $(call add_define,PLAT_TBBR_IMG_DEF))
115*91f16700Schasinglulu   DTC_CPPFLAGS += ${PLAT_INCLUDES}
116*91f16700Schasinglulu
117*91f16700Schasinglulu   BL1_SOURCES		+=	plat/arm/board/juno/juno_trusted_boot.c
118*91f16700Schasinglulu   BL2_SOURCES		+=	plat/arm/board/juno/juno_trusted_boot.c
119*91f16700Schasinglulu
120*91f16700Schasinglulu   ifeq (${COT_DESC_IN_DTB},0)
121*91f16700Schasinglulu      BL2_SOURCES	+=	plat/arm/board/juno/juno_tbbr_cot_bl2.c
122*91f16700Schasinglulu   endif
123*91f16700Schasingluluendif
124*91f16700Schasinglulu
125*91f16700Schasingluluendif
126*91f16700Schasinglulu
127*91f16700Schasingluluifneq (${RESET_TO_BL31},0)
128*91f16700Schasinglulu  $(error "Using BL31 as the reset vector is not supported on ${PLAT} platform. \
129*91f16700Schasinglulu  Please set RESET_TO_BL31 to 0.")
130*91f16700Schasingluluendif
131*91f16700Schasinglulu
132*91f16700Schasingluluifeq ($(USE_ROMLIB),1)
133*91f16700Schasingluluall : bl1_romlib.bin
134*91f16700Schasingluluendif
135*91f16700Schasinglulu
136*91f16700Schasinglulubl1_romlib.bin : $(BUILD_PLAT)/bl1.bin romlib.bin
137*91f16700Schasinglulu	@echo "Building combined BL1 and ROMLIB binary for Juno $@"
138*91f16700Schasinglulu	./lib/romlib/gen_combined_bl1_romlib.sh -o bl1_romlib.bin $(BUILD_PLAT)
139*91f16700Schasinglulu
140*91f16700Schasinglulu# Errata workarounds for Cortex-A53:
141*91f16700SchasingluluERRATA_A53_819472		:=	1
142*91f16700SchasingluluERRATA_A53_824069		:=	1
143*91f16700SchasingluluERRATA_A53_826319		:=	1
144*91f16700SchasingluluERRATA_A53_827319		:=	1
145*91f16700SchasingluluERRATA_A53_835769		:=	1
146*91f16700SchasingluluERRATA_A53_836870		:=	1
147*91f16700SchasingluluERRATA_A53_843419		:=	1
148*91f16700SchasingluluERRATA_A53_855873		:=	1
149*91f16700Schasinglulu
150*91f16700Schasinglulu# Errata workarounds for Cortex-A57:
151*91f16700SchasingluluERRATA_A57_806969		:=	0
152*91f16700SchasingluluERRATA_A57_813419		:=	1
153*91f16700SchasingluluERRATA_A57_813420		:=	1
154*91f16700SchasingluluERRATA_A57_814670		:=	1
155*91f16700SchasingluluERRATA_A57_817169		:=	1
156*91f16700SchasingluluERRATA_A57_826974		:=	1
157*91f16700SchasingluluERRATA_A57_826977		:=	1
158*91f16700SchasingluluERRATA_A57_828024		:=	1
159*91f16700SchasingluluERRATA_A57_829520		:=	1
160*91f16700SchasingluluERRATA_A57_833471		:=	1
161*91f16700SchasingluluERRATA_A57_859972		:=	0
162*91f16700Schasinglulu
163*91f16700Schasinglulu# Errata workarounds for Cortex-A72:
164*91f16700SchasingluluERRATA_A72_859971		:=	0
165*91f16700Schasinglulu
166*91f16700Schasinglulu# Enable option to skip L1 data cache flush during the Cortex-A57 cluster
167*91f16700Schasinglulu# power down sequence
168*91f16700SchasingluluSKIP_A57_L1_FLUSH_PWR_DWN	:=	 1
169*91f16700Schasinglulu
170*91f16700Schasinglulu# Do not enable SVE
171*91f16700SchasingluluENABLE_SVE_FOR_NS		:=	0
172*91f16700Schasinglulu
173*91f16700Schasinglulu# Enable the dynamic translation tables library.
174*91f16700Schasingluluifeq (${ARCH},aarch32)
175*91f16700Schasinglulu    ifeq (${RESET_TO_SP_MIN},1)
176*91f16700Schasinglulu        BL32_CPPFLAGS	+=	-DPLAT_XLAT_TABLES_DYNAMIC
177*91f16700Schasinglulu    endif
178*91f16700Schasingluluelse
179*91f16700Schasinglulu    ifeq (${RESET_TO_BL31},1)
180*91f16700Schasinglulu        BL31_CPPFLAGS	+=	-DPLAT_XLAT_TABLES_DYNAMIC
181*91f16700Schasinglulu    endif
182*91f16700Schasingluluendif
183*91f16700Schasinglulu
184*91f16700Schasingluluifeq (${ALLOW_RO_XLAT_TABLES}, 1)
185*91f16700Schasinglulu    ifeq (${JUNO_AARCH32_EL3_RUNTIME}, 1)
186*91f16700Schasinglulu        BL32_CPPFLAGS	+=	-DPLAT_RO_XLAT_TABLES
187*91f16700Schasinglulu    else
188*91f16700Schasinglulu        BL31_CPPFLAGS	+=	-DPLAT_RO_XLAT_TABLES
189*91f16700Schasinglulu    endif
190*91f16700Schasingluluendif
191*91f16700Schasinglulu
192*91f16700SchasingluluBL1_CPPFLAGS += -march=armv8-a+crc
193*91f16700SchasingluluBL2_CPPFLAGS += -march=armv8-a+crc
194*91f16700SchasingluluBL2U_CPPFLAGS += -march=armv8-a+crc
195*91f16700SchasingluluBL31_CPPFLAGS += -march=armv8-a+crc
196*91f16700SchasingluluBL32_CPPFLAGS += -march=armv8-a+crc
197*91f16700Schasinglulu
198*91f16700Schasinglulu# Add the FDT_SOURCES and options for Dynamic Config
199*91f16700SchasingluluFDT_SOURCES		+=	plat/arm/board/juno/fdts/${PLAT}_fw_config.dts	\
200*91f16700Schasinglulu				plat/arm/board/juno/fdts/${PLAT}_tb_fw_config.dts \
201*91f16700Schasinglulu				fdts/${PLAT}.dts
202*91f16700Schasinglulu
203*91f16700SchasingluluFW_CONFIG		:=	${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
204*91f16700SchasingluluTB_FW_CONFIG		:=	${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
205*91f16700SchasingluluHW_CONFIG		:=	${BUILD_PLAT}/fdts/${PLAT}.dtb
206*91f16700Schasinglulu
207*91f16700Schasinglulu# Add the FW_CONFIG to FIP and specify the same to certtool
208*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
209*91f16700Schasinglulu# Add the TB_FW_CONFIG to FIP and specify the same to certtool
210*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
211*91f16700Schasinglulu# Add the HW_CONFIG to FIP and specify the same to certtool
212*91f16700Schasinglulu$(eval $(call TOOL_ADD_PAYLOAD,${HW_CONFIG},--hw-config,${HW_CONFIG}))
213*91f16700Schasinglulu
214*91f16700Schasingluluinclude drivers/arm/ethosn/ethosn_npu.mk
215*91f16700Schasingluluinclude plat/arm/board/common/board_common.mk
216*91f16700Schasingluluinclude plat/arm/common/arm_common.mk
217*91f16700Schasingluluinclude plat/arm/soc/common/soc_css.mk
218*91f16700Schasingluluinclude plat/arm/css/common/css_common.mk
219