xref: /rk3399_ARM-atf/bl31/bl31.mk (revision 0396bcbc6ae75a71489c078ae43f6f549abd5be4)
1#
2# Copyright (c) 2013-2019, 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 (${SPM_MM},1)
11  ifeq (${EL3_EXCEPTION_HANDLING},0)
12    $(error EL3_EXCEPTION_HANDLING must be 1 for SPM-MM support)
13  else
14    $(info Including SPM Management Mode (MM) makefile)
15    include services/std_svc/spm_mm/spm_mm.mk
16  endif
17endif
18
19include lib/psci/psci_lib.mk
20
21BL31_SOURCES		+=	bl31/bl31_main.c				\
22				bl31/interrupt_mgmt.c				\
23				bl31/aarch64/bl31_entrypoint.S			\
24				bl31/aarch64/crash_reporting.S			\
25				bl31/aarch64/ea_delegate.S			\
26				bl31/aarch64/runtime_exceptions.S		\
27				bl31/bl31_context_mgmt.c			\
28				common/runtime_svc.c				\
29				lib/cpus/aarch64/dsu_helpers.S			\
30				plat/common/aarch64/platform_mp_stack.S		\
31				services/arm_arch_svc/arm_arch_svc_setup.c	\
32				services/std_svc/std_svc_setup.c		\
33				${PSCI_LIB_SOURCES}				\
34				${SPMD_SOURCES}					\
35				${SPM_SOURCES}
36
37
38ifeq (${ENABLE_PMF}, 1)
39BL31_SOURCES		+=	lib/pmf/pmf_main.c
40endif
41
42include lib/debugfs/debugfs.mk
43ifeq (${USE_DEBUGFS},1)
44	BL31_SOURCES	+= $(DEBUGFS_SRCS)
45endif
46
47ifeq (${EL3_EXCEPTION_HANDLING},1)
48BL31_SOURCES		+=	bl31/ehf.c
49endif
50
51ifeq (${SDEI_SUPPORT},1)
52ifeq (${EL3_EXCEPTION_HANDLING},0)
53  $(error EL3_EXCEPTION_HANDLING must be 1 for SDEI support)
54endif
55BL31_SOURCES		+=	services/std_svc/sdei/sdei_dispatch.S	\
56				services/std_svc/sdei/sdei_event.c	\
57				services/std_svc/sdei/sdei_intr_mgmt.c	\
58				services/std_svc/sdei/sdei_main.c	\
59				services/std_svc/sdei/sdei_state.c
60endif
61
62ifeq (${ENABLE_SPE_FOR_LOWER_ELS},1)
63BL31_SOURCES		+=	lib/extensions/spe/spe.c
64endif
65
66ifeq (${ENABLE_AMU},1)
67BL31_SOURCES		+=	lib/extensions/amu/aarch64/amu.c		\
68				lib/extensions/amu/aarch64/amu_helpers.S
69endif
70
71ifeq (${ENABLE_SVE_FOR_NS},1)
72BL31_SOURCES		+=	lib/extensions/sve/sve.c
73endif
74
75ifeq (${ENABLE_MPAM_FOR_LOWER_ELS},1)
76BL31_SOURCES		+=	lib/extensions/mpam/mpam.c
77endif
78
79ifeq (${WORKAROUND_CVE_2017_5715},1)
80BL31_SOURCES		+=	lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S	\
81				lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
82endif
83
84BL31_LINKERFILE		:=	bl31/bl31.ld.S
85
86# Flag used to indicate if Crash reporting via console should be included
87# in BL31. This defaults to being present in DEBUG builds only
88ifndef CRASH_REPORTING
89CRASH_REPORTING		:=	$(DEBUG)
90endif
91
92$(eval $(call assert_boolean,CRASH_REPORTING))
93$(eval $(call assert_boolean,EL3_EXCEPTION_HANDLING))
94$(eval $(call assert_boolean,SDEI_SUPPORT))
95
96$(eval $(call add_define,CRASH_REPORTING))
97$(eval $(call add_define,EL3_EXCEPTION_HANDLING))
98$(eval $(call add_define,SDEI_SUPPORT))
99