xref: /rk3399_ARM-atf/bl31/bl31.mk (revision 125868c94150f52ff85cdb59aee623ab1f9f259d)
1#
2# Copyright (c) 2013-2021, 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_mm/spm_mm.mk
22  endif
23endif
24
25include lib/psci/psci_lib.mk
26
27BL31_SOURCES		+=	bl31/bl31_main.c				\
28				bl31/interrupt_mgmt.c				\
29				bl31/aarch64/bl31_entrypoint.S			\
30				bl31/aarch64/crash_reporting.S			\
31				bl31/aarch64/ea_delegate.S			\
32				bl31/aarch64/runtime_exceptions.S		\
33				bl31/bl31_context_mgmt.c			\
34				common/runtime_svc.c				\
35				lib/cpus/aarch64/dsu_helpers.S			\
36				plat/common/aarch64/platform_mp_stack.S		\
37				services/arm_arch_svc/arm_arch_svc_setup.c	\
38				services/std_svc/std_svc_setup.c		\
39				${PSCI_LIB_SOURCES}				\
40				${SPMD_SOURCES}					\
41				${SPM_SOURCES}
42
43ifeq (${DISABLE_MTPMU},1)
44BL31_SOURCES		+=	lib/extensions/mtpmu/aarch64/mtpmu.S
45endif
46
47ifeq (${ENABLE_PMF}, 1)
48BL31_SOURCES		+=	lib/pmf/pmf_main.c
49endif
50
51include lib/debugfs/debugfs.mk
52ifeq (${USE_DEBUGFS},1)
53	BL31_SOURCES	+= $(DEBUGFS_SRCS)
54endif
55
56ifeq (${EL3_EXCEPTION_HANDLING},1)
57BL31_SOURCES		+=	bl31/ehf.c
58endif
59
60ifeq (${SDEI_SUPPORT},1)
61ifeq (${EL3_EXCEPTION_HANDLING},0)
62  $(error EL3_EXCEPTION_HANDLING must be 1 for SDEI support)
63endif
64BL31_SOURCES		+=	services/std_svc/sdei/sdei_dispatch.S	\
65				services/std_svc/sdei/sdei_event.c	\
66				services/std_svc/sdei/sdei_intr_mgmt.c	\
67				services/std_svc/sdei/sdei_main.c	\
68				services/std_svc/sdei/sdei_state.c
69endif
70
71ifeq (${TRNG_SUPPORT},1)
72BL31_SOURCES		+=	services/std_svc/trng/trng_main.c	\
73				services/std_svc/trng/trng_entropy_pool.c
74endif
75
76ifeq (${ENABLE_SPE_FOR_LOWER_ELS},1)
77BL31_SOURCES		+=	lib/extensions/spe/spe.c
78endif
79
80ifeq (${ENABLE_AMU},1)
81BL31_SOURCES		+=	lib/extensions/amu/aarch64/amu.c		\
82				lib/extensions/amu/aarch64/amu_helpers.S
83endif
84
85ifeq (${ENABLE_SVE_FOR_NS},1)
86BL31_SOURCES		+=	lib/extensions/sve/sve.c
87endif
88
89ifeq (${ENABLE_MPAM_FOR_LOWER_ELS},1)
90BL31_SOURCES		+=	lib/extensions/mpam/mpam.c
91endif
92
93ifeq (${ENABLE_TRBE_FOR_NS},1)
94BL31_SOURCES		+=	lib/extensions/trbe/trbe.c
95endif
96
97ifeq (${ENABLE_SYS_REG_TRACE_FOR_NS},1)
98BL31_SOURCES		+=      lib/extensions/sys_reg_trace/aarch64/sys_reg_trace.c
99endif
100
101ifeq (${ENABLE_TRF_FOR_NS},1)
102BL31_SOURCES		+=	lib/extensions/trf/aarch64/trf.c
103endif
104
105ifeq (${WORKAROUND_CVE_2017_5715},1)
106BL31_SOURCES		+=	lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S	\
107				lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
108endif
109
110ifeq ($(SMC_PCI_SUPPORT),1)
111BL31_SOURCES		+=	services/std_svc/pci_svc.c
112endif
113
114ifeq (${ENABLE_RME},1)
115include lib/gpt_rme/gpt_rme.mk
116
117BL31_SOURCES		+=	${GPT_LIB_SRCS}					\
118				${RMMD_SOURCES}
119endif
120
121BL31_LINKERFILE		:=	bl31/bl31.ld.S
122
123# Flag used to indicate if Crash reporting via console should be included
124# in BL31. This defaults to being present in DEBUG builds only
125ifndef CRASH_REPORTING
126CRASH_REPORTING		:=	$(DEBUG)
127endif
128
129$(eval $(call assert_booleans,\
130    $(sort \
131	CRASH_REPORTING \
132	EL3_EXCEPTION_HANDLING \
133	SDEI_SUPPORT \
134)))
135
136$(eval $(call add_defines,\
137    $(sort \
138        CRASH_REPORTING \
139        EL3_EXCEPTION_HANDLING \
140        SDEI_SUPPORT \
141)))
142