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