1c11ba852SSoby Mathew# 2*79e7aae8SHarrison Mutai# Copyright (c) 2016-2025, Arm Limited and Contributors. All rights reserved. 3c11ba852SSoby Mathew# 482cb2c1aSdp-arm# SPDX-License-Identifier: BSD-3-Clause 5c11ba852SSoby Mathew# 6c11ba852SSoby Mathew 7c11ba852SSoby Mathewifneq (${ARCH}, aarch32) 8c11ba852SSoby Mathew $(error SP_MIN is only supported on AArch32 platforms) 9c11ba852SSoby Mathewendif 10c11ba852SSoby Mathew 119b43d098SChris Kayinclude lib/extensions/amu/amu.mk 12c11ba852SSoby Mathewinclude lib/psci/psci_lib.mk 13c11ba852SSoby Mathew 14c11ba852SSoby MathewINCLUDES += -Iinclude/bl32/sp_min 15c11ba852SSoby Mathew 16c11ba852SSoby MathewBL32_SOURCES += bl32/sp_min/sp_min_main.c \ 17c11ba852SSoby Mathew bl32/sp_min/aarch32/entrypoint.S \ 18c11ba852SSoby Mathew common/runtime_svc.c \ 190ed8c001SSoby Mathew plat/common/aarch32/plat_sp_min_common.c \ 20cd0786c7SStephan Gerhold services/arm_arch_svc/arm_arch_svc_setup.c \ 21c11ba852SSoby Mathew services/std_svc/std_svc_setup.c \ 22c11ba852SSoby Mathew ${PSCI_LIB_SOURCES} 23c11ba852SSoby Mathew 24c11ba852SSoby Mathewifeq (${ENABLE_PMF}, 1) 253c225878SGovindraj RajaBL32_SOURCES += services/el3/ven_el3_svc.c \ 263c225878SGovindraj Raja lib/pmf/pmf_main.c 27c11ba852SSoby Mathewendif 28c11ba852SSoby Mathew 29d23acc9eSAndre Przywaraifneq (${ENABLE_FEAT_AMU},0) 309b43d098SChris KayBL32_SOURCES += ${AMU_SOURCES} 31ef69e1eaSDimitris Papastamosendif 32ef69e1eaSDimitris Papastamos 337343505dSDimitris Papastamosifeq (${WORKAROUND_CVE_2017_5715},1) 342c3a1078SDimitris PapastamosBL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_bpiall.S \ 352c3a1078SDimitris Papastamos bl32/sp_min/wa_cve_2017_5715_icache_inv.S 36187a6176SJohn Powellelse 37187a6176SJohn Powellifeq (${WORKAROUND_CVE_2022_23960},1) 38187a6176SJohn PowellBL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_icache_inv.S 39187a6176SJohn Powellendif 407343505dSDimitris Papastamosendif 417343505dSDimitris Papastamos 420e14948eSAndre Przywaraifeq (${TRNG_SUPPORT},1) 430e14948eSAndre PrzywaraBL32_SOURCES += services/std_svc/trng/trng_main.c \ 440e14948eSAndre Przywara services/std_svc/trng/trng_entropy_pool.c 450e14948eSAndre Przywaraendif 460e14948eSAndre Przywara 47ffea3844SSona Mathewifeq (${ERRATA_ABI_SUPPORT}, 1) 48ffea3844SSona MathewBL32_SOURCES += services/std_svc/errata_abi/errata_abi_main.c 49ffea3844SSona Mathewendif 50ffea3844SSona Mathew 51603a0c6fSAndre Przywaraifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0) 52d4582d30SManish V BadarkheBL32_SOURCES += lib/extensions/sys_reg_trace/aarch32/sys_reg_trace.c 53d4582d30SManish V Badarkheendif 54d4582d30SManish V Badarkhe 55fc8d2d39SAndre Przywaraifneq (${ENABLE_TRF_FOR_NS},0) 568fcd3d96SManish V BadarkheBL32_SOURCES += lib/extensions/trf/aarch32/trf.c 578fcd3d96SManish V Badarkheendif 588fcd3d96SManish V Badarkhe 5982274936SChris KayBL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/sp_min/sp_min.ld.S 60c11ba852SSoby Mathew 618620bd0bSChris Kayifeq ($($(ARCH)-ld-id),gnu-gcc) 623d745235SChris Kay BL32_LDFLAGS += -Wl,--sort-section=alignment 638620bd0bSChris Kayelse ifneq ($(filter llvm-lld gnu-ld,$($(ARCH)-ld-id)),) 643d745235SChris Kay BL32_LDFLAGS += --sort-section=alignment 653d745235SChris Kayendif 663d745235SChris Kay 67c11ba852SSoby Mathew# Include the platform-specific SP_MIN Makefile 68c11ba852SSoby Mathew# If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported 69c11ba852SSoby Mathew# on this platform. 70c11ba852SSoby MathewSP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk) 71c11ba852SSoby Mathewifeq (,${SP_MIN_PLAT_MAKEFILE}) 72c11ba852SSoby Mathew $(error SP_MIN is not supported on platform ${PLAT}) 73c11ba852SSoby Mathewelse 74c11ba852SSoby Mathew include ${SP_MIN_PLAT_MAKEFILE} 75c11ba852SSoby Mathewendif 76c11ba852SSoby Mathew 77d9915518SYatharth KocharRESET_TO_SP_MIN := 0 78c11ba852SSoby Mathew$(eval $(call add_define,RESET_TO_SP_MIN)) 79c11ba852SSoby Mathew$(eval $(call assert_boolean,RESET_TO_SP_MIN)) 8071816096SEtienne Carriere 8171816096SEtienne Carriere# Flag to allow SP_MIN to handle FIQ interrupts in monitor mode. The platform 8271816096SEtienne Carriere# port is free to override this value. It is default disabled. 8371816096SEtienne CarriereSP_MIN_WITH_SECURE_FIQ ?= 0 8471816096SEtienne Carriere$(eval $(call add_define,SP_MIN_WITH_SECURE_FIQ)) 8571816096SEtienne Carriere$(eval $(call assert_boolean,SP_MIN_WITH_SECURE_FIQ)) 86*79e7aae8SHarrison Mutai 87*79e7aae8SHarrison Mutaiifeq (${TRANSFER_LIST},1) 88*79e7aae8SHarrison MutaiBL32_SOURCES += $(TRANSFER_LIST_SOURCES) 89*79e7aae8SHarrison Mutaiendif 90