platform.mk 5.36 KB
Newer Older
1
#
2
# Copyright (c) 2013-2021, 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
9
10
# Include GICv2 driver files
include drivers/arm/gic/v2/gicv2.mk

JUNO_GIC_SOURCES	:=	${GICV2_SOURCES}			\
11
12
13
				plat/common/plat_gicv2.c		\
				plat/arm/common/arm_gicv2.c

14
15
16
JUNO_INTERCONNECT_SOURCES	:=	drivers/arm/cci/cci.c		\
					plat/arm/common/arm_cci.c

17
JUNO_SECURITY_SOURCES	:=	drivers/arm/tzc/tzc400.c		\
18
				plat/arm/board/juno/juno_security.c	\
19
				plat/arm/board/juno/juno_trng.c		\
20
21
				plat/arm/common/arm_tzc400.c

22
23
24
ifneq (${ENABLE_STACK_PROTECTOR}, 0)
JUNO_SECURITY_SOURCES	+=	plat/arm/board/juno/juno_stack_protector.c
endif
25

26
27
28
29
# Select SCMI/SDS drivers instead of SCPI/BOM driver for communicating with the
# SCP during power management operations and for SCP RAM Firmware transfer.
CSS_USE_SCMI_SDS_DRIVER		:=	1

30
PLAT_INCLUDES		:=	-Iplat/arm/board/juno/include
31

32
33
PLAT_BL_COMMON_SOURCES	:=	plat/arm/board/juno/${ARCH}/juno_helpers.S \
				plat/arm/board/juno/juno_common.c
34

35
36
37
38
39
# Flag to enable support for AArch32 state on JUNO
JUNO_AARCH32_EL3_RUNTIME	:=	0
$(eval $(call assert_boolean,JUNO_AARCH32_EL3_RUNTIME))
$(eval $(call add_define,JUNO_AARCH32_EL3_RUNTIME))

40
41
42
43
44
45
46
# Flag to enable support for TZMP1 on JUNO
JUNO_TZMP1		:=	0
$(eval $(call assert_boolean,JUNO_TZMP1))
ifeq (${JUNO_TZMP1}, 1)
$(eval $(call add_define,JUNO_TZMP1))
endif

47
48
TRNG_SUPPORT		:=	1

49
50
51
52
53
54
55
56
57
58
59
60
61
ifeq (${JUNO_AARCH32_EL3_RUNTIME}, 1)
# Include BL32 in FIP
NEED_BL32		:= yes
# BL31 is not required
override BL31_SOURCES =

# The BL32 needs to be built separately invoking the AARCH32 compiler and
# be specifed via `BL32` build option.
  ifneq (${ARCH}, aarch32)
    override BL32_SOURCES =
  endif
endif

62
ifeq (${ARCH},aarch64)
63
BL1_SOURCES		+=	lib/cpus/aarch64/cortex_a53.S		\
Brendan Jackman's avatar
Brendan Jackman committed
64
				lib/cpus/aarch64/cortex_a57.S		\
65
				lib/cpus/aarch64/cortex_a72.S		\
66
				plat/arm/board/juno/juno_err.c		\
67
				plat/arm/board/juno/juno_bl1_setup.c	\
68
				drivers/arm/sp805/sp805.c		\
69
70
				${JUNO_INTERCONNECT_SOURCES}		\
				${JUNO_SECURITY_SOURCES}
71

72
73
BL2_SOURCES		+=	drivers/arm/sp805/sp805.c		\
				lib/utils/mem_region.c			\
74
				plat/arm/board/juno/juno_err.c		\
75
76
				plat/arm/board/juno/juno_bl2_setup.c	\
				plat/arm/common/arm_nor_psci_mem_protect.c \
77
				${JUNO_SECURITY_SOURCES}
78

79
BL2U_SOURCES		+=	${JUNO_SECURITY_SOURCES}
80

81
82
BL31_SOURCES		+=	drivers/cfi/v2m/v2m_flash.c		\
				lib/cpus/aarch64/cortex_a53.S		\
83
				lib/cpus/aarch64/cortex_a57.S		\
Brendan Jackman's avatar
Brendan Jackman committed
84
				lib/cpus/aarch64/cortex_a72.S		\
85
				lib/utils/mem_region.c			\
86
				plat/arm/board/juno/juno_pm.c		\
87
				plat/arm/board/juno/juno_topology.c	\
88
				plat/arm/common/arm_nor_psci_mem_protect.c \
89
				${JUNO_GIC_SOURCES}			\
90
				${JUNO_INTERCONNECT_SOURCES}		\
91
				${JUNO_SECURITY_SOURCES}
92
93

