platform.mk 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. #
  2. # Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. include common/fdt_wrappers.mk
  7. # Use the GICv3 driver on the FVP by default
  8. FVP_USE_GIC_DRIVER := FVP_GICV3
  9. # Default cluster count for FVP
  10. FVP_CLUSTER_COUNT := 2
  11. # Default number of CPUs per cluster on FVP
  12. FVP_MAX_CPUS_PER_CLUSTER := 4
  13. # Default number of threads per CPU on FVP
  14. FVP_MAX_PE_PER_CPU := 1
  15. # Disable redistributor frame of inactive/fused CPU cores by marking it as read
  16. # only; enable redistributor frames of all CPU cores by default.
  17. FVP_GICR_REGION_PROTECTION := 0
  18. FVP_DT_PREFIX := fvp-base-gicv3-psci
  19. # Size (in kilobytes) of the Trusted SRAM region to utilize when building for
  20. # the FVP platform. This option defaults to 256.
  21. FVP_TRUSTED_SRAM_SIZE := 256
  22. # Macro to enable helpers for running SPM tests. Disabled by default.
  23. PLAT_TEST_SPM := 0
  24. # By default dont build CPUs with no FVP model.
  25. BUILD_CPUS_WITH_NO_FVP_MODEL ?= 0
  26. ENABLE_FEAT_AMU := 2
  27. ENABLE_FEAT_AMUv1p1 := 2
  28. ENABLE_FEAT_HCX := 2
  29. ENABLE_FEAT_RNG := 2
  30. ENABLE_FEAT_TWED := 2
  31. ENABLE_FEAT_GCS := 2
  32. ifeq (${ARCH}, aarch64)
  33. ifeq (${SPM_MM}, 0)
  34. ifeq (${CTX_INCLUDE_FPREGS}, 0)
  35. ENABLE_SME_FOR_NS := 2
  36. ENABLE_SME2_FOR_NS := 2
  37. else
  38. ENABLE_SVE_FOR_NS := 0
  39. ENABLE_SME_FOR_NS := 0
  40. ENABLE_SME2_FOR_NS := 0
  41. endif
  42. endif
  43. ENABLE_BRBE_FOR_NS := 2
  44. ENABLE_TRBE_FOR_NS := 2
  45. ENABLE_FEAT_D128 := 2
  46. endif
  47. ENABLE_SYS_REG_TRACE_FOR_NS := 2
  48. ENABLE_FEAT_CSV2_2 := 2
  49. ENABLE_FEAT_CSV2_3 := 2
  50. ENABLE_FEAT_DEBUGV8P9 := 2
  51. ENABLE_FEAT_DIT := 2
  52. ENABLE_FEAT_PAN := 2
  53. ENABLE_FEAT_VHE := 2
  54. CTX_INCLUDE_NEVE_REGS := 2
  55. ENABLE_FEAT_SEL2 := 2
  56. ENABLE_TRF_FOR_NS := 2
  57. ENABLE_FEAT_ECV := 2
  58. ENABLE_FEAT_FGT := 2
  59. ENABLE_FEAT_FGT2 := 2
  60. ENABLE_FEAT_THE := 2
  61. ENABLE_FEAT_TCR2 := 2
  62. ENABLE_FEAT_S2PIE := 2
  63. ENABLE_FEAT_S1PIE := 2
  64. ENABLE_FEAT_S2POE := 2
  65. ENABLE_FEAT_S1POE := 2
  66. ENABLE_FEAT_SCTLR2 := 2
  67. ENABLE_FEAT_MTE2 := 2
  68. ENABLE_FEAT_LS64_ACCDATA := 2
  69. # The FVP platform depends on this macro to build with correct GIC driver.
  70. $(eval $(call add_define,FVP_USE_GIC_DRIVER))
  71. # Pass FVP_CLUSTER_COUNT to the build system.
  72. $(eval $(call add_define,FVP_CLUSTER_COUNT))
  73. # Pass FVP_MAX_CPUS_PER_CLUSTER to the build system.
  74. $(eval $(call add_define,FVP_MAX_CPUS_PER_CLUSTER))
  75. # Pass FVP_MAX_PE_PER_CPU to the build system.
  76. $(eval $(call add_define,FVP_MAX_PE_PER_CPU))
  77. # Pass FVP_GICR_REGION_PROTECTION to the build system.
  78. $(eval $(call add_define,FVP_GICR_REGION_PROTECTION))
  79. # Pass FVP_TRUSTED_SRAM_SIZE to the build system.
  80. $(eval $(call add_define,FVP_TRUSTED_SRAM_SIZE))
  81. # Sanity check the cluster count and if FVP_CLUSTER_COUNT <= 2,
  82. # choose the CCI driver , else the CCN driver
  83. ifeq ($(FVP_CLUSTER_COUNT), 0)
  84. $(error "Incorrect cluster count specified for FVP port")
  85. else ifeq ($(FVP_CLUSTER_COUNT),$(filter $(FVP_CLUSTER_COUNT),1 2))
  86. FVP_INTERCONNECT_DRIVER := FVP_CCI
  87. else
  88. FVP_INTERCONNECT_DRIVER := FVP_CCN
  89. endif
  90. $(eval $(call add_define,FVP_INTERCONNECT_DRIVER))
  91. # Choose the GIC sources depending upon the how the FVP will be invoked
  92. ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3)
  93. # The GIC model (GIC-600 or GIC-500) will be detected at runtime
  94. GICV3_SUPPORT_GIC600 := 1
  95. GICV3_OVERRIDE_DISTIF_PWR_OPS := 1
  96. # Include GICv3 driver files
  97. include drivers/arm/gic/v3/gicv3.mk
  98. FVP_GIC_SOURCES := ${GICV3_SOURCES} \
  99. plat/common/plat_gicv3.c \
  100. plat/arm/common/arm_gicv3.c
  101. ifeq ($(filter 1,${RESET_TO_BL2} \
  102. ${RESET_TO_BL31} ${RESET_TO_SP_MIN}),)
  103. FVP_GIC_SOURCES += plat/arm/board/fvp/fvp_gicv3.c
  104. endif
  105. else ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV2)
  106. # No GICv4 extension
  107. GIC_ENABLE_V4_EXTN := 0
  108. $(eval $(call add_define,GIC_ENABLE_V4_EXTN))
  109. # Include GICv2 driver files
  110. include drivers/arm/gic/v2/gicv2.mk
  111. FVP_GIC_SOURCES := ${GICV2_SOURCES} \
  112. plat/common/plat_gicv2.c \
  113. plat/arm/common/arm_gicv2.c
  114. FVP_DT_PREFIX := fvp-base-gicv2-psci
  115. else
  116. $(error "Incorrect GIC driver chosen on FVP port")
  117. endif
  118. ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCI)
  119. FVP_INTERCONNECT_SOURCES := drivers/arm/cci/cci.c
  120. else ifeq (${FVP_INTERCONNECT_DRIVER}, FVP_CCN)
  121. FVP_INTERCONNECT_SOURCES := drivers/arm/ccn/ccn.c \
  122. plat/arm/common/arm_ccn.c
  123. else
  124. $(error "Incorrect CCN driver chosen on FVP port")
  125. endif
  126. FVP_SECURITY_SOURCES := drivers/arm/tzc/tzc400.c \
  127. plat/arm/board/fvp/fvp_security.c \
  128. plat/arm/common/arm_tzc400.c
  129. PLAT_INCLUDES := -Iplat/arm/board/fvp/include \
  130. -Iinclude/lib/psa
  131. PLAT_BL_COMMON_SOURCES := plat/arm/board/fvp/fvp_common.c
  132. FVP_CPU_LIBS := lib/cpus/${ARCH}/aem_generic.S
  133. ifeq (${ARCH}, aarch64)
  134. # select a different set of CPU files, depending on whether we compile for
  135. # hardware assisted coherency cores or not
  136. ifeq (${HW_ASSISTED_COHERENCY}, 0)
  137. # Cores used without DSU
  138. FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a35.S \
  139. lib/cpus/aarch64/cortex_a53.S \
  140. lib/cpus/aarch64/cortex_a57.S \
  141. lib/cpus/aarch64/cortex_a72.S \
  142. lib/cpus/aarch64/cortex_a73.S
  143. else
  144. # Cores used with DSU only
  145. ifeq (${CTX_INCLUDE_AARCH32_REGS}, 0)
  146. # AArch64-only cores
  147. # TODO: add all cores to the appropriate lists
  148. FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a65.S \
  149. lib/cpus/aarch64/cortex_a65ae.S \
  150. lib/cpus/aarch64/cortex_a76.S \
  151. lib/cpus/aarch64/cortex_a76ae.S \
  152. lib/cpus/aarch64/cortex_a77.S \
  153. lib/cpus/aarch64/cortex_a78.S \
  154. lib/cpus/aarch64/cortex_a78_ae.S \
  155. lib/cpus/aarch64/cortex_a78c.S \
  156. lib/cpus/aarch64/cortex_a710.S \
  157. lib/cpus/aarch64/cortex_a715.S \
  158. lib/cpus/aarch64/cortex_a720.S \
  159. lib/cpus/aarch64/cortex_a720_ae.S \
  160. lib/cpus/aarch64/neoverse_n_common.S \
  161. lib/cpus/aarch64/neoverse_n1.S \
  162. lib/cpus/aarch64/neoverse_n2.S \
  163. lib/cpus/aarch64/neoverse_v1.S \
  164. lib/cpus/aarch64/neoverse_e1.S \
  165. lib/cpus/aarch64/cortex_x2.S \
  166. lib/cpus/aarch64/cortex_x4.S
  167. endif
  168. # AArch64/AArch32 cores
  169. FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a55.S \
  170. lib/cpus/aarch64/cortex_a75.S
  171. endif
  172. #Build AArch64-only CPUs with no FVP model yet.
  173. ifeq (${BUILD_CPUS_WITH_NO_FVP_MODEL},1)
  174. FVP_CPU_LIBS += lib/cpus/aarch64/neoverse_n3.S \
  175. lib/cpus/aarch64/cortex_gelas.S \
  176. lib/cpus/aarch64/nevis.S \
  177. lib/cpus/aarch64/travis.S \
  178. lib/cpus/aarch64/cortex_arcadia.S
  179. endif
  180. else
  181. FVP_CPU_LIBS += lib/cpus/aarch32/cortex_a32.S \
  182. lib/cpus/aarch32/cortex_a57.S \
  183. lib/cpus/aarch32/cortex_a53.S
  184. endif
  185. BL1_SOURCES += drivers/arm/smmu/smmu_v3.c \
  186. drivers/arm/sp805/sp805.c \
  187. drivers/delay_timer/delay_timer.c \
  188. drivers/io/io_semihosting.c \
  189. lib/semihosting/semihosting.c \
  190. lib/semihosting/${ARCH}/semihosting_call.S \
  191. plat/arm/board/fvp/${ARCH}/fvp_helpers.S \
  192. plat/arm/board/fvp/fvp_bl1_setup.c \
  193. plat/arm/board/fvp/fvp_cpu_pwr.c \
  194. plat/arm/board/fvp/fvp_err.c \
  195. plat/arm/board/fvp/fvp_io_storage.c \
  196. plat/arm/board/fvp/fvp_topology.c \
  197. ${FVP_CPU_LIBS} \
  198. ${FVP_INTERCONNECT_SOURCES}
  199. ifeq (${USE_SP804_TIMER},1)
  200. BL1_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
  201. else
  202. BL1_SOURCES += drivers/delay_timer/generic_delay_timer.c
  203. endif
  204. BL2_SOURCES += drivers/arm/sp805/sp805.c \
  205. drivers/io/io_semihosting.c \
  206. lib/utils/mem_region.c \
  207. lib/semihosting/semihosting.c \
  208. lib/semihosting/${ARCH}/semihosting_call.S \
  209. plat/arm/board/fvp/fvp_bl2_setup.c \
  210. plat/arm/board/fvp/fvp_err.c \
  211. plat/arm/board/fvp/fvp_io_storage.c \
  212. plat/arm/common/arm_nor_psci_mem_protect.c \
  213. ${FVP_SECURITY_SOURCES}
  214. ifeq (${COT_DESC_IN_DTB},1)
  215. BL2_SOURCES += plat/arm/common/fconf/fconf_nv_cntr_getter.c
  216. endif
  217. ifeq (${ENABLE_RME},1)
  218. BL2_SOURCES += plat/arm/board/fvp/aarch64/fvp_helpers.S \
  219. plat/arm/board/fvp/fvp_cpu_pwr.c
  220. BL31_SOURCES += plat/arm/board/fvp/fvp_plat_attest_token.c \
  221. plat/arm/board/fvp/fvp_realm_attest_key.c \
  222. plat/arm/board/fvp/fvp_el3_token_sign.c
  223. endif
  224. ifeq (${ENABLE_FEAT_RNG_TRAP},1)
  225. BL31_SOURCES += plat/arm/board/fvp/fvp_sync_traps.c
  226. endif
  227. ifeq (${RESET_TO_BL2},1)
  228. BL2_SOURCES += plat/arm/board/fvp/${ARCH}/fvp_helpers.S \
  229. plat/arm/board/fvp/fvp_cpu_pwr.c \
  230. plat/arm/board/fvp/fvp_bl2_el3_setup.c \
  231. ${FVP_CPU_LIBS} \
  232. ${FVP_INTERCONNECT_SOURCES}
  233. endif
  234. ifeq (${USE_SP804_TIMER},1)
  235. BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
  236. endif
  237. BL2U_SOURCES += plat/arm/board/fvp/fvp_bl2u_setup.c \
  238. ${FVP_SECURITY_SOURCES}
  239. ifeq (${USE_SP804_TIMER},1)
  240. BL2U_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
  241. endif
  242. BL31_SOURCES += drivers/arm/fvp/fvp_pwrc.c \
  243. drivers/arm/smmu/smmu_v3.c \
  244. drivers/delay_timer/delay_timer.c \
  245. drivers/cfi/v2m/v2m_flash.c \
  246. lib/utils/mem_region.c \
  247. plat/arm/board/fvp/fvp_bl31_setup.c \
  248. plat/arm/board/fvp/fvp_console.c \
  249. plat/arm/board/fvp/fvp_pm.c \
  250. plat/arm/board/fvp/fvp_topology.c \
  251. plat/arm/board/fvp/aarch64/fvp_helpers.S \
  252. plat/arm/board/fvp/fvp_cpu_pwr.c \
  253. plat/arm/common/arm_nor_psci_mem_protect.c \
  254. ${FVP_CPU_LIBS} \
  255. ${FVP_GIC_SOURCES} \
  256. ${FVP_INTERCONNECT_SOURCES} \
  257. ${FVP_SECURITY_SOURCES}
  258. # Support for fconf in BL31
  259. # Added separately from the above list for better readability
  260. ifeq ($(filter 1,${RESET_TO_BL2} ${RESET_TO_BL31}),)
  261. BL31_SOURCES += lib/fconf/fconf.c \
  262. lib/fconf/fconf_dyn_cfg_getter.c \
  263. plat/arm/board/fvp/fconf/fconf_hw_config_getter.c
  264. BL31_SOURCES += ${FDT_WRAPPERS_SOURCES}
  265. ifeq (${SEC_INT_DESC_IN_FCONF},1)
  266. BL31_SOURCES += plat/arm/common/fconf/fconf_sec_intr_config.c
  267. endif
  268. endif
  269. ifeq (${USE_SP804_TIMER},1)
  270. BL31_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
  271. else
  272. BL31_SOURCES += drivers/delay_timer/generic_delay_timer.c
  273. endif
  274. # Add the FDT_SOURCES and options for Dynamic Config (only for Unix env)
  275. ifdef UNIX_MK
  276. FVP_TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
  277. FVP_HW_CONFIG_DTS := fdts/${FVP_DT_PREFIX}.dts
  278. FDT_SOURCES += ${FVP_HW_CONFIG_DTS}
  279. $(eval FVP_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(FVP_HW_CONFIG_DTS)))
  280. ifeq (${TRANSFER_LIST}, 1)
  281. FDT_SOURCES += $(addprefix plat/arm/board/fvp/fdts/, \
  282. ${PLAT}_tb_fw_config.dts \
  283. )
  284. else
  285. FDT_SOURCES += $(addprefix plat/arm/board/fvp/fdts/, \
  286. ${PLAT}_fw_config.dts \
  287. ${PLAT}_tb_fw_config.dts \
  288. ${PLAT}_soc_fw_config.dts \
  289. ${PLAT}_nt_fw_config.dts \
  290. )
  291. FVP_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
  292. FVP_SOC_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_soc_fw_config.dtb
  293. FVP_NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb
  294. ifeq (${SPD},tspd)
  295. FDT_SOURCES += plat/arm/board/fvp/fdts/${PLAT}_tsp_fw_config.dts
  296. FVP_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tsp_fw_config.dtb
  297. # Add the TOS_FW_CONFIG to FIP and specify the same to certtool
  298. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_TOS_FW_CONFIG},--tos-fw-config,${FVP_TOS_FW_CONFIG}))
  299. endif
  300. ifeq (${SPD},spmd)
  301. ifeq ($(ARM_SPMC_MANIFEST_DTS),)
  302. ARM_SPMC_MANIFEST_DTS := plat/arm/board/fvp/fdts/${PLAT}_spmc_manifest.dts
  303. endif
  304. FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS}
  305. FVP_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
  306. # Add the TOS_FW_CONFIG to FIP and specify the same to certtool
  307. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_TOS_FW_CONFIG},--tos-fw-config,${FVP_TOS_FW_CONFIG}))
  308. endif
  309. # Add the FW_CONFIG to FIP and specify the same to certtool
  310. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_FW_CONFIG},--fw-config,${FVP_FW_CONFIG}))
  311. # Add the SOC_FW_CONFIG to FIP and specify the same to certtool
  312. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_SOC_FW_CONFIG},--soc-fw-config,${FVP_SOC_FW_CONFIG}))
  313. # Add the NT_FW_CONFIG to FIP and specify the same to certtool
  314. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_NT_FW_CONFIG},--nt-fw-config,${FVP_NT_FW_CONFIG}))
  315. endif
  316. # Add the TB_FW_CONFIG to FIP and specify the same to certtool
  317. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_TB_FW_CONFIG},--tb-fw-config,${FVP_TB_FW_CONFIG}))
  318. # Add the HW_CONFIG to FIP and specify the same to certtool
  319. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_HW_CONFIG},--hw-config,${FVP_HW_CONFIG}))
  320. endif
  321. ifeq (${TRANSFER_LIST}, 1)
  322. include lib/transfer_list/transfer_list.mk
  323. ifeq ($(RESET_TO_BL31), 1)
  324. HW_CONFIG := ${FVP_HW_CONFIG}
  325. FW_HANDOFF_SIZE := 20000
  326. TRANSFER_LIST_DTB_OFFSET := 0x20
  327. $(eval $(call add_define,TRANSFER_LIST_DTB_OFFSET))
  328. endif
  329. endif
  330. # Enable dynamic mitigation support by default
  331. DYNAMIC_WORKAROUND_CVE_2018_3639 := 1
  332. ifneq (${ENABLE_FEAT_AMU},0)
  333. BL31_SOURCES += lib/cpus/aarch64/cpuamu.c \
  334. lib/cpus/aarch64/cpuamu_helpers.S
  335. ifeq (${HW_ASSISTED_COHERENCY}, 1)
  336. BL31_SOURCES += lib/cpus/aarch64/cortex_a75_pubsub.c \
  337. lib/cpus/aarch64/neoverse_n1_pubsub.c
  338. endif
  339. endif
  340. ifeq (${HANDLE_EA_EL3_FIRST_NS},1)
  341. ifeq (${ENABLE_FEAT_RAS},1)
  342. ifeq (${PLATFORM_TEST_FFH_LSP_RAS_SP},1)
  343. BL31_SOURCES += plat/arm/board/fvp/aarch64/fvp_lsp_ras_sp.c
  344. else
  345. BL31_SOURCES += plat/arm/board/fvp/aarch64/fvp_ras.c
  346. endif
  347. else
  348. BL31_SOURCES += plat/arm/board/fvp/aarch64/fvp_ea.c
  349. endif
  350. endif
  351. ifneq (${ENABLE_STACK_PROTECTOR},0)
  352. PLAT_BL_COMMON_SOURCES += plat/arm/board/fvp/fvp_stack_protector.c
  353. endif
  354. # Enable the dynamic translation tables library.
  355. ifeq ($(filter 1,${RESET_TO_BL2} ${ARM_XLAT_TABLES_LIB_V1}),)
  356. ifeq (${ARCH},aarch32)
  357. BL32_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC
  358. else # AArch64
  359. BL31_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC
  360. endif
  361. endif
  362. ifeq (${ALLOW_RO_XLAT_TABLES}, 1)
  363. ifeq (${ARCH},aarch32)
  364. BL32_CPPFLAGS += -DPLAT_RO_XLAT_TABLES
  365. else # AArch64
  366. BL31_CPPFLAGS += -DPLAT_RO_XLAT_TABLES
  367. ifeq (${SPD},tspd)
  368. BL32_CPPFLAGS += -DPLAT_RO_XLAT_TABLES
  369. endif
  370. endif
  371. endif
  372. ifeq (${USE_DEBUGFS},1)
  373. BL31_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC
  374. endif
  375. # Add support for platform supplied linker script for BL31 build
  376. $(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
  377. ifneq (${RESET_TO_BL2}, 0)
  378. override BL1_SOURCES =
  379. endif
  380. include plat/arm/board/common/board_common.mk
  381. include plat/arm/common/arm_common.mk
  382. ifeq (${MEASURED_BOOT},1)
  383. BL1_SOURCES += plat/arm/board/fvp/fvp_common_measured_boot.c \
  384. plat/arm/board/fvp/fvp_bl1_measured_boot.c \
  385. lib/psa/measured_boot.c
  386. BL2_SOURCES += plat/arm/board/fvp/fvp_common_measured_boot.c \
  387. plat/arm/board/fvp/fvp_bl2_measured_boot.c \
  388. lib/psa/measured_boot.c
  389. endif
  390. ifeq (${DRTM_SUPPORT}, 1)
  391. BL31_SOURCES += plat/arm/board/fvp/fvp_drtm_addr.c \
  392. plat/arm/board/fvp/fvp_drtm_dma_prot.c \
  393. plat/arm/board/fvp/fvp_drtm_err.c \
  394. plat/arm/board/fvp/fvp_drtm_measurement.c \
  395. plat/arm/board/fvp/fvp_drtm_stub.c \
  396. plat/arm/common/arm_dyn_cfg.c \
  397. plat/arm/board/fvp/fvp_err.c
  398. endif
  399. ifeq (${TRUSTED_BOARD_BOOT}, 1)
  400. BL1_SOURCES += plat/arm/board/fvp/fvp_trusted_boot.c
  401. BL2_SOURCES += plat/arm/board/fvp/fvp_trusted_boot.c
  402. # FVP being a development platform, enable capability to disable Authentication
  403. # dynamically if TRUSTED_BOARD_BOOT is set.
  404. DYN_DISABLE_AUTH := 1
  405. endif
  406. ifeq (${SPMC_AT_EL3}, 1)
  407. PLAT_BL_COMMON_SOURCES += plat/arm/board/fvp/fvp_el3_spmc.c
  408. endif
  409. PSCI_OS_INIT_MODE := 1
  410. ifeq (${SPD},spmd)
  411. BL31_SOURCES += plat/arm/board/fvp/fvp_spmd.c
  412. endif
  413. # Test specific macros, keep them at bottom of this file
  414. $(eval $(call add_define,PLATFORM_TEST_EA_FFH))
  415. ifeq (${PLATFORM_TEST_EA_FFH}, 1)
  416. ifeq (${FFH_SUPPORT}, 0)
  417. $(error "PLATFORM_TEST_EA_FFH expects FFH_SUPPORT to be 1")
  418. endif
  419. endif
  420. $(eval $(call add_define,PLATFORM_TEST_RAS_FFH))
  421. ifeq (${PLATFORM_TEST_RAS_FFH}, 1)
  422. ifeq (${ENABLE_FEAT_RAS}, 0)
  423. $(error "PLATFORM_TEST_RAS_FFH expects ENABLE_FEAT_RAS to be 1")
  424. endif
  425. ifeq (${HANDLE_EA_EL3_FIRST_NS}, 0)
  426. $(error "PLATFORM_TEST_RAS_FFH expects HANDLE_EA_EL3_FIRST_NS to be 1")
  427. endif
  428. endif
  429. $(eval $(call add_define,PLATFORM_TEST_FFH_LSP_RAS_SP))
  430. ifeq (${PLATFORM_TEST_FFH_LSP_RAS_SP}, 1)
  431. ifeq (${PLATFORM_TEST_RAS_FFH}, 1)
  432. $(error "PLATFORM_TEST_RAS_FFH is incompatible with PLATFORM_TEST_FFH_LSP_RAS_SP")
  433. endif
  434. ifeq (${ENABLE_SPMD_LP}, 0)
  435. $(error "PLATFORM_TEST_FFH_LSP_RAS_SP expects ENABLE_SPMD_LP to be 1")
  436. endif
  437. ifeq (${ENABLE_FEAT_RAS}, 0)
  438. $(error "PLATFORM_TEST_FFH_LSP_RAS_SP expects ENABLE_FEAT_RAS to be 1")
  439. endif
  440. ifeq (${HANDLE_EA_EL3_FIRST_NS}, 0)
  441. $(error "PLATFORM_TEST_FFH_LSP_RAS_SP expects HANDLE_EA_EL3_FIRST_NS to be 1")
  442. endif
  443. endif
  444. ifeq (${ERRATA_ABI_SUPPORT}, 1)
  445. include plat/arm/board/fvp/fvp_cpu_errata.mk
  446. endif
  447. # Build macro necessary for running SPM tests on FVP platform
  448. $(eval $(call add_define,PLAT_TEST_SPM))