1c11ba852SSoby Mathew# 279e7aae8SHarrison 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 \ 20*98859b99SSammit Joshi lib/per_cpu/per_cpu.c \ 21cd0786c7SStephan Gerhold services/arm_arch_svc/arm_arch_svc_setup.c \ 22c11ba852SSoby Mathew services/std_svc/std_svc_setup.c \ 23c11ba852SSoby Mathew ${PSCI_LIB_SOURCES} 24c11ba852SSoby Mathew 25c11ba852SSoby Mathewifeq (${ENABLE_PMF}, 1) 263c225878SGovindraj RajaBL32_SOURCES += services/el3/ven_el3_svc.c \ 273c225878SGovindraj Raja lib/pmf/pmf_main.c 28c11ba852SSoby Mathewendif 29c11ba852SSoby Mathew 30d23acc9eSAndre Przywaraifneq (${ENABLE_FEAT_AMU},0) 319b43d098SChris KayBL32_SOURCES += ${AMU_SOURCES} 32ef69e1eaSDimitris Papastamosendif 33ef69e1eaSDimitris Papastamos 347343505dSDimitris Papastamosifeq (${WORKAROUND_CVE_2017_5715},1) 352c3a1078SDimitris PapastamosBL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_bpiall.S \ 362c3a1078SDimitris Papastamos bl32/sp_min/wa_cve_2017_5715_icache_inv.S 37187a6176SJohn Powellelse 38187a6176SJohn Powellifeq (${WORKAROUND_CVE_2022_23960},1) 39187a6176SJohn PowellBL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_icache_inv.S 40187a6176SJohn Powellendif 417343505dSDimitris Papastamosendif 427343505dSDimitris Papastamos 430e14948eSAndre Przywaraifeq (${TRNG_SUPPORT},1) 440e14948eSAndre PrzywaraBL32_SOURCES += services/std_svc/trng/trng_main.c \ 450e14948eSAndre Przywara services/std_svc/trng/trng_entropy_pool.c 460e14948eSAndre Przywaraendif 470e14948eSAndre Przywara 48ffea3844SSona Mathewifeq (${ERRATA_ABI_SUPPORT}, 1) 49ffea3844SSona MathewBL32_SOURCES += services/std_svc/errata_abi/errata_abi_main.c 50ffea3844SSona Mathewendif 51ffea3844SSona Mathew 52603a0c6fSAndre Przywaraifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0) 53d4582d30SManish V BadarkheBL32_SOURCES += lib/extensions/sys_reg_trace/aarch32/sys_reg_trace.c 54d4582d30SManish V Badarkheendif 55d4582d30SManish V Badarkhe 56fc8d2d39SAndre Przywaraifneq (${ENABLE_TRF_FOR_NS},0) 578fcd3d96SManish V BadarkheBL32_SOURCES += lib/extensions/trf/aarch32/trf.c 588fcd3d96SManish V Badarkheendif 598fcd3d96SManish V Badarkhe 6082274936SChris KayBL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/sp_min/sp_min.ld.S 61c11ba852SSoby Mathew 62c11ba852SSoby Mathew# Include the platform-specific SP_MIN Makefile 63c11ba852SSoby Mathew# If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported 64c11ba852SSoby Mathew# on this platform. 65c11ba852SSoby MathewSP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk) 66c11ba852SSoby Mathewifeq (,${SP_MIN_PLAT_MAKEFILE}) 67c11ba852SSoby Mathew $(error SP_MIN is not supported on platform ${PLAT}) 68c11ba852SSoby Mathewelse 69c11ba852SSoby Mathew include ${SP_MIN_PLAT_MAKEFILE} 70c11ba852SSoby Mathewendif 71c11ba852SSoby Mathew 72d9915518SYatharth KocharRESET_TO_SP_MIN := 0 73c11ba852SSoby Mathew$(eval $(call add_define,RESET_TO_SP_MIN)) 74c11ba852SSoby Mathew$(eval $(call assert_boolean,RESET_TO_SP_MIN)) 7571816096SEtienne Carriere 7671816096SEtienne Carriere# Flag to allow SP_MIN to handle FIQ interrupts in monitor mode. The platform 7771816096SEtienne Carriere# port is free to override this value. It is default disabled. 7871816096SEtienne CarriereSP_MIN_WITH_SECURE_FIQ ?= 0 7971816096SEtienne Carriere$(eval $(call add_define,SP_MIN_WITH_SECURE_FIQ)) 8071816096SEtienne Carriere$(eval $(call assert_boolean,SP_MIN_WITH_SECURE_FIQ)) 8179e7aae8SHarrison Mutai 8279e7aae8SHarrison Mutaiifeq (${TRANSFER_LIST},1) 8379e7aae8SHarrison MutaiBL32_SOURCES += $(TRANSFER_LIST_SOURCES) 8479e7aae8SHarrison Mutaiendif 85