• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# Use the GICv3 driver on the FVP by default
8FVP_USE_GIC_DRIVER	:= FVP_GICV3
9
10# Use the SP804 timer instead of the generic one
11FVP_USE_SP804_TIMER	:= 0
12
13# Default cluster count for FVP
14FVP_CLUSTER_COUNT	:= 2
15
16# Default number of threads per CPU on FVP
17FVP_MAX_PE_PER_CPU	:= 1
18
19$(eval $(call assert_boolean,FVP_USE_SP804_TIMER))
20$(eval $(call add_define,FVP_USE_SP804_TIMER))
21
22# The FVP platform depends on this macro to build with correct GIC driver.
23$(eval $(call add_define,FVP_USE_GIC_DRIVER))
24
25# Pass FVP_CLUSTER_COUNT to the build system.
26$(eval $(call add_define,FVP_CLUSTER_COUNT))
27
28# Pass FVP_MAX_PE_PER_CPU to the build system.
29$(eval $(call add_define,FVP_MAX_PE_PER_CPU))
30
31# Sanity check the cluster count and if FVP_CLUSTER_COUNT <= 2,
32# choose the CCI driver , else the CCN driver
33ifeq ($(FVP_CLUSTER_COUNT), 0)
34$(error "Incorrect cluster count specified for FVP port")
35else ifeq ($(FVP_CLUSTER_COUNT),$(filter $(FVP_CLUSTER_COUNT),1 2))
36FVP_INTERCONNECT_DRIVER := FVP_CCI
37else
38FVP_INTERCONNECT_DRIVER := FVP_CCN
39endif
40
41$(eval $(call add_define,FVP_INTERCONNECT_DRIVER))
42
43FVP_GICV3_SOURCES	:=	drivers/arm/gic/common/gic_common.c	\
44				drivers/arm/gic/v3/gicv3_main.c		\
45				drivers/arm/gic/v3/gicv3_helpers.c	\
46				plat/common/plat_gicv3.c		\
47				plat/arm/common/arm_gicv3.c
48
49# Choose the GIC sources depending upon the how the FVP will be invoked
50ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3)
51FVP_GIC_SOURCES		:=	${FVP_GICV3_SOURCES}			\
52				drivers/arm/gic/v3/gic500.c
53else ifeq (${FVP_USE_GIC_DRIVER},FVP_GIC600)
54FVP_GIC_SOURCES		:=	${FVP_GICV3_SOURCES}			\
55				drivers/arm/gic/v3/gic600.c
56else ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV2)
57FVP_GIC_SOURCES		:=	drivers/arm/gic/common/gic_common.c	\
58				drivers/arm/gic/v2/gicv2_main.c		\
59				drivers/arm/gic/v2/gicv2_helpers.c	\
60				plat/common/plat_gicv2.c		\
61				plat/arm/common/arm_gicv2.c
62else ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3_LEGACY)
63  ifeq (${ARCH}, aarch32)
64    $(error "GICV3 Legacy driver not supported for AArch32 build")
65  endif
66FVP_GIC_SOURCES		:=	drivers/arm/gic/arm_gic.c		\
67				drivers/arm/gic/gic_v2.c		\
68				drivers/arm/gic/gic_v3.c		\
69				plat/common/plat_gic.c			\
70				plat/arm/common/arm_gicv3_legacy.c
71else
72$(error "Incorrect GIC driver chosen on FVP port")
73endif
74
75ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCI)
76FVP_INTERCONNECT_SOURCES	:= 	drivers/arm/cci/cci.c
77else ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCN)
78FVP_INTERCONNECT_SOURCES	:= 	drivers/arm/ccn/ccn.c		\
79					plat/arm/common/arm_ccn.c
80else
81$(error "Incorrect CCN driver chosen on FVP port")
82endif
83
84FVP_SECURITY_SOURCES	:=	drivers/arm/tzc/tzc400.c		\
85				plat/arm/board/fvp/fvp_security.c	\
86				plat/arm/common/arm_tzc400.c
87
88
89PLAT_INCLUDES		:=	-Iplat/arm/board/fvp/include
90
91
92PLAT_BL_COMMON_SOURCES	:=	plat/arm/board/fvp/fvp_common.c
93
94FVP_CPU_LIBS		:=	lib/cpus/${ARCH}/aem_generic.S
95
96ifeq (${ARCH}, aarch64)
97FVP_CPU_LIBS		+=	lib/cpus/aarch64/cortex_a35.S			\
98				lib/cpus/aarch64/cortex_a53.S			\
99				lib/cpus/aarch64/cortex_a55.S			\
100				lib/cpus/aarch64/cortex_a57.S			\
101				lib/cpus/aarch64/cortex_a72.S			\
102				lib/cpus/aarch64/cortex_a73.S			\
103				lib/cpus/aarch64/cortex_a75.S
104else
105FVP_CPU_LIBS		+=	lib/cpus/aarch32/cortex_a32.S
106endif
107
108BL1_SOURCES		+=	drivers/io/io_semihosting.c			\
109				lib/semihosting/semihosting.c			\
110				lib/semihosting/${ARCH}/semihosting_call.S	\
111				plat/arm/board/fvp/${ARCH}/fvp_helpers.S	\
112				plat/arm/board/fvp/fvp_bl1_setup.c		\
113				plat/arm/board/fvp/fvp_err.c			\
114				plat/arm/board/fvp/fvp_io_storage.c		\
115				plat/arm/board/fvp/fvp_trusted_boot.c		\
116				${FVP_CPU_LIBS}					\
117				${FVP_INTERCONNECT_SOURCES}
118
119
120BL2_SOURCES		+=	drivers/io/io_semihosting.c			\
121				lib/semihosting/semihosting.c			\
122				lib/semihosting/${ARCH}/semihosting_call.S	\
123				plat/arm/board/fvp/fvp_bl2_setup.c		\
124				plat/arm/board/fvp/fvp_err.c			\
125				plat/arm/board/fvp/fvp_io_storage.c		\
126				plat/arm/board/fvp/fvp_trusted_boot.c		\
127				${FVP_SECURITY_SOURCES}
128
129ifeq (${FVP_USE_SP804_TIMER},1)
130BL2_SOURCES		+=	drivers/arm/sp804/sp804_delay_timer.c
131endif
132
133BL2U_SOURCES		+=	plat/arm/board/fvp/fvp_bl2u_setup.c		\
134				${FVP_SECURITY_SOURCES}
135
136BL31_SOURCES		+=	drivers/arm/smmu/smmu_v3.c			\
137				plat/arm/board/fvp/fvp_bl31_setup.c		\
138				plat/arm/board/fvp/fvp_pm.c			\
139				plat/arm/board/fvp/fvp_topology.c		\
140				plat/arm/board/fvp/aarch64/fvp_helpers.S	\
141				plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c	\
142				${FVP_CPU_LIBS}					\
143				${FVP_GIC_SOURCES}				\
144				${FVP_INTERCONNECT_SOURCES}			\
145				${FVP_SECURITY_SOURCES}
146
147# Disable the PSCI platform compatibility layer
148ENABLE_PLAT_COMPAT	:= 	0
149
150ifneq (${ENABLE_STACK_PROTECTOR},0)
151PLAT_BL_COMMON_SOURCES	+=	plat/arm/board/fvp/fvp_stack_protector.c
152endif
153
154ifeq (${ARCH},aarch32)
155    NEED_BL32 := yes
156endif
157
158# Add support for platform supplied linker script for BL31 build
159$(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
160
161include plat/arm/board/common/board_common.mk
162include plat/arm/common/arm_common.mk
163