bl31.mk 2.79 KB
Newer Older
1
#
2
# Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
3
#
dp-arm's avatar
dp-arm committed
4
# SPDX-License-Identifier: BSD-3-Clause
5
6
#

7
################################################################################
8
# Include Makefile for the SPM-MM implementation
9
################################################################################
10
11
12
13
14
15
ifeq (${SUPPORT_UNKNOWN_MPID},1)
  ifeq (${DEBUG},0)
    $(warning WARNING: SUPPORT_UNKNOWN_MPID enabled)
  endif
endif

16
17
ifeq (${SPM_MM},1)
  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
23
24
endif

25
26
include lib/psci/psci_lib.mk

Dan Handley's avatar
Dan Handley committed
27
BL31_SOURCES		+=	bl31/bl31_main.c				\
28
				bl31/interrupt_mgmt.c				\
Dan Handley's avatar
Dan Handley committed
29
				bl31/aarch64/bl31_entrypoint.S			\
30
				bl31/aarch64/crash_reporting.S			\
31
				bl31/aarch64/ea_delegate.S			\
32
				bl31/aarch64/runtime_exceptions.S		\
33
				bl31/bl31_context_mgmt.c			\
34
				common/runtime_svc.c				\
35
				lib/cpus/aarch64/dsu_helpers.S			\
36
				plat/common/aarch64/platform_mp_stack.S		\
37
				services/arm_arch_svc/arm_arch_svc_setup.c	\
Dan Handley's avatar
Dan Handley committed
38
				services/std_svc/std_svc_setup.c		\
39
				${PSCI_LIB_SOURCES}				\
40
				${SPMD_SOURCES}					\
41
				${SPM_SOURCES}
42

43

44
45
46
47
ifeq (${ENABLE_PMF}, 1)
BL31_SOURCES		+=	lib/pmf/pmf_main.c
endif

48
49
50
51
52
include lib/debugfs/debugfs.mk
ifeq (${USE_DEBUGFS},1)
	BL31_SOURCES	+= $(DEBUGFS_SRCS)
endif

53
54
55
56
ifeq (${EL3_EXCEPTION_HANDLING},1)
BL31_SOURCES		+=	bl31/ehf.c
endif

Jeenu Viswambharan's avatar
Jeenu Viswambharan committed
57
58
59
60
ifeq (${SDEI_SUPPORT},1)
ifeq (${EL3_EXCEPTION_HANDLING},0)
  $(error EL3_EXCEPTION_HANDLING must be 1 for SDEI support)
endif
61
62
BL31_SOURCES		+=	services/std_svc/sdei/sdei_dispatch.S	\
				services/std_svc/sdei/sdei_event.c	\
Jeenu Viswambharan's avatar
Jeenu Viswambharan committed
63
64
65
66
67
				services/std_svc/sdei/sdei_intr_mgmt.c	\
				services/std_svc/sdei/sdei_main.c	\
				services/std_svc/sdei/sdei_state.c
endif

68
69
70
71
ifeq (${ENABLE_SPE_FOR_LOWER_ELS},1)
BL31_SOURCES		+=	lib/extensions/spe/spe.c
endif

72
ifeq (${ENABLE_AMU},1)
73
74
BL31_SOURCES		+=	lib/extensions/amu/aarch64/amu.c		\
				lib/extensions/amu/aarch64/amu_helpers.S
75
76
endif

David Cunado's avatar
David Cunado committed
77
78
79
80
ifeq (${ENABLE_SVE_FOR_NS},1)
BL31_SOURCES		+=	lib/extensions/sve/sve.c
endif

81
82
83
84
ifeq (${ENABLE_MPAM_FOR_LOWER_ELS},1)
BL31_SOURCES		+=	lib/extensions/mpam/mpam.c
endif

85
ifeq (${WORKAROUND_CVE_2017_5715},1)
86
87
BL31_SOURCES		+=	lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S	\
				lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
88
89
endif

Dan Handley's avatar
Dan Handley committed
90
BL31_LINKERFILE		:=	bl31/bl31.ld.S
91

92
# Flag used to indicate if Crash reporting via console should be included
93
# in BL31. This defaults to being present in DEBUG builds only
94
95
96
97
ifndef CRASH_REPORTING
CRASH_REPORTING		:=	$(DEBUG)
endif

98
99
100
101
102
103
104
105
106
107
108
109
110
$(eval $(call assert_booleans,\
    $(sort \
	CRASH_REPORTING \
	EL3_EXCEPTION_HANDLING \
	SDEI_SUPPORT \
)))

$(eval $(call add_defines,\
    $(sort \
        CRASH_REPORTING \
        EL3_EXCEPTION_HANDLING \
        SDEI_SUPPORT \
)))