blob: 0baa8267e28345ae2199dc825fc0fa48b858c4b5 [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 \
90 lib/cpus/aarch64/cortex_a57.S \
Yatharth Kochar63af6872016-02-09 12:00:03 +000091 lib/cpus/aarch64/cortex_a72.S \
92 lib/cpus/aarch64/cortex_a73.S
Yatharth Kochara4c219a2016-07-12 15:47:03 +010093else
94FVP_CPU_LIBS += lib/cpus/aarch32/cortex_a32.S
Soby Mathew0d268dc2016-07-11 14:13:56 +010095endif
Sandrine Bailleuxdd505792016-01-13 09:04:26 +000096
97BL1_SOURCES += drivers/io/io_semihosting.c \
Dan Handley2b6b5742015-03-19 19:17:53 +000098 lib/semihosting/semihosting.c \
Yatharth Kochar88ac53b2016-07-04 11:03:49 +010099 lib/semihosting/${ARCH}/semihosting_call.S \
100 plat/arm/board/fvp/${ARCH}/fvp_helpers.S \
Dan Handleyd617f662015-04-27 19:17:18 +0100101 plat/arm/board/fvp/fvp_bl1_setup.c \
Juan Castillob6132f12015-10-06 14:01:35 +0100102 plat/arm/board/fvp/fvp_err.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000103 plat/arm/board/fvp/fvp_io_storage.c \
Antonio Nino Diaz9d602fe2016-05-20 14:14:16 +0100104 plat/arm/board/fvp/fvp_trusted_boot.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000105 ${FVP_CPU_LIBS} \
106 ${FVP_INTERCONNECT_SOURCES}
107
Ryan Harkin25cff832014-01-13 12:37:03 +0000108
Antonio Nino Diaz664adb62016-05-17 09:48:10 +0100109BL2_SOURCES += drivers/io/io_semihosting.c \
Ryan Harkinf96fc8f2015-03-17 14:54:01 +0000110 drivers/delay_timer/delay_timer.c \
Dan Handley2b6b5742015-03-19 19:17:53 +0000111 lib/semihosting/semihosting.c \
Yatharth Kochara5f77d32016-07-04 11:26:14 +0100112 lib/semihosting/${ARCH}/semihosting_call.S \
Dan Handleyd617f662015-04-27 19:17:18 +0100113 plat/arm/board/fvp/fvp_bl2_setup.c \
Juan Castillob6132f12015-10-06 14:01:35 +0100114 plat/arm/board/fvp/fvp_err.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100115 plat/arm/board/fvp/fvp_io_storage.c \
Antonio Nino Diaz9d602fe2016-05-20 14:14:16 +0100116 plat/arm/board/fvp/fvp_trusted_boot.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000117 ${FVP_SECURITY_SOURCES}
Ryan Harkin25cff832014-01-13 12:37:03 +0000118
Antonio Nino Diaz664adb62016-05-17 09:48:10 +0100119ifeq (${FVP_USE_SP804_TIMER},1)
120BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
121else
122BL2_SOURCES += drivers/delay_timer/generic_delay_timer.c
123endif
124
Yatharth Kochar3a11eda2015-10-14 15:28:11 +0100125BL2U_SOURCES += plat/arm/board/fvp/fvp_bl2u_setup.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000126 ${FVP_SECURITY_SOURCES}
Yatharth Kochar3a11eda2015-10-14 15:28:11 +0100127
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000128BL31_SOURCES += plat/arm/board/fvp/fvp_bl31_setup.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100129 plat/arm/board/fvp/fvp_pm.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100130 plat/arm/board/fvp/fvp_topology.c \
131 plat/arm/board/fvp/aarch64/fvp_helpers.S \
Achin Gupta1fa7eb62015-11-03 14:18:34 +0000132 plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000133 ${FVP_CPU_LIBS} \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000134 ${FVP_GIC_SOURCES} \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000135 ${FVP_INTERCONNECT_SOURCES} \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000136 ${FVP_SECURITY_SOURCES}
Juan Castillo5e29c752015-01-07 10:39:25 +0000137
Soby Mathewfec4eb72015-07-01 16:16:20 +0100138# Disable the PSCI platform compatibility layer
139ENABLE_PLAT_COMPAT := 0
140
Douglas Raillard306593d2017-02-24 18:14:15 +0000141ifneq (${ENABLE_STACK_PROTECTOR},0)
142PLAT_BL_COMMON_SOURCES += plat/arm/board/fvp/fvp_stack_protector.c
143endif
144
dp-armcdd03cb2017-02-15 11:07:55 +0000145ifeq (${ARCH},aarch32)
146 NEED_BL32 := yes
147endif
148
Juan Castillo31a68f02015-04-14 12:49:03 +0100149include plat/arm/board/common/board_common.mk
Dan Handley2b6b5742015-03-19 19:17:53 +0000150include plat/arm/common/arm_common.mk