blob: b1f4343f449246dca301a408b5cec1f819d7ba69 [file] [log] [blame]
Soby Mathewc11ba852016-05-05 14:32:05 +01001#
Chris Kayffb77422023-12-04 12:03:51 +00002# Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
Soby Mathewc11ba852016-05-05 14:32:05 +01003#
dp-arm82cb2c12017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Soby Mathewc11ba852016-05-05 14:32:05 +01005#
6
7ifneq (${ARCH}, aarch32)
8 $(error SP_MIN is only supported on AArch32 platforms)
9endif
10
Chris Kay9b43d092021-05-19 19:24:37 +010011include lib/extensions/amu/amu.mk
Soby Mathewc11ba852016-05-05 14:32:05 +010012include lib/psci/psci_lib.mk
13
14INCLUDES += -Iinclude/bl32/sp_min
15
Govindraj Rajade6b79d2024-02-23 16:50:52 -060016BL32_SOURCES += bl32/sp_min/sp_min_main.c \
17 bl32/sp_min/aarch32/entrypoint.S \
18 common/runtime_svc.c \
19 plat/common/aarch32/plat_sp_min_common.c \
Stephan Gerholdcd0786c2023-03-14 11:15:05 +010020 services/arm_arch_svc/arm_arch_svc_setup.c \
Govindraj Rajade6b79d2024-02-23 16:50:52 -060021 services/std_svc/std_svc_setup.c \
Soby Mathewc11ba852016-05-05 14:32:05 +010022 ${PSCI_LIB_SOURCES}
23
24ifeq (${ENABLE_PMF}, 1)
Govindraj Raja3c225872024-05-01 12:23:47 -050025BL32_SOURCES += services/el3/ven_el3_svc.c \
26 lib/pmf/pmf_main.c
Soby Mathewc11ba852016-05-05 14:32:05 +010027endif
28
Andre Przywarad23acc92023-03-21 13:53:19 +000029ifneq (${ENABLE_FEAT_AMU},0)
Chris Kay9b43d092021-05-19 19:24:37 +010030BL32_SOURCES += ${AMU_SOURCES}
Dimitris Papastamosef69e1e2017-10-17 14:03:14 +010031endif
32
Dimitris Papastamos73435052018-01-02 11:37:02 +000033ifeq (${WORKAROUND_CVE_2017_5715},1)
Dimitris Papastamos2c3a1072018-04-06 15:29:34 +010034BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_bpiall.S \
35 bl32/sp_min/wa_cve_2017_5715_icache_inv.S
John Powell187a6172022-04-14 19:10:17 -050036else
37ifeq (${WORKAROUND_CVE_2022_23960},1)
38BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_icache_inv.S
39endif
Dimitris Papastamos73435052018-01-02 11:37:02 +000040endif
41
Andre Przywara0e149482021-02-08 18:07:23 +000042ifeq (${TRNG_SUPPORT},1)
43BL32_SOURCES += services/std_svc/trng/trng_main.c \
44 services/std_svc/trng/trng_entropy_pool.c
45endif
46
Sona Mathewffea3842022-11-18 18:05:38 -060047ifeq (${ERRATA_ABI_SUPPORT}, 1)
48BL32_SOURCES += services/std_svc/errata_abi/errata_abi_main.c
49endif
50
Andre Przywara603a0c62022-11-17 16:42:09 +000051ifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0)
Manish V Badarkhed4582d32021-06-29 11:44:20 +010052BL32_SOURCES += lib/extensions/sys_reg_trace/aarch32/sys_reg_trace.c
53endif
54
Andre Przywarafc8d2d32022-11-17 17:30:43 +000055ifneq (${ENABLE_TRF_FOR_NS},0)
Manish V Badarkhe8fcd3d92021-07-08 09:33:18 +010056BL32_SOURCES += lib/extensions/trf/aarch32/trf.c
57endif
58
Chris Kay82274932023-01-16 16:53:45 +000059BL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/sp_min/sp_min.ld.S
Soby Mathewc11ba852016-05-05 14:32:05 +010060
Chris Kay8620bd02023-12-04 09:55:50 +000061ifeq ($($(ARCH)-ld-id),gnu-gcc)
Chris Kay3d745232023-01-26 18:31:52 +000062 BL32_LDFLAGS += -Wl,--sort-section=alignment
Chris Kay8620bd02023-12-04 09:55:50 +000063else ifneq ($(filter llvm-lld gnu-ld,$($(ARCH)-ld-id)),)
Chris Kay3d745232023-01-26 18:31:52 +000064 BL32_LDFLAGS += --sort-section=alignment
65endif
66
Soby Mathewc11ba852016-05-05 14:32:05 +010067# Include the platform-specific SP_MIN Makefile
68# If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported
69# on this platform.
70SP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk)
71ifeq (,${SP_MIN_PLAT_MAKEFILE})
72 $(error SP_MIN is not supported on platform ${PLAT})
73else
74 include ${SP_MIN_PLAT_MAKEFILE}
75endif
76
Yatharth Kochard9915512016-06-30 14:50:58 +010077RESET_TO_SP_MIN := 0
Soby Mathewc11ba852016-05-05 14:32:05 +010078$(eval $(call add_define,RESET_TO_SP_MIN))
79$(eval $(call assert_boolean,RESET_TO_SP_MIN))
Etienne Carriere71816092017-08-09 15:48:53 +020080
81# Flag to allow SP_MIN to handle FIQ interrupts in monitor mode. The platform
82# port is free to override this value. It is default disabled.
83SP_MIN_WITH_SECURE_FIQ ?= 0
84$(eval $(call add_define,SP_MIN_WITH_SECURE_FIQ))
85$(eval $(call assert_boolean,SP_MIN_WITH_SECURE_FIQ))