blob: afcb4b53d1e2ebe0ebeb53f0d5e533f9e617e43e [file] [log] [blame]
Ryan Harkin25cff832014-01-13 12:37:03 +00001#
Douglas Raillard306593d2017-02-24 18:14:15 +00002# Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
Ryan Harkin25cff832014-01-13 12:37:03 +00003#
dp-armfa3cf0b2017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Ryan Harkin25cff832014-01-13 12:37:03 +00005#
6
Soby Mathewb6f3b1f2016-04-07 17:40:04 +01007# Use the GICv3 driver on the FVP by default
8FVP_USE_GIC_DRIVER := FVP_GICV3
Antonio Nino Diaz664adb62016-05-17 09:48:10 +01009# Use the SP804 timer instead of the generic one
10FVP_USE_SP804_TIMER := 0
11
12$(eval $(call assert_boolean,FVP_USE_SP804_TIMER))
13$(eval $(call add_define,FVP_USE_SP804_TIMER))
Achin Gupta1fa7eb62015-11-03 14:18:34 +000014
15# The FVP platform depends on this macro to build with correct GIC driver.
16$(eval $(call add_define,FVP_USE_GIC_DRIVER))
17
Soby Mathew7356b1e2016-03-24 10:12:42 +000018# Define default FVP_CLUSTER_COUNT to 2 and pass it into the build system.
19FVP_CLUSTER_COUNT := 2
Soby Mathew47e43f22016-02-01 14:04:34 +000020$(eval $(call add_define,FVP_CLUSTER_COUNT))
Soby Mathew7356b1e2016-03-24 10:12:42 +000021
22# Sanity check the cluster count and if FVP_CLUSTER_COUNT <= 2,
23# choose the CCI driver , else the CCN driver
24ifeq ($(FVP_CLUSTER_COUNT), 0)
25$(error "Incorrect cluster count specified for FVP port")
26else ifeq ($(FVP_CLUSTER_COUNT),$(filter $(FVP_CLUSTER_COUNT),1 2))
27FVP_INTERCONNECT_DRIVER := FVP_CCI
28else
29FVP_INTERCONNECT_DRIVER := FVP_CCN
Soby Mathew47e43f22016-02-01 14:04:34 +000030endif
31
Soby Mathew7356b1e2016-03-24 10:12:42 +000032$(eval $(call add_define,FVP_INTERCONNECT_DRIVER))
33
Achin Gupta1fa7eb62015-11-03 14:18:34 +000034# Choose the GIC sources depending upon the how the FVP will be invoked
35ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3)
36FVP_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
37 drivers/arm/gic/v3/gicv3_main.c \
38 drivers/arm/gic/v3/gicv3_helpers.c \
39 plat/common/plat_gicv3.c \
40 plat/arm/common/arm_gicv3.c
41else ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV2)
42FVP_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
43 drivers/arm/gic/v2/gicv2_main.c \
44 drivers/arm/gic/v2/gicv2_helpers.c \
45 plat/common/plat_gicv2.c \
46 plat/arm/common/arm_gicv2.c
47else ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3_LEGACY)
Soby Mathew0d268dc2016-07-11 14:13:56 +010048 ifeq (${ARCH}, aarch32)
49 $(error "GICV3 Legacy driver not supported for AArch32 build")
50 endif
Achin Gupta1fa7eb62015-11-03 14:18:34 +000051FVP_GIC_SOURCES := drivers/arm/gic/arm_gic.c \
52 drivers/arm/gic/gic_v2.c \
53 drivers/arm/gic/gic_v3.c \
54 plat/common/plat_gic.c \
55 plat/arm/common/arm_gicv3_legacy.c
56else
57$(error "Incorrect GIC driver chosen on FVP port")
58endif
59
Soby Mathew7356b1e2016-03-24 10:12:42 +000060ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCI)
Vikram Kanigirifbb13012016-02-15 11:54:14 +000061FVP_INTERCONNECT_SOURCES := drivers/arm/cci/cci.c \
62 plat/arm/common/arm_cci.c
Soby Mathew7356b1e2016-03-24 10:12:42 +000063else ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCN)
64FVP_INTERCONNECT_SOURCES := drivers/arm/ccn/ccn.c \
65 plat/arm/common/arm_ccn.c
66else
67$(error "Incorrect CCN driver chosen on FVP port")
68endif
Vikram Kanigirifbb13012016-02-15 11:54:14 +000069
Soby Mathew9c708b52016-02-26 14:23:19 +000070FVP_SECURITY_SOURCES := drivers/arm/tzc/tzc400.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +000071 plat/arm/board/fvp/fvp_security.c \
72 plat/arm/common/arm_tzc400.c
73
Vikram Kanigirifbb13012016-02-15 11:54:14 +000074
Juan Castillo31a68f02015-04-14 12:49:03 +010075PLAT_INCLUDES := -Iplat/arm/board/fvp/include
Sandrine Bailleuxe701e302014-05-20 17:28:25 +010076
Ryan Harkin25cff832014-01-13 12:37:03 +000077
Soby Mathewcc037c12016-04-08 16:42:58 +010078PLAT_BL_COMMON_SOURCES := plat/arm/board/fvp/fvp_common.c
Ryan Harkin25cff832014-01-13 12:37:03 +000079
Soby Mathew0d268dc2016-07-11 14:13:56 +010080FVP_CPU_LIBS := lib/cpus/${ARCH}/aem_generic.S
81
82ifeq (${ARCH}, aarch64)
83FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a35.S \
Soby Mathewc704cbc2014-08-14 11:33:56 +010084 lib/cpus/aarch64/cortex_a53.S \
85 lib/cpus/aarch64/cortex_a57.S \
Yatharth Kochar63af6872016-02-09 12:00:03 +000086 lib/cpus/aarch64/cortex_a72.S \
87 lib/cpus/aarch64/cortex_a73.S
Yatharth Kochara4c219a2016-07-12 15:47:03 +010088else
89FVP_CPU_LIBS += lib/cpus/aarch32/cortex_a32.S
Soby Mathew0d268dc2016-07-11 14:13:56 +010090endif
Sandrine Bailleuxdd505792016-01-13 09:04:26 +000091
92BL1_SOURCES += drivers/io/io_semihosting.c \
Dan Handley2b6b5742015-03-19 19:17:53 +000093 lib/semihosting/semihosting.c \
Yatharth Kochar88ac53b2016-07-04 11:03:49 +010094 lib/semihosting/${ARCH}/semihosting_call.S \
95 plat/arm/board/fvp/${ARCH}/fvp_helpers.S \
Dan Handleyd617f662015-04-27 19:17:18 +010096 plat/arm/board/fvp/fvp_bl1_setup.c \
Juan Castillob6132f12015-10-06 14:01:35 +010097 plat/arm/board/fvp/fvp_err.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +000098 plat/arm/board/fvp/fvp_io_storage.c \
Antonio Nino Diaz9d602fe2016-05-20 14:14:16 +010099 plat/arm/board/fvp/fvp_trusted_boot.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000100 ${FVP_CPU_LIBS} \
101 ${FVP_INTERCONNECT_SOURCES}
102
Ryan Harkin25cff832014-01-13 12:37:03 +0000103
Antonio Nino Diaz664adb62016-05-17 09:48:10 +0100104BL2_SOURCES += drivers/io/io_semihosting.c \
Ryan Harkinf96fc8f2015-03-17 14:54:01 +0000105 drivers/delay_timer/delay_timer.c \
Dan Handley2b6b5742015-03-19 19:17:53 +0000106 lib/semihosting/semihosting.c \
Yatharth Kochara5f77d32016-07-04 11:26:14 +0100107 lib/semihosting/${ARCH}/semihosting_call.S \
Dan Handleyd617f662015-04-27 19:17:18 +0100108 plat/arm/board/fvp/fvp_bl2_setup.c \
Juan Castillob6132f12015-10-06 14:01:35 +0100109 plat/arm/board/fvp/fvp_err.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100110 plat/arm/board/fvp/fvp_io_storage.c \
Antonio Nino Diaz9d602fe2016-05-20 14:14:16 +0100111 plat/arm/board/fvp/fvp_trusted_boot.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000112 ${FVP_SECURITY_SOURCES}
Ryan Harkin25cff832014-01-13 12:37:03 +0000113
Antonio Nino Diaz664adb62016-05-17 09:48:10 +0100114ifeq (${FVP_USE_SP804_TIMER},1)
115BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
116else
117BL2_SOURCES += drivers/delay_timer/generic_delay_timer.c
118endif
119
Yatharth Kochar3a11eda2015-10-14 15:28:11 +0100120BL2U_SOURCES += plat/arm/board/fvp/fvp_bl2u_setup.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000121 ${FVP_SECURITY_SOURCES}
Yatharth Kochar3a11eda2015-10-14 15:28:11 +0100122
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000123BL31_SOURCES += plat/arm/board/fvp/fvp_bl31_setup.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100124 plat/arm/board/fvp/fvp_pm.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100125 plat/arm/board/fvp/fvp_topology.c \
126 plat/arm/board/fvp/aarch64/fvp_helpers.S \
Achin Gupta1fa7eb62015-11-03 14:18:34 +0000127 plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000128 ${FVP_CPU_LIBS} \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000129 ${FVP_GIC_SOURCES} \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000130 ${FVP_INTERCONNECT_SOURCES} \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000131 ${FVP_SECURITY_SOURCES}
Juan Castillo5e29c752015-01-07 10:39:25 +0000132
Soby Mathewfec4eb72015-07-01 16:16:20 +0100133# Disable the PSCI platform compatibility layer
134ENABLE_PLAT_COMPAT := 0
135
Douglas Raillard306593d2017-02-24 18:14:15 +0000136ifneq (${ENABLE_STACK_PROTECTOR},0)
137PLAT_BL_COMMON_SOURCES += plat/arm/board/fvp/fvp_stack_protector.c
138endif
139
Juan Castillo31a68f02015-04-14 12:49:03 +0100140include plat/arm/board/common/board_common.mk
Dan Handley2b6b5742015-03-19 19:17:53 +0000141include plat/arm/common/arm_common.mk