blob: 1387ae711c562aac3d83ccf9590860b5b980b825 [file] [log] [blame]
laurenw-arm03b201c2020-10-21 13:34:40 -05001#
2# Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# Only aarch64 ARCH supported for FVP_R
8ARCH := aarch64
9
10# Override to exclude BL2, BL2U, BL31, and BL33 for FVP_R
11override NEED_BL2 := no
12override NEED_BL2U := no
13override NEED_BL31 := no
14override NEED_BL33 := no
15
16# Default cluster count for FVP_R
17FVP_R_CLUSTER_COUNT := 2
18
19# Default number of CPUs per cluster on FVP_R
20FVP_R_MAX_CPUS_PER_CLUSTER := 4
21
22# Default number of threads per CPU on FVP_R
23FVP_R_MAX_PE_PER_CPU := 1
24
25# Need to revisit this for FVP_R
26FVP_R_DT_PREFIX := fvp-base-gicv3-psci
27
28# Pass FVP_R_CLUSTER_COUNT to the build system.
29$(eval $(call add_define,FVP_R_CLUSTER_COUNT))
30
31# Pass FVP_R_MAX_CPUS_PER_CLUSTER to the build system.
32$(eval $(call add_define,FVP_R_MAX_CPUS_PER_CLUSTER))
33
34# Pass FVP_R_MAX_PE_PER_CPU to the build system.
35$(eval $(call add_define,FVP_R_MAX_PE_PER_CPU))
36
37# Sanity check the cluster count and if FVP_R_CLUSTER_COUNT <= 2,
38# choose the CCI driver , else the CCN driver
39ifeq ($(FVP_R_CLUSTER_COUNT), 0)
40$(error "Incorrect cluster count specified for FVP_R port")
41else ifeq ($(FVP_R_CLUSTER_COUNT),$(filter $(FVP_R_CLUSTER_COUNT),1 2))
42FVP_R_INTERCONNECT_DRIVER := FVP_R_CCI
43else
44FVP_R_INTERCONNECT_DRIVER := FVP_R_CCN
45endif
46
47$(eval $(call add_define,FVP_R_INTERCONNECT_DRIVER))
48
49ifeq (${FVP_R_INTERCONNECT_DRIVER}, FVP_R_CCI)
50FVP_R_INTERCONNECT_SOURCES := drivers/arm/cci/cci.c
51else ifeq (${FVP_R_INTERCONNECT_DRIVER}, FVP_R_CCN)
52FVP_R_INTERCONNECT_SOURCES := drivers/arm/ccn/ccn.c \
53 plat/arm/common/arm_ccn.c
54else
55$(error "Incorrect CCN driver chosen on FVP_R port")
56endif
57
58PLAT_INCLUDES := -Iplat/arm/board/fvp_r/include
59
60PLAT_BL_COMMON_SOURCES := plat/arm/board/fvp_r/fvp_r_common.c
61
62FVP_R_CPU_LIBS := lib/cpus/${ARCH}/aem_generic.S
63
64# select a different set of CPU files, depending on whether we compile for
65# hardware assisted coherency cores or not
66ifeq (${HW_ASSISTED_COHERENCY}, 0)
67# Cores used without DSU
68# FVP_R_CPU_LIBS += lib/cpus/aarch64/fvp_r.S
69else
70# Cores used with DSU only
71# FVP_R_CPU_LIBS += lib/cpus/aarch64/fvp_r.S
72endif
73
74BL1_SOURCES += drivers/arm/sp805/sp805.c \
75 drivers/delay_timer/delay_timer.c \
76 drivers/io/io_semihosting.c \
77 lib/semihosting/semihosting.c \
78 lib/semihosting/${ARCH}/semihosting_call.S \
79 plat/arm/board/fvp_r/fvp_r_helpers.S \
80 plat/arm/board/fvp_r/fvp_r_bl1_setup.c \
81 plat/arm/board/fvp_r/fvp_r_err.c \
82 plat/arm/board/fvp_r/fvp_r_io_storage.c \
83 ${FVP_R_CPU_LIBS} \
84 ${FVP_R_INTERCONNECT_SOURCES}
85
86ifeq (${USE_SP804_TIMER},1)
87BL1_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
88else
89BL1_SOURCES += drivers/delay_timer/generic_delay_timer.c
90endif
91
92# Enable Activity Monitor Unit extensions by default
93ENABLE_AMU := 1
94
95ifneq (${ENABLE_STACK_PROTECTOR},0)
96PLAT_BL_COMMON_SOURCES += plat/arm/board/fvp_r/fvp_r_stack_protector.c
97endif
98
99ifeq (${ARCH},aarch32)
100 NEED_BL32 := yes
101endif
102
103ifneq (${BL2_AT_EL3}, 0)
104 override BL1_SOURCES =
105endif
106
107# Add the FDT_SOURCES and options for Dynamic Config (only for Unix env)
108ifdef UNIX_MK
109FVP_R_HW_CONFIG_DTS := fdts/${FVP_R_DT_PREFIX}.dts
110FDT_SOURCES += $(addprefix plat/arm/board/fvp_r/fdts/, \
111 ${PLAT}_fw_config.dts \
112 ${PLAT}_nt_fw_config.dts \
113 )
114
115FVP_R_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
116FVP_R_NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb
117
118# Add the FW_CONFIG to FIP and specify the same to certtool
119$(eval $(call TOOL_ADD_PAYLOAD,${FVP_R_FW_CONFIG},--fw-config,${FVP_R_FW_CONFIG}))
120# Add the NT_FW_CONFIG to FIP and specify the same to certtool
121$(eval $(call TOOL_ADD_PAYLOAD,${FVP_R_NT_FW_CONFIG},--nt-fw-config,${FVP_R_NT_FW_CONFIG}))
122
123FDT_SOURCES += ${FVP_R_HW_CONFIG_DTS}
124$(eval FVP_R_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(FVP_R_HW_CONFIG_DTS)))
125
126# Add the HW_CONFIG to FIP and specify the same to certtool
127$(eval $(call TOOL_ADD_PAYLOAD,${FVP_R_HW_CONFIG},--hw-config,${FVP_R_HW_CONFIG}))
128endif
129
130include plat/arm/board/common/board_common.mk
131include plat/arm/common/arm_common.mk