xref: /rk3399_ARM-atf/bl2/bl2.mk (revision 04cf04c72d403e0c057505882fac9002d39d4102)
14f6ad66aSAchin Gupta#
2b62673c6SBoyan Karatotev# Copyright (c) 2013-2025, Arm Limited and Contributors. All rights reserved.
34f6ad66aSAchin Gupta#
482cb2c1aSdp-arm# SPDX-License-Identifier: BSD-3-Clause
54f6ad66aSAchin Gupta#
64f6ad66aSAchin Gupta
79d93fc2fSAntonio Nino DiazBL2_SOURCES		+=	bl2/bl2_image_load_v2.c			\
89d93fc2fSAntonio Nino Diaz				bl2/bl2_main.c				\
9d48c12e9SYatharth Kochar				bl2/${ARCH}/bl2_arch_setup.c		\
1075311203Sdp-arm				lib/locks/exclusive/${ARCH}/spinlock.S	\
1176d26733SRoberto Vargas				plat/common/${ARCH}/platform_up_stack.S	\
12180c4bc2SRoberto Vargas				${MBEDTLS_SOURCES}
13d48c12e9SYatharth Kochar
14d48c12e9SYatharth Kocharifeq (${ARCH},aarch64)
15d48c12e9SYatharth KocharBL2_SOURCES		+=	common/aarch64/early_exceptions.S
16d48c12e9SYatharth Kocharendif
174f6ad66aSAchin Gupta
188620bd0bSChris Kayifeq ($($(ARCH)-ld-id),gnu-gcc)
19cef66c3eSChris Kay        BL2_LDFLAGS	+=	-Wl,--sort-section=alignment
208620bd0bSChris Kayelse ifneq ($(filter llvm-lld gnu-ld,$($(ARCH)-ld-id)),)
21cef66c3eSChris Kay        BL2_LDFLAGS	+=	--sort-section=alignment
22cef66c3eSChris Kayendif
23cef66c3eSChris Kay
246c09af9fSZelalem Awekeifeq (${ENABLE_RME},1)
25f19dc624Sjohpow01include lib/gpt_rme/gpt_rme.mk
261839012dSZelalem Aweke
27*04cf04c7SBoyan KaratotevBL2_SOURCES		+=	${GPT_LIB_SRCS}
28*04cf04c7SBoyan Karatotevendif
296c09af9fSZelalem Aweke
30*04cf04c7SBoyan Karatotevifeq (${BL2_RUNS_AT_EL3},1)
31*04cf04c7SBoyan KaratotevBL2_SOURCES		+=      bl2/${ARCH}/bl2_el3_entrypoint.S	\
32*04cf04c7SBoyan Karatotev				bl2/${ARCH}/bl2_el3_exceptions.S	\
33*04cf04c7SBoyan Karatotev				bl2/${ARCH}/bl2_run_next_image.S
34*04cf04c7SBoyan Karatotev
35*04cf04c7SBoyan KaratotevBL2_DEFAULT_LINKER_SCRIPT_SOURCE := bl2/bl2_el3.ld.S
36*04cf04c7SBoyan Karatotevelse
376c09af9fSZelalem Aweke# Normal operation, no RME, no BL2 at EL3
38b1d27b48SRoberto VargasBL2_SOURCES		+=	bl2/${ARCH}/bl2_entrypoint.S
3982274936SChris KayBL2_DEFAULT_LINKER_SCRIPT_SOURCE := bl2/bl2.ld.S
40*04cf04c7SBoyan Karatotevendif
41b1d27b48SRoberto Vargas
42*04cf04c7SBoyan Karatotevifeq (${RESET_TO_BL2},1)
436c09af9fSZelalem Aweke# BL2 at EL3, no RME
44*04cf04c7SBoyan KaratotevBL2_SOURCES		+=	lib/cpus/${ARCH}/cpu_helpers.S
45b1d27b48SRoberto Vargasendif
46ed8f06ddSthagon01-arm
47ed8f06ddSthagon01-armifeq (${ENABLE_PMF},1)
48ed8f06ddSthagon01-armBL2_SOURCES		+=	lib/pmf/pmf_main.c
49ed8f06ddSthagon01-armendif
50