blob: d6e8ced43675de855e07fdcecdb6efd54beb16ed [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
Jeenu Viswambharand7a901e2016-12-06 16:15:22 +000034FVP_GICV3_SOURCES := drivers/arm/gic/common/gic_common.c \
Achin Gupta1fa7eb62015-11-03 14:18:34 +000035 drivers/arm/gic/v3/gicv3_main.c \
36 drivers/arm/gic/v3/gicv3_helpers.c \
37 plat/common/plat_gicv3.c \
38 plat/arm/common/arm_gicv3.c
Jeenu Viswambharand7a901e2016-12-06 16:15:22 +000039
40# Choose the GIC sources depending upon the how the FVP will be invoked
41ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3)
42FVP_GIC_SOURCES := ${FVP_GICV3_SOURCES}
43else ifeq (${FVP_USE_GIC_DRIVER},FVP_GIC600)
44FVP_GIC_SOURCES := ${FVP_GICV3_SOURCES} \
45 drivers/arm/gic/v3/gic600.c
Achin Gupta1fa7eb62015-11-03 14:18:34 +000046else ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV2)
47FVP_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
48 drivers/arm/gic/v2/gicv2_main.c \
49 drivers/arm/gic/v2/gicv2_helpers.c \
50 plat/common/plat_gicv2.c \
51 plat/arm/common/arm_gicv2.c
52else ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3_LEGACY)
Soby Mathew0d268dc2016-07-11 14:13:56 +010053 ifeq (${ARCH}, aarch32)
54 $(error "GICV3 Legacy driver not supported for AArch32 build")
55 endif
Achin Gupta1fa7eb62015-11-03 14:18:34 +000056FVP_GIC_SOURCES := drivers/arm/gic/arm_gic.c \
57 drivers/arm/gic/gic_v2.c \
58 drivers/arm/gic/gic_v3.c \
59 plat/common/plat_gic.c \
60 plat/arm/common/arm_gicv3_legacy.c
61else
62$(error "Incorrect GIC driver chosen on FVP port")
63endif
64
Soby Mathew7356b1e2016-03-24 10:12:42 +000065ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCI)
Vikram Kanigirifbb13012016-02-15 11:54:14 +000066FVP_INTERCONNECT_SOURCES := drivers/arm/cci/cci.c \
67 plat/arm/common/arm_cci.c
Soby Mathew7356b1e2016-03-24 10:12:42 +000068else ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCN)
69FVP_INTERCONNECT_SOURCES := drivers/arm/ccn/ccn.c \
70 plat/arm/common/arm_ccn.c
71else
72$(error "Incorrect CCN driver chosen on FVP port")
73endif
Vikram Kanigirifbb13012016-02-15 11:54:14 +000074
Soby Mathew9c708b52016-02-26 14:23:19 +000075FVP_SECURITY_SOURCES := drivers/arm/tzc/tzc400.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +000076 plat/arm/board/fvp/fvp_security.c \
77 plat/arm/common/arm_tzc400.c
78
Vikram Kanigirifbb13012016-02-15 11:54:14 +000079
Juan Castillo31a68f02015-04-14 12:49:03 +010080PLAT_INCLUDES := -Iplat/arm/board/fvp/include
Sandrine Bailleuxe701e302014-05-20 17:28:25 +010081
Ryan Harkin25cff832014-01-13 12:37:03 +000082
Soby Mathewcc037c12016-04-08 16:42:58 +010083PLAT_BL_COMMON_SOURCES := plat/arm/board/fvp/fvp_common.c
Ryan Harkin25cff832014-01-13 12:37:03 +000084
Soby Mathew0d268dc2016-07-11 14:13:56 +010085FVP_CPU_LIBS := lib/cpus/${ARCH}/aem_generic.S
86
87ifeq (${ARCH}, aarch64)
88FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a35.S \
Soby Mathewc704cbc2014-08-14 11:33:56 +010089 lib/cpus/aarch64/cortex_a53.S \
David Wang805c2c72016-11-09 16:29:02 +000090 lib/cpus/aarch64/cortex_a55.S \
Soby Mathewc704cbc2014-08-14 11:33:56 +010091 lib/cpus/aarch64/cortex_a57.S \
Yatharth Kochar63af6872016-02-09 12:00:03 +000092 lib/cpus/aarch64/cortex_a72.S \
David Wang805c2c72016-11-09 16:29:02 +000093 lib/cpus/aarch64/cortex_a73.S \
94 lib/cpus/aarch64/cortex_a75.S
Yatharth Kochara4c219a2016-07-12 15:47:03 +010095else
96FVP_CPU_LIBS += lib/cpus/aarch32/cortex_a32.S
Soby Mathew0d268dc2016-07-11 14:13:56 +010097endif
Sandrine Bailleuxdd505792016-01-13 09:04:26 +000098
99BL1_SOURCES += drivers/io/io_semihosting.c \
Dan Handley2b6b5742015-03-19 19:17:53 +0000100 lib/semihosting/semihosting.c \
Yatharth Kochar88ac53b2016-07-04 11:03:49 +0100101 lib/semihosting/${ARCH}/semihosting_call.S \
102 plat/arm/board/fvp/${ARCH}/fvp_helpers.S \
Dan Handleyd617f662015-04-27 19:17:18 +0100103 plat/arm/board/fvp/fvp_bl1_setup.c \
Juan Castillob6132f12015-10-06 14:01:35 +0100104 plat/arm/board/fvp/fvp_err.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000105 plat/arm/board/fvp/fvp_io_storage.c \
Antonio Nino Diaz9d602fe2016-05-20 14:14:16 +0100106 plat/arm/board/fvp/fvp_trusted_boot.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000107 ${FVP_CPU_LIBS} \
108 ${FVP_INTERCONNECT_SOURCES}
109
Ryan Harkin25cff832014-01-13 12:37:03 +0000110
Antonio Nino Diaz664adb62016-05-17 09:48:10 +0100111BL2_SOURCES += drivers/io/io_semihosting.c \
Ryan Harkinf96fc8f2015-03-17 14:54:01 +0000112 drivers/delay_timer/delay_timer.c \
Dan Handley2b6b5742015-03-19 19:17:53 +0000113 lib/semihosting/semihosting.c \
Yatharth Kochara5f77d32016-07-04 11:26:14 +0100114 lib/semihosting/${ARCH}/semihosting_call.S \
Dan Handleyd617f662015-04-27 19:17:18 +0100115 plat/arm/board/fvp/fvp_bl2_setup.c \
Juan Castillob6132f12015-10-06 14:01:35 +0100116 plat/arm/board/fvp/fvp_err.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100117 plat/arm/board/fvp/fvp_io_storage.c \
Antonio Nino Diaz9d602fe2016-05-20 14:14:16 +0100118 plat/arm/board/fvp/fvp_trusted_boot.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000119 ${FVP_SECURITY_SOURCES}
Ryan Harkin25cff832014-01-13 12:37:03 +0000120
Antonio Nino Diaz664adb62016-05-17 09:48:10 +0100121ifeq (${FVP_USE_SP804_TIMER},1)
122BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
123else
124BL2_SOURCES += drivers/delay_timer/generic_delay_timer.c
125endif
126
Yatharth Kochar3a11eda2015-10-14 15:28:11 +0100127BL2U_SOURCES += plat/arm/board/fvp/fvp_bl2u_setup.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000128 ${FVP_SECURITY_SOURCES}
Yatharth Kochar3a11eda2015-10-14 15:28:11 +0100129
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000130BL31_SOURCES += plat/arm/board/fvp/fvp_bl31_setup.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100131 plat/arm/board/fvp/fvp_pm.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100132 plat/arm/board/fvp/fvp_topology.c \
133 plat/arm/board/fvp/aarch64/fvp_helpers.S \
Achin Gupta1fa7eb62015-11-03 14:18:34 +0000134 plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000135 ${FVP_CPU_LIBS} \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000136 ${FVP_GIC_SOURCES} \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000137 ${FVP_INTERCONNECT_SOURCES} \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000138 ${FVP_SECURITY_SOURCES}
Juan Castillo5e29c752015-01-07 10:39:25 +0000139
Soby Mathewfec4eb72015-07-01 16:16:20 +0100140# Disable the PSCI platform compatibility layer
141ENABLE_PLAT_COMPAT := 0
142
Douglas Raillard306593d2017-02-24 18:14:15 +0000143ifneq (${ENABLE_STACK_PROTECTOR},0)
144PLAT_BL_COMMON_SOURCES += plat/arm/board/fvp/fvp_stack_protector.c
145endif
146
dp-armcdd03cb2017-02-15 11:07:55 +0000147ifeq (${ARCH},aarch32)
148 NEED_BL32 := yes
149endif
150
Juan Castillo31a68f02015-04-14 12:49:03 +0100151include plat/arm/board/common/board_common.mk
Dan Handley2b6b5742015-03-19 19:17:53 +0000152include plat/arm/common/arm_common.mk