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 ($($(ARCH)-ld-id),gnu-gcc) 19 BL2_LDFLAGS += -Wl,--sort-section=alignment 20else ifneq ($(filter llvm-lld gnu-ld,$($(ARCH)-ld-id)),) 21 BL2_LDFLAGS += --sort-section=alignment 22endif 23 24ifeq (${ENABLE_RME},1) 25include lib/gpt_rme/gpt_rme.mk 26 27BL2_SOURCES += ${GPT_LIB_SRCS} 28endif 29 30ifeq (${BL2_RUNS_AT_EL3},1) 31BL2_SOURCES += bl2/${ARCH}/bl2_el3_entrypoint.S \ 32 bl2/${ARCH}/bl2_el3_exceptions.S \ 33 bl2/${ARCH}/bl2_run_next_image.S 34 35BL2_DEFAULT_LINKER_SCRIPT_SOURCE := bl2/bl2_el3.ld.S 36else 37# Normal operation, no RME, no BL2 at EL3 38BL2_SOURCES += bl2/${ARCH}/bl2_entrypoint.S 39BL2_DEFAULT_LINKER_SCRIPT_SOURCE := bl2/bl2.ld.S 40endif 41 42ifeq (${RESET_TO_BL2},1) 43# BL2 at EL3, no RME 44BL2_SOURCES += lib/cpus/${ARCH}/cpu_helpers.S 45endif 46 47ifeq (${ENABLE_PMF},1) 48BL2_SOURCES += lib/pmf/pmf_main.c 49endif 50