ifeq (${CSS_USE_SCMI_SDS_DRIVER},1)
94
BL1_SOURCES		+=	drivers/arm/css/sds/sds.c
95
96
endif

97
98
99
100
101
ifeq (${TRUSTED_BOARD_BOOT}, 1)
BL1_SOURCES		+=	plat/arm/board/juno/juno_trusted_boot.c
BL2_SOURCES		+=	plat/arm/board/juno/juno_trusted_boot.c
endif

102
endif
103

104
ifneq (${RESET_TO_BL31},0)
105
  $(error "Using BL31 as the reset vector is not supported on ${PLAT} platform. \
106
107
108
  Please set RESET_TO_BL31 to 0.")
endif

Sathees Balya's avatar
Sathees Balya committed
109
110
111
112
ifeq ($(USE_ROMLIB),1)
all : bl1_romlib.bin
endif

113
bl1_romlib.bin : $(BUILD_PLAT)/bl1.bin romlib.bin
Sathees Balya's avatar
Sathees Balya committed
114
115
116
	@echo "Building combined BL1 and ROMLIB binary for Juno $@"
	./lib/romlib/gen_combined_bl1_romlib.sh -o bl1_romlib.bin $(BUILD_PLAT)

117
# Errata workarounds for Cortex-A53:
118
119
ERRATA_A53_819472		:=	1
ERRATA_A53_824069		:=	1
120
ERRATA_A53_826319		:=	1
121
ERRATA_A53_827319		:=	1
122
ERRATA_A53_835769		:=	1
123
ERRATA_A53_836870		:=	1
124
ERRATA_A53_843419		:=	1
125
ERRATA_A53_855873		:=	1
126
127

# Errata workarounds for Cortex-A57:
128
ERRATA_A57_806969		:=	0
129
ERRATA_A57_813419		:=	1
130
ERRATA_A57_813420		:=	1
131
132
ERRATA_A57_814670		:=	1
ERRATA_A57_817169		:=	1
133
134
135
136
137
ERRATA_A57_826974		:=	1
ERRATA_A57_826977		:=	1
ERRATA_A57_828024		:=	1
ERRATA_A57_829520		:=	1
ERRATA_A57_833471		:=	1
138
ERRATA_A57_859972		:=	0
139

140
141
# Errata workarounds for Cortex-A72:
ERRATA_A72_859971		:=	0
142
143
144
145

# Enable option to skip L1 data cache flush during the Cortex-A57 cluster
# power down sequence
SKIP_A57_L1_FLUSH_PWR_DWN	:=	 1
146

147
148
149
# Do not enable SVE
ENABLE_SVE_FOR_NS		:=	0

150
151
152
# Enable the dynamic translation tables library.
ifeq (${ARCH},aarch32)
    ifeq (${RESET_TO_SP_MIN},1)
153
        BL32_CPPFLAGS	+=	-DPLAT_XLAT_TABLES_DYNAMIC
154
155
156
    endif
else
    ifeq (${RESET_TO_BL31},1)
157
        BL31_CPPFLAGS	+=	-DPLAT_XLAT_TABLES_DYNAMIC
158
159
160
    endif
endif

161
162
ifeq (${ALLOW_RO_XLAT_TABLES}, 1)
    ifeq (${JUNO_AARCH32_EL3_RUNTIME}, 1)
163
        BL32_CPPFLAGS	+=	-DPLAT_RO_XLAT_TABLES
164
    else
165
        BL31_CPPFLAGS	+=	-DPLAT_RO_XLAT_TABLES
166
167
168
    endif
endif

169
170
171
172
173
174
BL1_CPPFLAGS += -march=armv8-a+crc
BL2_CPPFLAGS += -march=armv8-a+crc
BL2U_CPPFLAGS += -march=armv8-a+crc
BL31_CPPFLAGS += -march=armv8-a+crc
BL32_CPPFLAGS += -march=armv8-a+crc

175
# Add the FDT_SOURCES and options for Dynamic Config
176
177
FDT_SOURCES		+=	plat/arm/board/juno/fdts/${PLAT}_fw_config.dts	\
				plat/arm/board/juno/fdts/${PLAT}_tb_fw_config.dts
178

179
180
181
182
FW_CONFIG		:=	${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
TB_FW_CONFIG		:=	${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb

# Add the FW_CONFIG to FIP and specify the same to certtool
183
$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
184
# Add the TB_FW_CONFIG to FIP and specify the same to certtool
185
$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
186

187
include plat/arm/board/common/board_common.mk
188
189
190
include plat/arm/common/arm_common.mk
include plat/arm/soc/common/soc_css.mk
include plat/arm/css/common/css_common.mk