Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1 | # |
Chris Kay | 523e864 | 2023-12-04 12:03:51 +0000 | [diff] [blame] | 2 | # Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved. |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 3 | # |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | # SPDX-License-Identifier: BSD-3-Clause |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 5 | # |
| 6 | |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 7 | ################################################################################ |
Paul Beesley | db4e25a | 2019-10-14 15:27:12 +0000 | [diff] [blame] | 8 | # Include Makefile for the SPM-MM implementation |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 9 | ################################################################################ |
Javier Almansa Sobrino | e1ecd23 | 2020-08-20 18:48:09 +0100 | [diff] [blame] | 10 | ifeq (${SUPPORT_UNKNOWN_MPID},1) |
| 11 | ifeq (${DEBUG},0) |
| 12 | $(warning WARNING: SUPPORT_UNKNOWN_MPID enabled) |
| 13 | endif |
| 14 | endif |
| 15 | |
Paul Beesley | fe975b4 | 2019-09-16 11:29:03 +0000 | [diff] [blame] | 16 | ifeq (${SPM_MM},1) |
| 17 | ifeq (${EL3_EXCEPTION_HANDLING},0) |
Paul Beesley | db4e25a | 2019-10-14 15:27:12 +0000 | [diff] [blame] | 18 | $(error EL3_EXCEPTION_HANDLING must be 1 for SPM-MM support) |
Antonio Nino Diaz | 8cd7ea3 | 2018-10-30 11:08:08 +0000 | [diff] [blame] | 19 | else |
Paul Beesley | fe975b4 | 2019-09-16 11:29:03 +0000 | [diff] [blame] | 20 | $(info Including SPM Management Mode (MM) makefile) |
Marc Bonnici | 758bd24 | 2021-12-19 21:37:50 +0000 | [diff] [blame] | 21 | include services/std_svc/spm/common/spm.mk |
| 22 | include services/std_svc/spm/spm_mm/spm_mm.mk |
Antonio Nino Diaz | 8cd7ea3 | 2018-10-30 11:08:08 +0000 | [diff] [blame] | 23 | endif |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 24 | endif |
| 25 | |
Chris Kay | 1000ea8 | 2021-05-19 19:24:37 +0100 | [diff] [blame] | 26 | include lib/extensions/amu/amu.mk |
Chris Kay | 03be39d | 2021-05-05 13:38:30 +0100 | [diff] [blame] | 27 | include lib/mpmm/mpmm.mk |
Marc Bonnici | abaac16 | 2021-12-01 18:00:40 +0000 | [diff] [blame] | 28 | |
| 29 | ifeq (${SPMC_AT_EL3},1) |
Marc Bonnici | abaac16 | 2021-12-01 18:00:40 +0000 | [diff] [blame] | 30 | $(info Including EL3 SPMC makefile) |
| 31 | include services/std_svc/spm/common/spm.mk |
| 32 | include services/std_svc/spm/el3_spmc/spmc.mk |
| 33 | endif |
| 34 | |
Soby Mathew | 0d78607 | 2016-03-24 16:56:29 +0000 | [diff] [blame] | 35 | include lib/psci/psci_lib.mk |
| 36 | |
Dan Handley | 176e7b4 | 2014-04-15 18:20:09 +0100 | [diff] [blame] | 37 | BL31_SOURCES += bl31/bl31_main.c \ |
Achin Gupta | 191e86e | 2014-05-09 10:03:15 +0100 | [diff] [blame] | 38 | bl31/interrupt_mgmt.c \ |
Dan Handley | 176e7b4 | 2014-04-15 18:20:09 +0100 | [diff] [blame] | 39 | bl31/aarch64/bl31_entrypoint.S \ |
Andrew Thoelke | 4d2d553 | 2014-06-02 12:38:12 +0100 | [diff] [blame] | 40 | bl31/aarch64/crash_reporting.S \ |
Jeenu Viswambharan | 2de8153 | 2018-02-16 11:54:24 +0000 | [diff] [blame] | 41 | bl31/aarch64/runtime_exceptions.S \ |
Yatharth Kochar | 6c0566c | 2015-10-02 17:56:48 +0100 | [diff] [blame] | 42 | bl31/bl31_context_mgmt.c \ |
Andre Przywara | fa914d8 | 2022-11-21 17:04:10 +0000 | [diff] [blame] | 43 | bl31/bl31_traps.c \ |
Soby Mathew | 0d78607 | 2016-03-24 16:56:29 +0000 | [diff] [blame] | 44 | common/runtime_svc.c \ |
John Tsichritzis | 4daa1de | 2018-07-23 09:11:59 +0100 | [diff] [blame] | 45 | lib/cpus/aarch64/dsu_helpers.S \ |
dp-arm | 230011c | 2017-03-07 11:02:47 +0000 | [diff] [blame] | 46 | plat/common/aarch64/platform_mp_stack.S \ |
Dimitris Papastamos | 0dcdb1a | 2018-01-19 16:58:29 +0000 | [diff] [blame] | 47 | services/arm_arch_svc/arm_arch_svc_setup.c \ |
Dan Handley | 176e7b4 | 2014-04-15 18:20:09 +0100 | [diff] [blame] | 48 | services/std_svc/std_svc_setup.c \ |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 49 | ${PSCI_LIB_SOURCES} \ |
Achin Gupta | 60b7b8a | 2019-10-11 15:50:43 +0100 | [diff] [blame] | 50 | ${SPMD_SOURCES} \ |
Marc Bonnici | 758bd24 | 2021-12-19 21:37:50 +0000 | [diff] [blame] | 51 | ${SPM_MM_SOURCES} \ |
Marc Bonnici | abaac16 | 2021-12-01 18:00:40 +0000 | [diff] [blame] | 52 | ${SPMC_SOURCES} \ |
Jeenu Viswambharan | 2de8153 | 2018-02-16 11:54:24 +0000 | [diff] [blame] | 53 | ${SPM_SOURCES} |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 54 | |
Govindraj Raja | 80c57e2 | 2024-05-01 12:23:47 -0500 | [diff] [blame] | 55 | VENDOR_EL3_SRCS += services/el3/ven_el3_svc.c |
| 56 | |
Yatharth Kochar | 9518d02 | 2016-03-11 14:20:19 +0000 | [diff] [blame] | 57 | ifeq (${ENABLE_PMF}, 1) |
Govindraj Raja | 80c57e2 | 2024-05-01 12:23:47 -0500 | [diff] [blame] | 58 | BL31_SOURCES += lib/pmf/pmf_main.c \ |
| 59 | ${VENDOR_EL3_SRCS} |
Yatharth Kochar | 9518d02 | 2016-03-11 14:20:19 +0000 | [diff] [blame] | 60 | endif |
| 61 | |
Olivier Deprez | cb4c562 | 2019-09-19 17:46:46 +0200 | [diff] [blame] | 62 | include lib/debugfs/debugfs.mk |
| 63 | ifeq (${USE_DEBUGFS},1) |
Govindraj Raja | 80c57e2 | 2024-05-01 12:23:47 -0500 | [diff] [blame] | 64 | BL31_SOURCES += ${DEBUGFS_SRCS} \ |
| 65 | ${VENDOR_EL3_SRCS} |
Olivier Deprez | cb4c562 | 2019-09-19 17:46:46 +0200 | [diff] [blame] | 66 | endif |
| 67 | |
Juan Pablo Conde | b5ec138 | 2023-11-08 16:14:28 -0600 | [diff] [blame] | 68 | ifeq (${PLATFORM_REPORT_CTX_MEM_USE},1) |
| 69 | BL31_SOURCES += lib/el3_runtime/aarch64/context_debug.c |
| 70 | endif |
| 71 | |
Jeenu Viswambharan | 10a6727 | 2017-09-22 08:32:10 +0100 | [diff] [blame] | 72 | ifeq (${EL3_EXCEPTION_HANDLING},1) |
| 73 | BL31_SOURCES += bl31/ehf.c |
| 74 | endif |
| 75 | |
Manish Pandey | a4752e2 | 2023-10-11 11:52:24 +0100 | [diff] [blame] | 76 | ifeq (${FFH_SUPPORT},1) |
| 77 | BL31_SOURCES += bl31/aarch64/ea_delegate.S |
| 78 | endif |
| 79 | |
Jeenu Viswambharan | 04e3a7f | 2017-10-16 08:43:14 +0100 | [diff] [blame] | 80 | ifeq (${SDEI_SUPPORT},1) |
| 81 | ifeq (${EL3_EXCEPTION_HANDLING},0) |
| 82 | $(error EL3_EXCEPTION_HANDLING must be 1 for SDEI support) |
| 83 | endif |
Jeenu Viswambharan | 8b7e6bc | 2018-02-16 12:07:48 +0000 | [diff] [blame] | 84 | BL31_SOURCES += services/std_svc/sdei/sdei_dispatch.S \ |
| 85 | services/std_svc/sdei/sdei_event.c \ |
Jeenu Viswambharan | 04e3a7f | 2017-10-16 08:43:14 +0100 | [diff] [blame] | 86 | services/std_svc/sdei/sdei_intr_mgmt.c \ |
| 87 | services/std_svc/sdei/sdei_main.c \ |
| 88 | services/std_svc/sdei/sdei_state.c |
| 89 | endif |
| 90 | |
Jimmy Brisson | 26c5b5c | 2020-06-22 14:18:42 -0500 | [diff] [blame] | 91 | ifeq (${TRNG_SUPPORT},1) |
| 92 | BL31_SOURCES += services/std_svc/trng/trng_main.c \ |
| 93 | services/std_svc/trng/trng_entropy_pool.c |
| 94 | endif |
| 95 | |
Andre Przywara | f3e8cfc | 2022-11-17 16:42:09 +0000 | [diff] [blame] | 96 | ifneq (${ENABLE_SPE_FOR_NS},0) |
Dimitris Papastamos | 5bdbb47 | 2017-10-13 12:06:06 +0100 | [diff] [blame] | 97 | BL31_SOURCES += lib/extensions/spe/spe.c |
| 98 | endif |
| 99 | |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 100 | ifeq (${ERRATA_ABI_SUPPORT},1) |
| 101 | BL31_SOURCES += services/std_svc/errata_abi/errata_abi_main.c |
| 102 | endif |
| 103 | |
Andre Przywara | 0b7f1b0 | 2023-03-21 13:53:19 +0000 | [diff] [blame] | 104 | ifneq (${ENABLE_FEAT_AMU},0) |
Chris Kay | 1000ea8 | 2021-05-19 19:24:37 +0100 | [diff] [blame] | 105 | BL31_SOURCES += ${AMU_SOURCES} |
Dimitris Papastamos | e08005a | 2017-10-12 13:02:29 +0100 | [diff] [blame] | 106 | endif |
| 107 | |
Chris Kay | 03be39d | 2021-05-05 13:38:30 +0100 | [diff] [blame] | 108 | ifeq (${ENABLE_MPMM},1) |
| 109 | BL31_SOURCES += ${MPMM_SOURCES} |
| 110 | endif |
| 111 | |
Jayanth Dodderi Chidanand | 605419a | 2023-03-06 23:56:14 +0000 | [diff] [blame] | 112 | ifneq (${ENABLE_SME_FOR_NS},0) |
johpow01 | 9baade3 | 2021-07-08 14:14:00 -0500 | [diff] [blame] | 113 | BL31_SOURCES += lib/extensions/sme/sme.c |
Boyan Karatotev | 7f5dcc7 | 2023-03-08 16:29:26 +0000 | [diff] [blame] | 114 | endif |
Jayanth Dodderi Chidanand | d62c681 | 2023-03-07 10:43:19 +0000 | [diff] [blame] | 115 | ifneq (${ENABLE_SVE_FOR_NS},0) |
David Cunado | ce88eee | 2017-10-20 11:30:57 +0100 | [diff] [blame] | 116 | BL31_SOURCES += lib/extensions/sve/sve.c |
| 117 | endif |
| 118 | |
Arvind Ram Prakash | ab28d4b | 2023-10-11 12:10:56 -0500 | [diff] [blame] | 119 | ifneq (${ENABLE_FEAT_MPAM},0) |
Jeenu Viswambharan | 2da918c | 2018-07-31 16:13:33 +0100 | [diff] [blame] | 120 | BL31_SOURCES += lib/extensions/mpam/mpam.c |
| 121 | endif |
| 122 | |
Andre Przywara | 191eff6 | 2022-11-17 16:42:09 +0000 | [diff] [blame] | 123 | ifneq (${ENABLE_TRBE_FOR_NS},0) |
Manish V Badarkhe | 20df29c | 2021-07-02 09:10:56 +0100 | [diff] [blame] | 124 | BL31_SOURCES += lib/extensions/trbe/trbe.c |
| 125 | endif |
| 126 | |
Andre Przywara | c97c551 | 2022-11-17 16:42:09 +0000 | [diff] [blame] | 127 | ifneq (${ENABLE_BRBE_FOR_NS},0) |
johpow01 | 8186596 | 2022-01-28 17:06:20 -0600 | [diff] [blame] | 128 | BL31_SOURCES += lib/extensions/brbe/brbe.c |
| 129 | endif |
| 130 | |
Andre Przywara | 44e33e0 | 2022-11-17 16:42:09 +0000 | [diff] [blame] | 131 | ifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0) |
Manish V Badarkhe | f356f7e | 2021-06-29 11:44:20 +0100 | [diff] [blame] | 132 | BL31_SOURCES += lib/extensions/sys_reg_trace/aarch64/sys_reg_trace.c |
| 133 | endif |
| 134 | |
Andre Przywara | 06ea44e | 2022-11-17 17:30:43 +0000 | [diff] [blame] | 135 | ifneq (${ENABLE_TRF_FOR_NS},0) |
Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 136 | BL31_SOURCES += lib/extensions/trf/aarch64/trf.c |
| 137 | endif |
| 138 | |
Dimitris Papastamos | 446f7f1 | 2017-11-30 14:53:53 +0000 | [diff] [blame] | 139 | ifeq (${WORKAROUND_CVE_2017_5715},1) |
Dimitris Papastamos | 570c06a | 2018-04-06 15:29:34 +0100 | [diff] [blame] | 140 | BL31_SOURCES += lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S \ |
| 141 | lib/cpus/aarch64/wa_cve_2017_5715_mmu.S |
Dimitris Papastamos | 446f7f1 | 2017-11-30 14:53:53 +0000 | [diff] [blame] | 142 | endif |
| 143 | |
Jeremy Linton | c8c3e0d | 2020-11-18 10:17:57 -0600 | [diff] [blame] | 144 | ifeq ($(SMC_PCI_SUPPORT),1) |
| 145 | BL31_SOURCES += services/std_svc/pci_svc.c |
| 146 | endif |
| 147 | |
Zelalem Aweke | 13dc8f1 | 2021-07-09 14:20:03 -0500 | [diff] [blame] | 148 | ifeq (${ENABLE_RME},1) |
johpow01 | 9d13402 | 2021-06-16 17:57:28 -0500 | [diff] [blame] | 149 | include lib/gpt_rme/gpt_rme.mk |
Zelalem Aweke | 8e2e24b | 2021-07-13 14:05:20 -0500 | [diff] [blame] | 150 | |
| 151 | BL31_SOURCES += ${GPT_LIB_SRCS} \ |
| 152 | ${RMMD_SOURCES} |
Zelalem Aweke | 13dc8f1 | 2021-07-09 14:20:03 -0500 | [diff] [blame] | 153 | endif |
| 154 | |
Jayanth Dodderi Chidanand | 9461a89 | 2022-01-17 18:57:17 +0000 | [diff] [blame] | 155 | ifeq ($(FEATURE_DETECTION),1) |
| 156 | BL31_SOURCES += common/feat_detect.c |
| 157 | endif |
| 158 | |
Manish V Badarkhe | 8a76603 | 2022-02-23 11:26:53 +0000 | [diff] [blame] | 159 | ifeq (${DRTM_SUPPORT},1) |
johpow01 | baa3e6c | 2022-03-11 17:50:58 -0600 | [diff] [blame] | 160 | BL31_SOURCES += services/std_svc/drtm/drtm_main.c \ |
| 161 | services/std_svc/drtm/drtm_dma_prot.c \ |
| 162 | services/std_svc/drtm/drtm_res_address_map.c \ |
Manish V Badarkhe | 19b22f9 | 2022-06-17 11:42:17 +0100 | [diff] [blame] | 163 | services/std_svc/drtm/drtm_measurements.c \ |
Manish V Badarkhe | 39dd555 | 2022-06-21 09:41:32 +0100 | [diff] [blame] | 164 | services/std_svc/drtm/drtm_remediation.c \ |
Manish V Badarkhe | c816807 | 2022-02-25 09:11:12 +0000 | [diff] [blame] | 165 | ${MBEDTLS_SOURCES} |
Manish V Badarkhe | 8a76603 | 2022-02-23 11:26:53 +0000 | [diff] [blame] | 166 | endif |
| 167 | |
Yi Chou | 097051f | 2023-04-11 15:57:08 +0800 | [diff] [blame] | 168 | ifeq ($(CROS_WIDEVINE_SMC),1) |
| 169 | BL31_SOURCES += services/oem/chromeos/widevine_smc_handlers.c |
| 170 | endif |
| 171 | |
Chris Kay | 68d2836 | 2023-01-16 16:53:45 +0000 | [diff] [blame] | 172 | BL31_DEFAULT_LINKER_SCRIPT_SOURCE := bl31/bl31.ld.S |
Achin Gupta | 9cf2bb7 | 2014-05-09 11:07:09 +0100 | [diff] [blame] | 173 | |
Chris Kay | cfba645 | 2023-12-04 09:55:50 +0000 | [diff] [blame] | 174 | ifeq ($($(ARCH)-ld-id),gnu-gcc) |
Chris Kay | 60f805a | 2023-01-26 18:31:52 +0000 | [diff] [blame] | 175 | BL31_LDFLAGS += -Wl,--sort-section=alignment |
Chris Kay | cfba645 | 2023-12-04 09:55:50 +0000 | [diff] [blame] | 176 | else ifneq ($(filter llvm-lld gnu-ld,$($(ARCH)-ld-id)),) |
Chris Kay | 60f805a | 2023-01-26 18:31:52 +0000 | [diff] [blame] | 177 | BL31_LDFLAGS += --sort-section=alignment |
| 178 | endif |
| 179 | |
Sandrine Bailleux | f4119ec | 2015-12-17 13:58:58 +0000 | [diff] [blame] | 180 | # Flag used to indicate if Crash reporting via console should be included |
Juan Castillo | 7d19941 | 2015-12-14 09:35:25 +0000 | [diff] [blame] | 181 | # in BL31. This defaults to being present in DEBUG builds only |
Andrew Thoelke | 385f4d4 | 2014-06-03 11:50:53 +0100 | [diff] [blame] | 182 | ifndef CRASH_REPORTING |
| 183 | CRASH_REPORTING := $(DEBUG) |
| 184 | endif |
| 185 | |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 186 | $(eval $(call assert_booleans,\ |
| 187 | $(sort \ |
| 188 | CRASH_REPORTING \ |
| 189 | EL3_EXCEPTION_HANDLING \ |
| 190 | SDEI_SUPPORT \ |
| 191 | ))) |
Jeenu Viswambharan | 10a6727 | 2017-09-22 08:32:10 +0100 | [diff] [blame] | 192 | |
Leonardo Sandoval | 65fca7c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 193 | $(eval $(call add_defines,\ |
| 194 | $(sort \ |
| 195 | CRASH_REPORTING \ |
| 196 | EL3_EXCEPTION_HANDLING \ |
| 197 | SDEI_SUPPORT \ |
| 198 | ))) |