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