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