blob: 065468c582e53a1231e3d5615c05030fce5e7abe [file] [log] [blame]
Soby Mathewec8ac1c2016-05-05 14:32:05 +01001#
Chris Kay68d28362023-01-16 16:53:45 +00002# Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.
Soby Mathewec8ac1c2016-05-05 14:32:05 +01003#
dp-armfa3cf0b2017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Soby Mathewec8ac1c2016-05-05 14:32:05 +01005#
6
7ifneq (${ARCH}, aarch32)
8 $(error SP_MIN is only supported on AArch32 platforms)
9endif
10
Chris Kay1000ea82021-05-19 19:24:37 +010011include lib/extensions/amu/amu.mk
Soby Mathewec8ac1c2016-05-05 14:32:05 +010012include 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 \
Soby Mathew6d07e672018-03-01 10:53:33 +000019 plat/common/aarch32/plat_sp_min_common.c\
Stephan Gerholdf38c3e52023-03-14 11:15:05 +010020 services/arm_arch_svc/arm_arch_svc_setup.c \
Soby Mathewec8ac1c2016-05-05 14:32:05 +010021 services/std_svc/std_svc_setup.c \
22 ${PSCI_LIB_SOURCES}
23
24ifeq (${ENABLE_PMF}, 1)
25BL32_SOURCES += lib/pmf/pmf_main.c
26endif
27
Andre Przywara0b7f1b02023-03-21 13:53:19 +000028ifneq (${ENABLE_FEAT_AMU},0)
Chris Kay1000ea82021-05-19 19:24:37 +010029BL32_SOURCES += ${AMU_SOURCES}
Dimitris Papastamosdda48b02017-10-17 14:03:14 +010030endif
31
Dimitris Papastamos0a4cded2018-01-02 11:37:02 +000032ifeq (${WORKAROUND_CVE_2017_5715},1)
Dimitris Papastamos570c06a2018-04-06 15:29:34 +010033BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_bpiall.S \
34 bl32/sp_min/wa_cve_2017_5715_icache_inv.S
John Powell7f7c6fa2022-04-14 19:10:17 -050035else
36ifeq (${WORKAROUND_CVE_2022_23960},1)
37BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_icache_inv.S
38endif
Dimitris Papastamos0a4cded2018-01-02 11:37:02 +000039endif
40
Andre Przywaraf91762b2021-02-08 18:07:23 +000041ifeq (${TRNG_SUPPORT},1)
42BL32_SOURCES += services/std_svc/trng/trng_main.c \
43 services/std_svc/trng/trng_entropy_pool.c
44endif
45
Sona Mathew7fe03522022-11-18 18:05:38 -060046ifeq (${ERRATA_ABI_SUPPORT}, 1)
47BL32_SOURCES += services/std_svc/errata_abi/errata_abi_main.c
48endif
49
Andre Przywara44e33e02022-11-17 16:42:09 +000050ifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0)
Manish V Badarkhef356f7e2021-06-29 11:44:20 +010051BL32_SOURCES += lib/extensions/sys_reg_trace/aarch32/sys_reg_trace.c
52endif
53
Andre Przywara06ea44e2022-11-17 17:30:43 +000054ifneq (${ENABLE_TRF_FOR_NS},0)
Manish V Badarkhe51a97112021-07-08 09:33:18 +010055BL32_SOURCES += lib/extensions/trf/aarch32/trf.c
56endif
57
Chris Kay68d28362023-01-16 16:53:45 +000058BL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/sp_min/sp_min.ld.S
Soby Mathewec8ac1c2016-05-05 14:32:05 +010059
Chris Kaya5639e12023-01-26 18:31:52 +000060ifneq ($(findstring gcc,$(notdir $(LD))),)
61 BL32_LDFLAGS += -Wl,--sort-section=alignment
62else ifneq ($(findstring ld,$(notdir $(LD))),)
63 BL32_LDFLAGS += --sort-section=alignment
64endif
65
Soby Mathewec8ac1c2016-05-05 14:32:05 +010066# Include the platform-specific SP_MIN Makefile
67# If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported
68# on this platform.
69SP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk)
70ifeq (,${SP_MIN_PLAT_MAKEFILE})
71 $(error SP_MIN is not supported on platform ${PLAT})
72else
73 include ${SP_MIN_PLAT_MAKEFILE}
74endif
75
Yatharth Kochar1c16a4c2016-06-30 14:50:58 +010076RESET_TO_SP_MIN := 0
Soby Mathewec8ac1c2016-05-05 14:32:05 +010077$(eval $(call add_define,RESET_TO_SP_MIN))
78$(eval $(call assert_boolean,RESET_TO_SP_MIN))
Etienne Carrieredc0fea72017-08-09 15:48:53 +020079
80# Flag to allow SP_MIN to handle FIQ interrupts in monitor mode. The platform
81# port is free to override this value. It is default disabled.
82SP_MIN_WITH_SECURE_FIQ ?= 0
83$(eval $(call add_define,SP_MIN_WITH_SECURE_FIQ))
84$(eval $(call assert_boolean,SP_MIN_WITH_SECURE_FIQ))