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