sp_min.mk 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #
  2. # Copyright (c) 2016-2024, 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 += services/el3/ven_el3_svc.c \
  21. lib/pmf/pmf_main.c
  22. endif
  23. ifneq (${ENABLE_FEAT_AMU},0)
  24. BL32_SOURCES += ${AMU_SOURCES}
  25. endif
  26. ifeq (${WORKAROUND_CVE_2017_5715},1)
  27. BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_bpiall.S \
  28. bl32/sp_min/wa_cve_2017_5715_icache_inv.S
  29. else
  30. ifeq (${WORKAROUND_CVE_2022_23960},1)
  31. BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_icache_inv.S
  32. endif
  33. endif
  34. ifeq (${TRNG_SUPPORT},1)
  35. BL32_SOURCES += services/std_svc/trng/trng_main.c \
  36. services/std_svc/trng/trng_entropy_pool.c
  37. endif
  38. ifeq (${ERRATA_ABI_SUPPORT}, 1)
  39. BL32_SOURCES += services/std_svc/errata_abi/errata_abi_main.c
  40. endif
  41. ifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0)
  42. BL32_SOURCES += lib/extensions/sys_reg_trace/aarch32/sys_reg_trace.c
  43. endif
  44. ifneq (${ENABLE_TRF_FOR_NS},0)
  45. BL32_SOURCES += lib/extensions/trf/aarch32/trf.c
  46. endif
  47. BL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/sp_min/sp_min.ld.S
  48. ifeq ($($(ARCH)-ld-id),gnu-gcc)
  49. BL32_LDFLAGS += -Wl,--sort-section=alignment
  50. else ifneq ($(filter llvm-lld gnu-ld,$($(ARCH)-ld-id)),)
  51. BL32_LDFLAGS += --sort-section=alignment
  52. endif
  53. # Include the platform-specific SP_MIN Makefile
  54. # If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported
  55. # on this platform.
  56. SP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk)
  57. ifeq (,${SP_MIN_PLAT_MAKEFILE})
  58. $(error SP_MIN is not supported on platform ${PLAT})
  59. else
  60. include ${SP_MIN_PLAT_MAKEFILE}
  61. endif
  62. RESET_TO_SP_MIN := 0
  63. $(eval $(call add_define,RESET_TO_SP_MIN))
  64. $(eval $(call assert_boolean,RESET_TO_SP_MIN))
  65. # Flag to allow SP_MIN to handle FIQ interrupts in monitor mode. The platform
  66. # port is free to override this value. It is default disabled.
  67. SP_MIN_WITH_SECURE_FIQ ?= 0
  68. $(eval $(call add_define,SP_MIN_WITH_SECURE_FIQ))
  69. $(eval $(call assert_boolean,SP_MIN_WITH_SECURE_FIQ))