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