bl2.mk 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #
  2. # Copyright (c) 2013-2023, 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. ifneq ($(findstring gcc,$(notdir $(LD))),)
  16. BL2_LDFLAGS += -Wl,--sort-section=alignment
  17. else ifneq ($(findstring ld,$(notdir $(LD))),)
  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