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