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