xref: /rk3399_ARM-atf/bl32/sp_min/sp_min.mk (revision cd0786c73e536a1d2507d77ce49e2ae2b8ee71a1)
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\
20*cd0786c7SStephan 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)
25c11ba852SSoby MathewBL32_SOURCES		+=	lib/pmf/pmf_main.c
26c11ba852SSoby Mathewendif
27c11ba852SSoby Mathew
28d23acc9eSAndre Przywaraifneq (${ENABLE_FEAT_AMU},0)
299b43d098SChris KayBL32_SOURCES		+=	${AMU_SOURCES}
30ef69e1eaSDimitris Papastamosendif
31ef69e1eaSDimitris Papastamos
327343505dSDimitris Papastamosifeq (${WORKAROUND_CVE_2017_5715},1)
332c3a1078SDimitris PapastamosBL32_SOURCES		+=	bl32/sp_min/wa_cve_2017_5715_bpiall.S	\
342c3a1078SDimitris Papastamos				bl32/sp_min/wa_cve_2017_5715_icache_inv.S
35187a6176SJohn Powellelse
36187a6176SJohn Powellifeq (${WORKAROUND_CVE_2022_23960},1)
37187a6176SJohn PowellBL32_SOURCES		+=	bl32/sp_min/wa_cve_2017_5715_icache_inv.S
38187a6176SJohn Powellendif
397343505dSDimitris Papastamosendif
407343505dSDimitris Papastamos
410e14948eSAndre Przywaraifeq (${TRNG_SUPPORT},1)
420e14948eSAndre PrzywaraBL32_SOURCES		+=	services/std_svc/trng/trng_main.c	\
430e14948eSAndre Przywara				services/std_svc/trng/trng_entropy_pool.c
440e14948eSAndre Przywaraendif
450e14948eSAndre Przywara
46ffea3844SSona Mathewifeq (${ERRATA_ABI_SUPPORT}, 1)
47ffea3844SSona MathewBL32_SOURCES		+=	services/std_svc/errata_abi/errata_abi_main.c
48ffea3844SSona Mathewendif
49ffea3844SSona Mathew
50603a0c6fSAndre Przywaraifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0)
51d4582d30SManish V BadarkheBL32_SOURCES		+=	lib/extensions/sys_reg_trace/aarch32/sys_reg_trace.c
52d4582d30SManish V Badarkheendif
53d4582d30SManish V Badarkhe
54fc8d2d39SAndre Przywaraifneq (${ENABLE_TRF_FOR_NS},0)
558fcd3d96SManish V BadarkheBL32_SOURCES		+=	lib/extensions/trf/aarch32/trf.c
568fcd3d96SManish V Badarkheendif
578fcd3d96SManish V Badarkhe
5882274936SChris KayBL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/sp_min/sp_min.ld.S
59c11ba852SSoby Mathew
603d745235SChris Kayifneq ($(findstring gcc,$(notdir $(LD))),)
613d745235SChris Kay        BL32_LDFLAGS	+=	-Wl,--sort-section=alignment
623d745235SChris Kayelse ifneq ($(findstring ld,$(notdir $(LD))),)
633d745235SChris Kay        BL32_LDFLAGS	+=	--sort-section=alignment
643d745235SChris Kayendif
653d745235SChris Kay
66c11ba852SSoby Mathew# Include the platform-specific SP_MIN Makefile
67c11ba852SSoby Mathew# If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported
68c11ba852SSoby Mathew# on this platform.
69c11ba852SSoby MathewSP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk)
70c11ba852SSoby Mathewifeq (,${SP_MIN_PLAT_MAKEFILE})
71c11ba852SSoby Mathew  $(error SP_MIN is not supported on platform ${PLAT})
72c11ba852SSoby Mathewelse
73c11ba852SSoby Mathew  include ${SP_MIN_PLAT_MAKEFILE}
74c11ba852SSoby Mathewendif
75c11ba852SSoby Mathew
76d9915518SYatharth KocharRESET_TO_SP_MIN	:= 0
77c11ba852SSoby Mathew$(eval $(call add_define,RESET_TO_SP_MIN))
78c11ba852SSoby Mathew$(eval $(call assert_boolean,RESET_TO_SP_MIN))
7971816096SEtienne Carriere
8071816096SEtienne Carriere# Flag to allow SP_MIN to handle FIQ interrupts in monitor mode. The platform
8171816096SEtienne Carriere# port is free to override this value. It is default disabled.
8271816096SEtienne CarriereSP_MIN_WITH_SECURE_FIQ 	?= 0
8371816096SEtienne Carriere$(eval $(call add_define,SP_MIN_WITH_SECURE_FIQ))
8471816096SEtienne Carriere$(eval $(call assert_boolean,SP_MIN_WITH_SECURE_FIQ))
85