blob: e751824bbe37968d34ddbbba42be226bcd94a7a4 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001#
Jimmy Brisson26c5b5c2020-06-22 14:18:42 -05002# Copyright (c) 2013-2021, 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)
Paul Beesley72f9ec62019-10-15 14:20:34 +000021 include services/std_svc/spm_mm/spm_mm.mk
Antonio Nino Diaz8cd7ea32018-10-30 11:08:08 +000022 endif
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010023endif
24
Chris Kay1000ea82021-05-19 19:24:37 +010025include lib/extensions/amu/amu.mk
Chris Kay03be39d2021-05-05 13:38:30 +010026include lib/mpmm/mpmm.mk
Soby Mathew0d786072016-03-24 16:56:29 +000027include lib/psci/psci_lib.mk
28
Dan Handley176e7b42014-04-15 18:20:09 +010029BL31_SOURCES += bl31/bl31_main.c \
Achin Gupta191e86e2014-05-09 10:03:15 +010030 bl31/interrupt_mgmt.c \
Dan Handley176e7b42014-04-15 18:20:09 +010031 bl31/aarch64/bl31_entrypoint.S \
Andrew Thoelke4d2d5532014-06-02 12:38:12 +010032 bl31/aarch64/crash_reporting.S \
Jeenu Viswambharane86a2472018-07-05 15:24:45 +010033 bl31/aarch64/ea_delegate.S \
Jeenu Viswambharan2de81532018-02-16 11:54:24 +000034 bl31/aarch64/runtime_exceptions.S \
Yatharth Kochar6c0566c2015-10-02 17:56:48 +010035 bl31/bl31_context_mgmt.c \
Soby Mathew0d786072016-03-24 16:56:29 +000036 common/runtime_svc.c \
John Tsichritzis4daa1de2018-07-23 09:11:59 +010037 lib/cpus/aarch64/dsu_helpers.S \
dp-arm230011c2017-03-07 11:02:47 +000038 plat/common/aarch64/platform_mp_stack.S \
Dimitris Papastamos0dcdb1a2018-01-19 16:58:29 +000039 services/arm_arch_svc/arm_arch_svc_setup.c \
Dan Handley176e7b42014-04-15 18:20:09 +010040 services/std_svc/std_svc_setup.c \
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010041 ${PSCI_LIB_SOURCES} \
Achin Gupta60b7b8a2019-10-11 15:50:43 +010042 ${SPMD_SOURCES} \
Jeenu Viswambharan2de81532018-02-16 11:54:24 +000043 ${SPM_SOURCES}
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010044
Javier Almansa Sobrinof3a4c542020-11-23 18:38:15 +000045ifeq (${DISABLE_MTPMU},1)
46BL31_SOURCES += lib/extensions/mtpmu/aarch64/mtpmu.S
47endif
Soby Mathew523d6332015-01-08 18:02:19 +000048
Yatharth Kochar9518d022016-03-11 14:20:19 +000049ifeq (${ENABLE_PMF}, 1)
50BL31_SOURCES += lib/pmf/pmf_main.c
51endif
52
Olivier Deprezcb4c5622019-09-19 17:46:46 +020053include lib/debugfs/debugfs.mk
54ifeq (${USE_DEBUGFS},1)
55 BL31_SOURCES += $(DEBUGFS_SRCS)
56endif
57
Jeenu Viswambharan10a67272017-09-22 08:32:10 +010058ifeq (${EL3_EXCEPTION_HANDLING},1)
59BL31_SOURCES += bl31/ehf.c
60endif
61
Jeenu Viswambharan04e3a7f2017-10-16 08:43:14 +010062ifeq (${SDEI_SUPPORT},1)
63ifeq (${EL3_EXCEPTION_HANDLING},0)
64 $(error EL3_EXCEPTION_HANDLING must be 1 for SDEI support)
65endif
Jeenu Viswambharan8b7e6bc2018-02-16 12:07:48 +000066BL31_SOURCES += services/std_svc/sdei/sdei_dispatch.S \
67 services/std_svc/sdei/sdei_event.c \
Jeenu Viswambharan04e3a7f2017-10-16 08:43:14 +010068 services/std_svc/sdei/sdei_intr_mgmt.c \
69 services/std_svc/sdei/sdei_main.c \
70 services/std_svc/sdei/sdei_state.c
71endif
72
Jimmy Brisson26c5b5c2020-06-22 14:18:42 -050073ifeq (${TRNG_SUPPORT},1)
74BL31_SOURCES += services/std_svc/trng/trng_main.c \
75 services/std_svc/trng/trng_entropy_pool.c
76endif
77
Dimitris Papastamos5bdbb472017-10-13 12:06:06 +010078ifeq (${ENABLE_SPE_FOR_LOWER_ELS},1)
79BL31_SOURCES += lib/extensions/spe/spe.c
80endif
81
Dimitris Papastamose08005a2017-10-12 13:02:29 +010082ifeq (${ENABLE_AMU},1)
Chris Kay1000ea82021-05-19 19:24:37 +010083BL31_SOURCES += ${AMU_SOURCES}
Dimitris Papastamose08005a2017-10-12 13:02:29 +010084endif
85
Chris Kay03be39d2021-05-05 13:38:30 +010086ifeq (${ENABLE_MPMM},1)
87BL31_SOURCES += ${MPMM_SOURCES}
88endif
89
johpow019baade32021-07-08 14:14:00 -050090ifeq (${ENABLE_SME_FOR_NS},1)
91BL31_SOURCES += lib/extensions/sme/sme.c
92BL31_SOURCES += lib/extensions/sve/sve.c
93else
David Cunadoce88eee2017-10-20 11:30:57 +010094ifeq (${ENABLE_SVE_FOR_NS},1)
95BL31_SOURCES += lib/extensions/sve/sve.c
96endif
johpow019baade32021-07-08 14:14:00 -050097endif
David Cunadoce88eee2017-10-20 11:30:57 +010098
Jeenu Viswambharan2da918c2018-07-31 16:13:33 +010099ifeq (${ENABLE_MPAM_FOR_LOWER_ELS},1)
100BL31_SOURCES += lib/extensions/mpam/mpam.c
101endif
102
Manish V Badarkhe20df29c2021-07-02 09:10:56 +0100103ifeq (${ENABLE_TRBE_FOR_NS},1)
104BL31_SOURCES += lib/extensions/trbe/trbe.c
105endif
106
Manish V Badarkhef356f7e2021-06-29 11:44:20 +0100107ifeq (${ENABLE_SYS_REG_TRACE_FOR_NS},1)
108BL31_SOURCES += lib/extensions/sys_reg_trace/aarch64/sys_reg_trace.c
109endif
110
Manish V Badarkhe51a97112021-07-08 09:33:18 +0100111ifeq (${ENABLE_TRF_FOR_NS},1)
112BL31_SOURCES += lib/extensions/trf/aarch64/trf.c
113endif
114
Dimitris Papastamos446f7f12017-11-30 14:53:53 +0000115ifeq (${WORKAROUND_CVE_2017_5715},1)
Dimitris Papastamos570c06a2018-04-06 15:29:34 +0100116BL31_SOURCES += lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S \
117 lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
Dimitris Papastamos446f7f12017-11-30 14:53:53 +0000118endif
119
Jeremy Lintonc8c3e0d2020-11-18 10:17:57 -0600120ifeq ($(SMC_PCI_SUPPORT),1)
121BL31_SOURCES += services/std_svc/pci_svc.c
122endif
123
Zelalem Aweke13dc8f12021-07-09 14:20:03 -0500124ifeq (${ENABLE_RME},1)
johpow019d134022021-06-16 17:57:28 -0500125include lib/gpt_rme/gpt_rme.mk
Zelalem Aweke8e2e24b2021-07-13 14:05:20 -0500126
127BL31_SOURCES += ${GPT_LIB_SRCS} \
128 ${RMMD_SOURCES}
Zelalem Aweke13dc8f12021-07-09 14:20:03 -0500129endif
130
Dan Handley176e7b42014-04-15 18:20:09 +0100131BL31_LINKERFILE := bl31/bl31.ld.S
Achin Gupta9cf2bb72014-05-09 11:07:09 +0100132
Sandrine Bailleuxf4119ec2015-12-17 13:58:58 +0000133# Flag used to indicate if Crash reporting via console should be included
Juan Castillo7d199412015-12-14 09:35:25 +0000134# in BL31. This defaults to being present in DEBUG builds only
Andrew Thoelke385f4d42014-06-03 11:50:53 +0100135ifndef CRASH_REPORTING
136CRASH_REPORTING := $(DEBUG)
137endif
138
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -0500139$(eval $(call assert_booleans,\
140 $(sort \
141 CRASH_REPORTING \
142 EL3_EXCEPTION_HANDLING \
143 SDEI_SUPPORT \
144)))
Jeenu Viswambharan10a67272017-09-22 08:32:10 +0100145
Leonardo Sandoval65fca7c2020-09-10 12:18:27 -0500146$(eval $(call add_defines,\
147 $(sort \
148 CRASH_REPORTING \
149 EL3_EXCEPTION_HANDLING \
150 SDEI_SUPPORT \
151)))