bl2.mk 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. BL2_SOURCES += bl2/bl2_image_load_v2.c \
  7. bl2/bl2_main.c \
  8. bl2/${ARCH}/bl2_arch_setup.c \
  9. lib/locks/exclusive/${ARCH}/spinlock.S \
  10. plat/common/${ARCH}/platform_up_stack.S \
  11. ${MBEDTLS_SOURCES}
  12. ifeq (${ARCH},aarch64)
  13. BL2_SOURCES += common/aarch64/early_exceptions.S
  14. endif
  15. ifeq ($($(ARCH)-ld-id),gnu-gcc)
  16. BL2_LDFLAGS += -Wl,--sort-section=alignment
  17. else ifneq ($(filter llvm-lld gnu-ld,$($(ARCH)-ld-id)),)
  18. BL2_LDFLAGS += --sort-section=alignment
  19. endif
  20. ifeq (${ENABLE_RME},1)
  21. # Using RME, run BL2 at EL3
  22. include lib/gpt_rme/gpt_rme.mk
  23. BL2_SOURCES += bl2/${ARCH}/bl2_rme_entrypoint.S \
  24. bl2/${ARCH}/bl2_el3_exceptions.S \
  25. bl2/${ARCH}/bl2_run_next_image.S \
  26. ${GPT_LIB_SRCS}
  27. BL2_DEFAULT_LINKER_SCRIPT_SOURCE := bl2/bl2.ld.S
  28. else ifeq (${RESET_TO_BL2},0)
  29. # Normal operation, no RME, no BL2 at EL3
  30. BL2_SOURCES += bl2/${ARCH}/bl2_entrypoint.S
  31. BL2_DEFAULT_LINKER_SCRIPT_SOURCE := bl2/bl2.ld.S
  32. else
  33. # BL2 at EL3, no RME
  34. BL2_SOURCES += bl2/${ARCH}/bl2_el3_entrypoint.S \
  35. bl2/${ARCH}/bl2_el3_exceptions.S \
  36. bl2/${ARCH}/bl2_run_next_image.S \
  37. lib/cpus/${ARCH}/cpu_helpers.S
  38. ifeq (${ARCH},aarch64)
  39. BL2_SOURCES += lib/cpus/aarch64/dsu_helpers.S
  40. endif
  41. BL2_DEFAULT_LINKER_SCRIPT_SOURCE := bl2/bl2_el3.ld.S
  42. endif
  43. ifeq (${ENABLE_PMF},1)
  44. BL2_SOURCES += lib/pmf/pmf_main.c
  45. endif