1# 2# Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved. 3# 4# SPDX-License-Identifier: BSD-3-Clause 5# 6 7################################################################################ 8# Include Makefile for the SPM-MM implementation 9################################################################################ 10ifeq (${SUPPORT_UNKNOWN_MPID},1) 11 ifeq (${DEBUG},0) 12 $(warning WARNING: SUPPORT_UNKNOWN_MPID enabled) 13 endif 14endif 15 16ifeq (${SPM_MM},1) 17 ifeq (${EL3_EXCEPTION_HANDLING},0) 18 $(error EL3_EXCEPTION_HANDLING must be 1 for SPM-MM support) 19 else 20 $(info Including SPM Management Mode (MM) makefile) 21 include services/std_svc/spm/common/spm.mk 22 include services/std_svc/spm/spm_mm/spm_mm.mk 23 endif 24endif 25 26include lib/extensions/amu/amu.mk 27include lib/mpmm/mpmm.mk 28include lib/psci/psci_lib.mk 29 30BL31_SOURCES += bl31/bl31_main.c \ 31 bl31/interrupt_mgmt.c \ 32 bl31/aarch64/bl31_entrypoint.S \ 33 bl31/aarch64/crash_reporting.S \ 34 bl31/aarch64/ea_delegate.S \ 35 bl31/aarch64/runtime_exceptions.S \ 36 bl31/bl31_context_mgmt.c \ 37 common/runtime_svc.c \ 38 lib/cpus/aarch64/dsu_helpers.S \ 39 plat/common/aarch64/platform_mp_stack.S \ 40 services/arm_arch_svc/arm_arch_svc_setup.c \ 41 services/std_svc/std_svc_setup.c \ 42 ${PSCI_LIB_SOURCES} \ 43 ${SPMD_SOURCES} \ 44 ${SPM_MM_SOURCES} \ 45 ${SPM_SOURCES} 46 47ifeq (${DISABLE_MTPMU},1) 48BL31_SOURCES += lib/extensions/mtpmu/aarch64/mtpmu.S 49endif 50 51ifeq (${ENABLE_PMF}, 1) 52BL31_SOURCES += lib/pmf/pmf_main.c 53endif 54 55include lib/debugfs/debugfs.mk 56ifeq (${USE_DEBUGFS},1) 57 BL31_SOURCES += $(DEBUGFS_SRCS) 58endif 59 60ifeq (${EL3_EXCEPTION_HANDLING},1) 61BL31_SOURCES += bl31/ehf.c 62endif 63 64ifeq (${SDEI_SUPPORT},1) 65ifeq (${EL3_EXCEPTION_HANDLING},0) 66 $(error EL3_EXCEPTION_HANDLING must be 1 for SDEI support) 67endif 68BL31_SOURCES += services/std_svc/sdei/sdei_dispatch.S \ 69 services/std_svc/sdei/sdei_event.c \ 70 services/std_svc/sdei/sdei_intr_mgmt.c \ 71 services/std_svc/sdei/sdei_main.c \ 72 services/std_svc/sdei/sdei_state.c 73endif 74 75ifeq (${TRNG_SUPPORT},1) 76BL31_SOURCES += services/std_svc/trng/trng_main.c \ 77 services/std_svc/trng/trng_entropy_pool.c 78endif 79 80ifeq (${ENABLE_SPE_FOR_LOWER_ELS},1) 81BL31_SOURCES += lib/extensions/spe/spe.c 82endif 83 84ifeq (${ENABLE_AMU},1) 85BL31_SOURCES += ${AMU_SOURCES} 86endif 87 88ifeq (${ENABLE_MPMM},1) 89BL31_SOURCES += ${MPMM_SOURCES} 90endif 91 92ifeq (${ENABLE_SME_FOR_NS},1) 93BL31_SOURCES += lib/extensions/sme/sme.c 94BL31_SOURCES += lib/extensions/sve/sve.c 95else 96ifeq (${ENABLE_SVE_FOR_NS},1) 97BL31_SOURCES += lib/extensions/sve/sve.c 98endif 99endif 100 101ifeq (${ENABLE_MPAM_FOR_LOWER_ELS},1) 102BL31_SOURCES += lib/extensions/mpam/mpam.c 103endif 104 105ifeq (${ENABLE_TRBE_FOR_NS},1) 106BL31_SOURCES += lib/extensions/trbe/trbe.c 107endif 108 109ifeq (${ENABLE_SYS_REG_TRACE_FOR_NS},1) 110BL31_SOURCES += lib/extensions/sys_reg_trace/aarch64/sys_reg_trace.c 111endif 112 113ifeq (${ENABLE_TRF_FOR_NS},1) 114BL31_SOURCES += lib/extensions/trf/aarch64/trf.c 115endif 116 117ifeq (${WORKAROUND_CVE_2017_5715},1) 118BL31_SOURCES += lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S \ 119 lib/cpus/aarch64/wa_cve_2017_5715_mmu.S 120endif 121 122ifeq ($(SMC_PCI_SUPPORT),1) 123BL31_SOURCES += services/std_svc/pci_svc.c 124endif 125 126ifeq (${ENABLE_RME},1) 127include lib/gpt_rme/gpt_rme.mk 128 129BL31_SOURCES += ${GPT_LIB_SRCS} \ 130 ${RMMD_SOURCES} 131endif 132 133ifeq ($(FEATURE_DETECTION),1) 134BL31_SOURCES += common/feat_detect.c 135endif 136 137BL31_LINKERFILE := bl31/bl31.ld.S 138 139# Flag used to indicate if Crash reporting via console should be included 140# in BL31. This defaults to being present in DEBUG builds only 141ifndef CRASH_REPORTING 142CRASH_REPORTING := $(DEBUG) 143endif 144 145$(eval $(call assert_booleans,\ 146 $(sort \ 147 CRASH_REPORTING \ 148 EL3_EXCEPTION_HANDLING \ 149 SDEI_SUPPORT \ 150))) 151 152$(eval $(call add_defines,\ 153 $(sort \ 154 CRASH_REPORTING \ 155 EL3_EXCEPTION_HANDLING \ 156 SDEI_SUPPORT \ 157))) 158