xref: /rk3399_ARM-atf/plat/arm/board/juno/platform.mk (revision 2d4135e08fb11989a4bbd6ebf9f3c1b324493237)
1#
2# Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7JUNO_GIC_SOURCES	:=	drivers/arm/gic/common/gic_common.c	\
8				drivers/arm/gic/v2/gicv2_main.c		\
9				drivers/arm/gic/v2/gicv2_helpers.c	\
10				plat/common/plat_gicv2.c		\
11				plat/arm/common/arm_gicv2.c
12
13JUNO_INTERCONNECT_SOURCES	:=	drivers/arm/cci/cci.c		\
14					plat/arm/common/arm_cci.c
15
16JUNO_SECURITY_SOURCES	:=	drivers/arm/tzc/tzc400.c		\
17				plat/arm/board/juno/juno_security.c	\
18				plat/arm/board/juno/juno_trng.c		\
19				plat/arm/common/arm_tzc400.c
20
21ifneq (${ENABLE_STACK_PROTECTOR}, 0)
22JUNO_SECURITY_SOURCES	+=	plat/arm/board/juno/juno_stack_protector.c
23endif
24
25# Select SCMI/SDS drivers instead of SCPI/BOM driver for communicating with the
26# SCP during power management operations and for SCP RAM Firmware transfer.
27CSS_USE_SCMI_SDS_DRIVER		:=	1
28
29PLAT_INCLUDES		:=	-Iplat/arm/board/juno/include		\
30				-Iplat/arm/css/drivers/sds
31
32PLAT_BL_COMMON_SOURCES	:=	plat/arm/board/juno/${ARCH}/juno_helpers.S \
33				plat/arm/board/juno/juno_common.c
34
35# Flag to enable support for AArch32 state on JUNO
36JUNO_AARCH32_EL3_RUNTIME	:=	0
37$(eval $(call assert_boolean,JUNO_AARCH32_EL3_RUNTIME))
38$(eval $(call add_define,JUNO_AARCH32_EL3_RUNTIME))
39
40# Flag to enable support for TZMP1 on JUNO
41JUNO_TZMP1		:=	0
42$(eval $(call assert_boolean,JUNO_TZMP1))
43ifeq (${JUNO_TZMP1}, 1)
44$(eval $(call add_define,JUNO_TZMP1))
45endif
46
47ifeq (${JUNO_AARCH32_EL3_RUNTIME}, 1)
48# Include BL32 in FIP
49NEED_BL32		:= yes
50# BL31 is not required
51override BL31_SOURCES =
52
53# The BL32 needs to be built separately invoking the AARCH32 compiler and
54# be specifed via `BL32` build option.
55  ifneq (${ARCH}, aarch32)
56    override BL32_SOURCES =
57  endif
58endif
59
60ifeq (${ARCH},aarch64)
61BL1_SOURCES		+=	lib/cpus/aarch64/cortex_a53.S		\
62				lib/cpus/aarch64/cortex_a57.S		\
63				lib/cpus/aarch64/cortex_a72.S		\
64				plat/arm/board/juno/juno_err.c		\
65				plat/arm/board/juno/juno_bl1_setup.c	\
66				${JUNO_INTERCONNECT_SOURCES}		\
67				${JUNO_SECURITY_SOURCES}
68
69BL2_SOURCES		+=	lib/utils/mem_region.c			\
70				plat/arm/board/juno/juno_err.c		\
71				plat/arm/board/juno/juno_bl2_setup.c	\
72				plat/arm/common/arm_nor_psci_mem_protect.c \
73				${JUNO_SECURITY_SOURCES}
74
75BL2U_SOURCES		+=	${JUNO_SECURITY_SOURCES}
76
77BL31_SOURCES		+=	drivers/cfi/v2m/v2m_flash.c		\
78				lib/cpus/aarch64/cortex_a53.S		\
79				lib/cpus/aarch64/cortex_a57.S		\
80				lib/cpus/aarch64/cortex_a72.S		\
81				lib/utils/mem_region.c			\
82				plat/arm/board/juno/juno_pm.c		\
83				plat/arm/board/juno/juno_topology.c	\
84				plat/arm/common/arm_nor_psci_mem_protect.c \
85				${JUNO_GIC_SOURCES}			\
86				${JUNO_INTERCONNECT_SOURCES}		\
87				${JUNO_SECURITY_SOURCES}
88
89ifeq (${CSS_USE_SCMI_SDS_DRIVER},1)
90BL1_SOURCES		+=	plat/arm/css/drivers/sds/sds.c
91endif
92
93endif
94
95ifneq (${RESET_TO_BL31},0)
96  $(error "Using BL31 as the reset vector is not supported on ${PLAT} platform. \
97  Please set RESET_TO_BL31 to 0.")
98endif
99
100ifeq ($(USE_ROMLIB),1)
101all : bl1_romlib.bin
102endif
103
104bl1_romlib.bin : $(BUILD_PLAT)/bl1.bin $(BUILD_PLAT)/romlib/romlib.bin
105	@echo "Building combined BL1 and ROMLIB binary for Juno $@"
106	./lib/romlib/gen_combined_bl1_romlib.sh -o bl1_romlib.bin $(BUILD_PLAT)
107
108# Errata workarounds for Cortex-A53:
109ERRATA_A53_826319		:=	1
110ERRATA_A53_835769		:=	1
111ERRATA_A53_836870		:=	1
112ERRATA_A53_843419		:=	1
113ERRATA_A53_855873		:=	1
114
115# Errata workarounds for Cortex-A57:
116ERRATA_A57_806969		:=	0
117ERRATA_A57_813419		:=	1
118ERRATA_A57_813420		:=	1
119ERRATA_A57_826974		:=	1
120ERRATA_A57_826977		:=	1
121ERRATA_A57_828024		:=	1
122ERRATA_A57_829520		:=	1
123ERRATA_A57_833471		:=	1
124ERRATA_A57_859972		:=	0
125
126# Errata workarounds for Cortex-A72:
127ERRATA_A72_859971		:=	0
128
129# Enable option to skip L1 data cache flush during the Cortex-A57 cluster
130# power down sequence
131SKIP_A57_L1_FLUSH_PWR_DWN	:=	 1
132
133# Do not enable SVE
134ENABLE_SVE_FOR_NS		:=	0
135
136# Enable the dynamic translation tables library.
137ifeq (${ARCH},aarch32)
138    ifeq (${RESET_TO_SP_MIN},1)
139        BL32_CFLAGS	+=	-DPLAT_XLAT_TABLES_DYNAMIC=1
140    endif
141else
142    ifeq (${RESET_TO_BL31},1)
143        BL31_CFLAGS	+=	-DPLAT_XLAT_TABLES_DYNAMIC=1
144    endif
145endif
146
147include plat/arm/board/common/board_common.mk
148include plat/arm/common/arm_common.mk
149include plat/arm/soc/common/soc_css.mk
150include plat/arm/css/common/css_common.mk
151
152