1c11ba852SSoby Mathew# 282274936SChris Kay# Copyright (c) 2016-2023, 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\ 20c11ba852SSoby Mathew services/std_svc/std_svc_setup.c \ 21c11ba852SSoby Mathew ${PSCI_LIB_SOURCES} 22c11ba852SSoby Mathew 230063dd17SJavier Almansa Sobrinoifeq (${DISABLE_MTPMU},1) 240063dd17SJavier Almansa SobrinoBL32_SOURCES += lib/extensions/mtpmu/aarch32/mtpmu.S 250063dd17SJavier Almansa Sobrinoendif 260063dd17SJavier Almansa Sobrino 27c11ba852SSoby Mathewifeq (${ENABLE_PMF}, 1) 28c11ba852SSoby MathewBL32_SOURCES += lib/pmf/pmf_main.c 29c11ba852SSoby Mathewendif 30c11ba852SSoby Mathew 31d23acc9eSAndre Przywaraifneq (${ENABLE_FEAT_AMU},0) 329b43d098SChris KayBL32_SOURCES += ${AMU_SOURCES} 33ef69e1eaSDimitris Papastamosendif 34ef69e1eaSDimitris Papastamos 357343505dSDimitris Papastamosifeq (${WORKAROUND_CVE_2017_5715},1) 362c3a1078SDimitris PapastamosBL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_bpiall.S \ 372c3a1078SDimitris Papastamos bl32/sp_min/wa_cve_2017_5715_icache_inv.S 38187a6176SJohn Powellelse 39187a6176SJohn Powellifeq (${WORKAROUND_CVE_2022_23960},1) 40187a6176SJohn PowellBL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_icache_inv.S 41187a6176SJohn Powellendif 427343505dSDimitris Papastamosendif 437343505dSDimitris Papastamos 440e14948eSAndre Przywaraifeq (${TRNG_SUPPORT},1) 450e14948eSAndre PrzywaraBL32_SOURCES += services/std_svc/trng/trng_main.c \ 460e14948eSAndre Przywara services/std_svc/trng/trng_entropy_pool.c 470e14948eSAndre Przywaraendif 480e14948eSAndre Przywara 49*ffea3844SSona Mathewifeq (${ERRATA_ABI_SUPPORT}, 1) 50*ffea3844SSona MathewBL32_SOURCES += services/std_svc/errata_abi/errata_abi_main.c 51*ffea3844SSona Mathewendif 52*ffea3844SSona Mathew 53603a0c6fSAndre Przywaraifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0) 54d4582d30SManish V BadarkheBL32_SOURCES += lib/extensions/sys_reg_trace/aarch32/sys_reg_trace.c 55d4582d30SManish V Badarkheendif 56d4582d30SManish V Badarkhe 57fc8d2d39SAndre Przywaraifneq (${ENABLE_TRF_FOR_NS},0) 588fcd3d96SManish V BadarkheBL32_SOURCES += lib/extensions/trf/aarch32/trf.c 598fcd3d96SManish V Badarkheendif 608fcd3d96SManish V Badarkhe 6182274936SChris KayBL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/sp_min/sp_min.ld.S 62c11ba852SSoby Mathew 633d745235SChris Kayifneq ($(findstring gcc,$(notdir $(LD))),) 643d745235SChris Kay BL32_LDFLAGS += -Wl,--sort-section=alignment 653d745235SChris Kayelse ifneq ($(findstring ld,$(notdir $(LD))),) 663d745235SChris Kay BL32_LDFLAGS += --sort-section=alignment 673d745235SChris Kayendif 683d745235SChris Kay 69c11ba852SSoby Mathew# Include the platform-specific SP_MIN Makefile 70c11ba852SSoby Mathew# If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported 71c11ba852SSoby Mathew# on this platform. 72c11ba852SSoby MathewSP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk) 73c11ba852SSoby Mathewifeq (,${SP_MIN_PLAT_MAKEFILE}) 74c11ba852SSoby Mathew $(error SP_MIN is not supported on platform ${PLAT}) 75c11ba852SSoby Mathewelse 76c11ba852SSoby Mathew include ${SP_MIN_PLAT_MAKEFILE} 77c11ba852SSoby Mathewendif 78c11ba852SSoby Mathew 79d9915518SYatharth KocharRESET_TO_SP_MIN := 0 80c11ba852SSoby Mathew$(eval $(call add_define,RESET_TO_SP_MIN)) 81c11ba852SSoby Mathew$(eval $(call assert_boolean,RESET_TO_SP_MIN)) 8271816096SEtienne Carriere 8371816096SEtienne Carriere# Flag to allow SP_MIN to handle FIQ interrupts in monitor mode. The platform 8471816096SEtienne Carriere# port is free to override this value. It is default disabled. 8571816096SEtienne CarriereSP_MIN_WITH_SECURE_FIQ ?= 0 8671816096SEtienne Carriere$(eval $(call add_define,SP_MIN_WITH_SECURE_FIQ)) 8771816096SEtienne Carriere$(eval $(call assert_boolean,SP_MIN_WITH_SECURE_FIQ)) 88