sp_min.mk 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #
  2. # Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. ifneq (${ARCH}, aarch32)
  7. $(error SP_MIN is only supported on AArch32 platforms)
  8. endif
  9. include lib/extensions/amu/amu.mk
  10. include lib/psci/psci_lib.mk
  11. INCLUDES += -Iinclude/bl32/sp_min
  12. BL32_SOURCES += bl32/sp_min/sp_min_main.c \
  13. bl32/sp_min/aarch32/entrypoint.S \
  14. common/runtime_svc.c \
  15. plat/common/aarch32/plat_sp_min_common.c\
  16. services/arm_arch_svc/arm_arch_svc_setup.c \
  17. services/std_svc/std_svc_setup.c \
  18. ${PSCI_LIB_SOURCES}
  19. ifeq (${ENABLE_PMF}, 1)
  20. BL32_SOURCES += lib/pmf/pmf_main.c
  21. endif
  22. ifneq (${ENABLE_FEAT_AMU},0)
  23. BL32_SOURCES += ${AMU_SOURCES}
  24. endif
  25. ifeq (${WORKAROUND_CVE_2017_5715},1)
  26. BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_bpiall.S \
  27. bl32/sp_min/wa_cve_2017_5715_icache_inv.S
  28. else
  29. ifeq (${WORKAROUND_CVE_2022_23960},1)
  30. BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_icache_inv.S
  31. endif
  32. endif
  33. ifeq (${TRNG_SUPPORT},1)
  34. BL32_SOURCES += services/std_svc/trng/trng_main.c \
  35. services/std_svc/trng/trng_entropy_pool.c
  36. endif
  37. ifeq (${ERRATA_ABI_SUPPORT}, 1)
  38. BL32_SOURCES += services/std_svc/errata_abi/errata_abi_main.c
  39. endif
  40. ifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0)
  41. BL32_SOURCES += lib/extensions/sys_reg_trace/aarch32/sys_reg_trace.c
  42. endif
  43. ifneq (${ENABLE_TRF_FOR_NS},0)
  44. BL32_SOURCES += lib/extensions/trf/aarch32/trf.c
  45. endif
  46. BL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/sp_min/sp_min.ld.S
  47. ifneq ($(findstring gcc,$(notdir $(LD))),)
  48. BL32_LDFLAGS += -Wl,--sort-section=alignment
  49. else ifneq ($(findstring ld,$(notdir $(LD))),)
  50. BL32_LDFLAGS += --sort-section=alignment
  51. endif
  52. # Include the platform-specific SP_MIN Makefile
  53. # If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported
  54. # on this platform.
  55. SP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk)
  56. ifeq (,${SP_MIN_PLAT_MAKEFILE})
  57. $(error SP_MIN is not supported on platform ${PLAT})
  58. else
  59. include ${SP_MIN_PLAT_MAKEFILE}
  60. endif
  61. RESET_TO_SP_MIN := 0
  62. $(eval $(call add_define,RESET_TO_SP_MIN))
  63. $(eval $(call assert_boolean,RESET_TO_SP_MIN))
  64. # Flag to allow SP_MIN to handle FIQ interrupts in monitor mode. The platform
  65. # port is free to override this value. It is default disabled.
  66. SP_MIN_WITH_SECURE_FIQ ?= 0
  67. $(eval $(call add_define,SP_MIN_WITH_SECURE_FIQ))
  68. $(eval $(call assert_boolean,SP_MIN_WITH_SECURE_FIQ))