1# 2# Copyright (c) 2013-2025, Arm Limited and Contributors. All rights reserved. 3# 4# SPDX-License-Identifier: BSD-3-Clause 5# 6 7BL2_SOURCES += bl2/bl2_image_load_v2.c \ 8 bl2/bl2_main.c \ 9 bl2/${ARCH}/bl2_arch_setup.c \ 10 lib/locks/exclusive/${ARCH}/spinlock.S \ 11 plat/common/${ARCH}/platform_up_stack.S \ 12 ${MBEDTLS_SOURCES} 13 14ifeq (${ARCH},aarch64) 15BL2_SOURCES += common/aarch64/early_exceptions.S 16endif 17 18ifeq (${ENABLE_RME},1) 19include lib/gpt_rme/gpt_rme.mk 20 21BL2_SOURCES += ${GPT_LIB_SRCS} 22endif 23 24ifeq (${BL2_RUNS_AT_EL3},1) 25BL2_SOURCES += bl2/${ARCH}/bl2_el3_entrypoint.S \ 26 bl2/${ARCH}/bl2_el3_exceptions.S \ 27 bl2/${ARCH}/bl2_run_next_image.S 28 29BL2_DEFAULT_LINKER_SCRIPT_SOURCE := bl2/bl2_el3.ld.S 30else 31# Normal operation, no RME, no BL2 at EL3 32BL2_SOURCES += bl2/${ARCH}/bl2_entrypoint.S 33BL2_DEFAULT_LINKER_SCRIPT_SOURCE := bl2/bl2.ld.S 34endif 35 36ifeq (${RESET_TO_BL2},1) 37# BL2 at EL3, no RME 38BL2_SOURCES += lib/cpus/${ARCH}/cpu_helpers.S 39endif 40 41ifeq (${ENABLE_PMF},1) 42BL2_SOURCES += lib/pmf/pmf_main.c 43endif 44 45# CRYPTO_SUPPORT 46NEED_AUTH := $(if $(filter 1,$(TRUSTED_BOARD_BOOT)),1,) 47NEED_HASH := $(if $(filter 1,$(MEASURED_BOOT) $(DRTM_SUPPORT)),1,) 48$(eval $(call set_crypto_support,NEED_AUTH,NEED_HASH)) 49 50ifneq ($(filter 1 2 3,$(CRYPTO_SUPPORT)),) 51CRYPTO_LIB := $(BUILD_PLAT)/lib/libmbedtls.a 52endif 53 54# BL2_CPPFLAGS 55$(eval BL2_CPPFLAGS += $(call make_defines, \ 56 $(sort \ 57 CRYPTO_SUPPORT \ 58))) 59 60# Numeric_Flags 61$(eval $(call assert_numerics,\ 62 $(sort \ 63 CRYPTO_SUPPORT \ 64))) 65