blob: 1b502967adec05030eb474e404fb9ef9a65621bd [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
Jeenu Viswambharan528d21b2016-11-15 13:53:57 +00009
Antonio Nino Diaz664adb62016-05-17 09:48:10 +010010# Use the SP804 timer instead of the generic one
11FVP_USE_SP804_TIMER := 0
12
Jeenu Viswambharan528d21b2016-11-15 13:53:57 +000013# 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
Antonio Nino Diaz664adb62016-05-17 09:48:10 +010019$(eval $(call assert_boolean,FVP_USE_SP804_TIMER))
20$(eval $(call add_define,FVP_USE_SP804_TIMER))
Achin Gupta1fa7eb62015-11-03 14:18:34 +000021
22# The FVP platform depends on this macro to build with correct GIC driver.
23$(eval $(call add_define,FVP_USE_GIC_DRIVER))
24
Jeenu Viswambharan528d21b2016-11-15 13:53:57 +000025# Pass FVP_CLUSTER_COUNT to the build system.
Soby Mathew47e43f22016-02-01 14:04:34 +000026$(eval $(call add_define,FVP_CLUSTER_COUNT))
Soby Mathew7356b1e2016-03-24 10:12:42 +000027
Jeenu Viswambharan528d21b2016-11-15 13:53:57 +000028# Pass FVP_MAX_PE_PER_CPU to the build system.
29$(eval $(call add_define,FVP_MAX_PE_PER_CPU))
30
Soby Mathew7356b1e2016-03-24 10:12:42 +000031# 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
Soby Mathew47e43f22016-02-01 14:04:34 +000039endif
40
Soby Mathew7356b1e2016-03-24 10:12:42 +000041$(eval $(call add_define,FVP_INTERCONNECT_DRIVER))
42
Jeenu Viswambharand7a901e2016-12-06 16:15:22 +000043FVP_GICV3_SOURCES := drivers/arm/gic/common/gic_common.c \
Achin Gupta1fa7eb62015-11-03 14:18:34 +000044 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
Jeenu Viswambharand7a901e2016-12-06 16:15:22 +000048
49# Choose the GIC sources depending upon the how the FVP will be invoked
50ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3)
Soby Mathew327548c2017-07-13 15:19:51 +010051FVP_GIC_SOURCES := ${FVP_GICV3_SOURCES} \
52 drivers/arm/gic/v3/gic500.c
Jeenu Viswambharand7a901e2016-12-06 16:15:22 +000053else ifeq (${FVP_USE_GIC_DRIVER},FVP_GIC600)
54FVP_GIC_SOURCES := ${FVP_GICV3_SOURCES} \
55 drivers/arm/gic/v3/gic600.c
Achin Gupta1fa7eb62015-11-03 14:18:34 +000056else 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)
Soby Mathew0d268dc2016-07-11 14:13:56 +010063 ifeq (${ARCH}, aarch32)
64 $(error "GICV3 Legacy driver not supported for AArch32 build")
65 endif
Achin Gupta1fa7eb62015-11-03 14:18:34 +000066FVP_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
Soby Mathew7356b1e2016-03-24 10:12:42 +000075ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCI)
Jeenu Viswambharan9e78b922017-07-18 15:42:50 +010076FVP_INTERCONNECT_SOURCES := drivers/arm/cci/cci.c
Soby Mathew7356b1e2016-03-24 10:12:42 +000077else 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
Vikram Kanigirifbb13012016-02-15 11:54:14 +000083
Soby Mathew9c708b52016-02-26 14:23:19 +000084FVP_SECURITY_SOURCES := drivers/arm/tzc/tzc400.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +000085 plat/arm/board/fvp/fvp_security.c \
86 plat/arm/common/arm_tzc400.c
87
Vikram Kanigirifbb13012016-02-15 11:54:14 +000088
Juan Castillo31a68f02015-04-14 12:49:03 +010089PLAT_INCLUDES := -Iplat/arm/board/fvp/include
Sandrine Bailleuxe701e302014-05-20 17:28:25 +010090
Ryan Harkin25cff832014-01-13 12:37:03 +000091
Soby Mathewcc037c12016-04-08 16:42:58 +010092PLAT_BL_COMMON_SOURCES := plat/arm/board/fvp/fvp_common.c
Ryan Harkin25cff832014-01-13 12:37:03 +000093
Soby Mathew0d268dc2016-07-11 14:13:56 +010094FVP_CPU_LIBS := lib/cpus/${ARCH}/aem_generic.S
95
96ifeq (${ARCH}, aarch64)
97FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a35.S \
Soby Mathewc704cbc2014-08-14 11:33:56 +010098 lib/cpus/aarch64/cortex_a53.S \
David Wang805c2c72016-11-09 16:29:02 +000099 lib/cpus/aarch64/cortex_a55.S \
Soby Mathewc704cbc2014-08-14 11:33:56 +0100100 lib/cpus/aarch64/cortex_a57.S \
Yatharth Kochar63af6872016-02-09 12:00:03 +0000101 lib/cpus/aarch64/cortex_a72.S \
David Wang805c2c72016-11-09 16:29:02 +0000102 lib/cpus/aarch64/cortex_a73.S \
103 lib/cpus/aarch64/cortex_a75.S
Yatharth Kochara4c219a2016-07-12 15:47:03 +0100104else
105FVP_CPU_LIBS += lib/cpus/aarch32/cortex_a32.S
Soby Mathew0d268dc2016-07-11 14:13:56 +0100106endif
Sandrine Bailleuxdd505792016-01-13 09:04:26 +0000107
108BL1_SOURCES += drivers/io/io_semihosting.c \
Dan Handley2b6b5742015-03-19 19:17:53 +0000109 lib/semihosting/semihosting.c \
Yatharth Kochar88ac53b2016-07-04 11:03:49 +0100110 lib/semihosting/${ARCH}/semihosting_call.S \
111 plat/arm/board/fvp/${ARCH}/fvp_helpers.S \
Dan Handleyd617f662015-04-27 19:17:18 +0100112 plat/arm/board/fvp/fvp_bl1_setup.c \
Juan Castillob6132f12015-10-06 14:01:35 +0100113 plat/arm/board/fvp/fvp_err.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000114 plat/arm/board/fvp/fvp_io_storage.c \
Antonio Nino Diaz9d602fe2016-05-20 14:14:16 +0100115 plat/arm/board/fvp/fvp_trusted_boot.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000116 ${FVP_CPU_LIBS} \
117 ${FVP_INTERCONNECT_SOURCES}
118
Ryan Harkin25cff832014-01-13 12:37:03 +0000119
Antonio Nino Diaz664adb62016-05-17 09:48:10 +0100120BL2_SOURCES += drivers/io/io_semihosting.c \
Dan Handley2b6b5742015-03-19 19:17:53 +0000121 lib/semihosting/semihosting.c \
Yatharth Kochara5f77d32016-07-04 11:26:14 +0100122 lib/semihosting/${ARCH}/semihosting_call.S \
Dan Handleyd617f662015-04-27 19:17:18 +0100123 plat/arm/board/fvp/fvp_bl2_setup.c \
Juan Castillob6132f12015-10-06 14:01:35 +0100124 plat/arm/board/fvp/fvp_err.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100125 plat/arm/board/fvp/fvp_io_storage.c \
Antonio Nino Diaz9d602fe2016-05-20 14:14:16 +0100126 plat/arm/board/fvp/fvp_trusted_boot.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000127 ${FVP_SECURITY_SOURCES}
Ryan Harkin25cff832014-01-13 12:37:03 +0000128
Antonio Nino Diaz664adb62016-05-17 09:48:10 +0100129ifeq (${FVP_USE_SP804_TIMER},1)
130BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
Antonio Nino Diaz664adb62016-05-17 09:48:10 +0100131endif
132
Yatharth Kochar3a11eda2015-10-14 15:28:11 +0100133BL2U_SOURCES += plat/arm/board/fvp/fvp_bl2u_setup.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000134 ${FVP_SECURITY_SOURCES}
Yatharth Kochar3a11eda2015-10-14 15:28:11 +0100135
Jeenu Viswambharan9e78b922017-07-18 15:42:50 +0100136BL31_SOURCES += drivers/arm/smmu/smmu_v3.c \
137 plat/arm/board/fvp/fvp_bl31_setup.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100138 plat/arm/board/fvp/fvp_pm.c \
Dan Handleyd617f662015-04-27 19:17:18 +0100139 plat/arm/board/fvp/fvp_topology.c \
140 plat/arm/board/fvp/aarch64/fvp_helpers.S \
Achin Gupta1fa7eb62015-11-03 14:18:34 +0000141 plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000142 ${FVP_CPU_LIBS} \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000143 ${FVP_GIC_SOURCES} \
Vikram Kanigirifbb13012016-02-15 11:54:14 +0000144 ${FVP_INTERCONNECT_SOURCES} \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +0000145 ${FVP_SECURITY_SOURCES}
Juan Castillo5e29c752015-01-07 10:39:25 +0000146
Soby Mathewfec4eb72015-07-01 16:16:20 +0100147# Disable the PSCI platform compatibility layer
148ENABLE_PLAT_COMPAT := 0
149
Douglas Raillard306593d2017-02-24 18:14:15 +0000150ifneq (${ENABLE_STACK_PROTECTOR},0)
151PLAT_BL_COMMON_SOURCES += plat/arm/board/fvp/fvp_stack_protector.c
152endif
153
dp-armcdd03cb2017-02-15 11:07:55 +0000154ifeq (${ARCH},aarch32)
155 NEED_BL32 := yes
156endif
157
Soby Mathew3b5156e2017-10-05 12:27:33 +0100158# Add support for platform supplied linker script for BL31 build
159$(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
160
Juan Castillo31a68f02015-04-14 12:49:03 +0100161include plat/arm/board/common/board_common.mk
Dan Handley2b6b5742015-03-19 19:17:53 +0000162include plat/arm/common/arm_common.mk