blob: 4c93a55ad8a82dd5ebddd63d27b5ebadc24d48a4 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001#
Jayanth Dodderi Chidanand9461a892022-01-17 18:57:17 +00002# Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01003#
dp-armfa3cf0b2017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Achin Gupta4f6ad662013-10-25 09:08:21 +01005#
6
Antonio Nino Diazc41f2062017-10-24 10:07:35 +01007################################################################################
Paul Beesleydb4e25a2019-10-14 15:27:12 +00008# Include Makefile for the SPM-MM implementation
Antonio Nino Diazc41f2062017-10-24 10:07:35 +01009################################################################################
Javier Almansa Sobrinoe1ecd232020-08-20 18:48:09 +010010ifeq (${SUPPORT_UNKNOWN_MPID},1)
11 ifeq (${DEBUG},0)
12 $(warning WARNING: SUPPORT_UNKNOWN_MPID enabled)
13 endif
14endif
15
Paul Beesleyfe975b42019-09-16 11:29:03 +000016ifeq (${SPM_MM},1)
17 ifeq (${EL3_EXCEPTION_HANDLING},0)
Paul Beesleydb4e25a2019-10-14 15:27:12 +000018 $(error EL3_EXCEPTION_HANDLING must be 1 for SPM-MM support)
Antonio Nino Diaz8cd7ea32018-10-30 11:08:08 +000019 else
Paul Beesleyfe975b42019-09-16 11:29:03 +000020 $(info Including SPM Management Mode (MM) makefile)
Marc Bonnici758bd242021-12-19 21:37:50 +000021 include services/std_svc/spm/common/spm.mk
22 include services/std_svc/spm/spm_mm/spm_mm.mk
Antonio Nino Diaz8cd7ea32018-10-30 11:08:08 +000023 endif
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010024endif
25
Chris Kay1000ea82021-05-19 19:24:37 +010026include lib/extensions/amu/amu.mk
Chris Kay03be39d2021-05-05 13:38:30 +010027include lib/mpmm/mpmm.mk
Marc Bonniciabaac162021-12-01 18:00:40 +000028
29ifeq (${SPMC_AT_EL3},1)
30 $(warning "EL3 SPMC is an experimental feature")
31 $(info Including EL3 SPMC makefile)
32 include services/std_svc/spm/common/spm.mk
33 include services/std_svc/spm/el3_spmc/spmc.mk
34endif
35
Soby Mathew0d786072016-03-24 16:56:29 +000036include lib/psci/psci_lib.mk
37
Dan Handley176e7b42014-04-15 18:20:09 +010038BL31_SOURCES += bl31/bl31_main.c \
Achin Gupta191e86e2014-05-09 10:03:15 +010039 bl31/interrupt_mgmt.c \
Dan Handley176e7b42014-04-15 18:20:09 +010040 bl31/aarch64/bl31_entrypoint.S \
Andrew Thoelke4d2d5532014-06-02 12:38:12 +010041 bl31/aarch64/crash_reporting.S \
Jeenu Viswambharane86a2472018-07-05 15:24:45 +010042 bl31/aarch64/ea_delegate.S \
Jeenu Viswambharan2de81532018-02-16 11:54:24 +000043 bl31/aarch64/runtime_exceptions.S \
Yatharth Kochar6c0566c2015-10-02 17:56:48 +010044 bl31/bl31_context_mgmt.c \
Soby Mathew0d786072016-03-24 16:56:29 +000045 common/runtime_svc.c \
John Tsichritzis4daa1de2018-07-23 09:11:59 +010046 lib/cpus/aarch64/dsu_helpers.S \
dp-arm230011c2017-03-07 11:02:47 +000047 plat/common/aarch64/platform_mp_stack.S \
Dimitris Papastamos0dcdb1a2018-01-19 16:58:29 +000048 services/arm_arch_svc/arm_arch_svc_setup.c \
Dan Handley176e7b42014-04-15 18:20:09 +010049 services/std_svc/std_svc_setup.c \
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010050 ${PSCI_LIB_SOURCES} \
Achin Gupta60b7b8a2019-10-11 15:50:43 +010051 ${SPMD_SOURCES} \
Marc Bonnici758bd242021-12-19 21:37:50 +000052 ${SPM_MM_SOURCES} \
Marc Bonniciabaac162021-12-01 18:00:40 +000053 ${SPMC_SOURCES} \
Jeenu Viswambharan2de81532018-02-16 11:54:24 +000054 ${SPM_SOURCES}
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010055
Javier Almansa Sobrinof3a4c542020-11-23 18:38:15 +000056ifeq (${DISABLE_MTPMU},1)
57BL31_SOURCES += lib/extensions/mtpmu/aarch64/mtpmu.S
58endif
Soby Mathew523d6332015-01-08 18:02:19 +000059
Yatharth Kochar9518d022016-03-11 14:20:19 +000060ifeq (${ENABLE_PMF}, 1)
61BL31_SOURCES += lib/pmf/pmf_main.c
62endif
63
Olivier Deprezcb4c5622019-09-19 17:46:46 +020064include lib/debugfs/debugfs.mk
65ifeq (${USE_DEBUGFS},1)
66 BL31_SOURCES += $(DEBUGFS_SRCS)
67endif
68
Jeenu Viswambharan10a67272017-09-22 08:32:10 +010069ifeq (${EL3_EXCEPTION_HANDLING},1)
70BL31_SOURCES += bl31/ehf.c
71endif
72
Jeenu Viswambharan04e3a7f2017-10-16 08:43:14 +010073ifeq (${SDEI_SUPPORT},1)
74ifeq (${EL3_EXCEPTION_HANDLING},0)
75 $(error EL3_EXCEPTION_HANDLING must be 1 for SDEI support)
76endif
Jeenu Viswambharan8b7e6bc2018-02-16 12:07:48 +000077BL31_SOURCES += services/std_svc/sdei/sdei_dispatch.S \
78 services/std_svc/sdei/sdei_event.c \
Jeenu Viswambharan04e3a7f2017-10-16 08:43:14 +010079 services/std_svc/sdei/sdei_intr_mgmt.c \
80 services/std_svc/sdei/sdei_main.c \
81 services/std_svc/sdei/sdei_state.c
82endif
83
Jimmy Brisson26c5b5c2020-06-22 14:18:42 -050084ifeq (${TRNG_SUPPORT},1)
85BL31_SOURCES += services/std_svc/trng/trng_main.c \
86 services/std_svc/trng/trng_entropy_pool.c
87endif
88
Dimitris Papastamos5bdbb472017-10-13 12:06:06 +010089ifeq (${ENABLE_SPE_FOR_LOWER_ELS},1)
90BL31_SOURCES += lib/extensions/spe/spe.c
91endif
92
Dimitris Papastamose08005a2017-10-12 13:02:29 +010093ifeq (${ENABLE_AMU},1)
Chris Kay1000ea82021-05-19 19:24:37 +010094BL31_SOURCES += ${AMU_SOURCES}
Dimitris Papastamose08005a2017-10-12 13:02:29 +010095endif
96
Chris Kay03be39d2021-05-05 13:38:30 +010097ifeq (${ENABLE_MPMM},1)
98BL31_SOURCES += ${MPMM_SOURCES}
99endif
100
johpow019baade32021-07-08 14:14:00 -0500101ifeq (${ENABLE_SME_FOR_NS},1)
102BL31_SOURCES += lib/extensions/sme/sme.c
103BL31_SOURCES += lib/extensions/sve/sve.c
104else
David Cunadoce88eee2017-10-20 11:30:57 +0100105ifeq (${ENABLE_SVE_FOR_NS},1)
106BL31_SOURCES += lib/extensions/sve/sve.c
107endif
johpow019baade32021-07-08 14:14:00 -0500108endif
David Cunadoce88eee2017-10-20 11:30:57 +0100109
Jeenu Viswambharan2da918c2018-07-31 16:13:33 +0100110ifeq (${ENABLE_MPAM_FOR_LOWER_ELS},1)
111BL31_SOURCES += lib/extensions/mpam/mpam.c
112endif
113
Manish V Badarkhe20df29c2021-07-02 09:10:56 +0100114ifeq (${ENABLE_TRBE_FOR_NS},1)
115BL31_SOURCES += lib/extensions/trbe/trbe.c
116endif
117
johpow0181865962022-01-28 17:06:20 -0600118ifeq (${ENABLE_BRBE_FOR_NS},1)
119BL31_SOURCES += lib/extensions/brbe/brbe.c
120endif
121
Manish V Badarkhef356f7e2021-06-29 11:44:20 +0100122ifeq (${ENABLE_SYS_REG_TRACE_FOR_NS},1)
123BL31_SOURCES += lib/extensions/sys_reg_trace/aarch64/sys_reg_trace.c
124endif
125
Manish V Badarkhe51a97112021-07-08 09:33:18 +0100126ifeq (${ENABLE_TRF_FOR_NS},1)
127BL31_SOURCES += lib/extensions/trf/aarch64/trf.c
128endif
129
Dimitris Papastamos446f7f12017-11-30 14:53:53 +0000130ifeq (${WORKAROUND_CVE_2017_5715},1)
Dimitris Papastamos570c06a2018-04-06 15:29:34 +0100131BL31_SOURCES += lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S \
132 lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
Dimitris Papastamos446f7f12017-11-30 14:53:53 +0000133endif
134
Jeremy Lintonc8c3e0d2020-11-18 10:17:57 -0600135ifeq ($(SMC_PCI_SUPPORT),1)
136BL31_SOURCES += services/std_svc/pci_svc.c
137endif
138
Zelalem Aweke13dc8f12021-07-09 14:20:03 -0500139ifeq (${ENABLE_RME},1)
johpow019d134022021-06-16 17:57:28 -0500140include lib/gpt_rme/gpt_rme.mk
Zelalem Aweke8e2e24b2021-07-13 14:05:20 -0500141
142BL31_SOURCES += ${GPT_LIB_SRCS} \
143 ${RMMD_SOURCES}
Zelalem Aweke13dc8f12021-07-09 14:20:03 -0500144endif
145
Jayanth Dodderi Chidanand9461a892022-01-17 18:57:17 +0000146ifeq ($(FEATURE_DETECTION),1)
147BL31_SOURCES += common/feat_detect.c
148endif
149
Manish V Badarkhe8a766032022-02-23 11:26:53 +0000150ifeq (${DRTM_SUPPORT},1)
johpow01baa3e6c2022-03-11 17:50:58 -0600151BL31_SOURCES += services/std_svc/drtm/drtm_main.c \
152 services/std_svc/drtm/drtm_dma_prot.c \
153 services/std_svc/drtm/drtm_res_address_map.c \
Manish V Badarkhe19b22f92022-06-17 11:42:17 +0100154 services/std_svc/drtm/drtm_measurements.c \
Manish V Badarkhe39dd5552022-06-21 09:41:32 +0100155 services/std_svc/drtm/drtm_remediation.c \
Manish V Badarkhec8168072022-02-25 09:11:12 +0000156 ${MBEDTLS_SOURCES}
Manish V Badarkhe8a766032022-02-23 11:26:53 +0000157endif
158
Dan Handley176e7b42014-04-15 18:20:09 +0100159BL31_LINKERFILE := bl31/bl31.ld.S
Achin Gupta9cf2bb72014-05-09 11:07:09 +0100160
Sandrine Bailleuxf4119ec2015-12-17 13:58:58 +0000161# Flag used to indicate if Crash reporting via console should be included
Juan Castillo7d199412015-12-14 09:35:25 +0000162# in BL31. This defaults to being present in DEBUG builds only
Andrew Thoelke385f4d42014-06-03 11:50:53 +0100163ifndef CRASH_REPORTING
164CRASH_REPORTING := $(DEBUG)
165endif
166
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -0500167$(eval $(call assert_booleans,\
168 $(sort \
169 CRASH_REPORTING \
170 EL3_EXCEPTION_HANDLING \
171 SDEI_SUPPORT \
172)))
Jeenu Viswambharan10a67272017-09-22 08:32:10 +0100173
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -0500174$(eval $(call add_defines,\
175 $(sort \
176 CRASH_REPORTING \
177 EL3_EXCEPTION_HANDLING \
178 SDEI_SUPPORT \
179)))