Debian Codegraph @

plat/arm/board/juno/platform.mk

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