platform.mk 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. # Copyright (c) 2021-2024, Arm Limited. All rights reserved.
  2. #
  3. # SPDX-License-Identifier: BSD-3-Clause
  4. #
  5. include common/fdt_wrappers.mk
  6. TARGET_FLAVOUR := fvp
  7. # DPU with SCMI may not necessarily work, so allow its independence
  8. TC_DPU_USE_SCMI_CLK := 1
  9. # SCMI power domain control enable
  10. TC_SCMI_PD_CTRL_EN := 1
  11. # IOMMU: Enable the use of system or individual MMUs
  12. TC_IOMMU_EN := 1
  13. # System setup
  14. CSS_USE_SCMI_SDS_DRIVER := 1
  15. HW_ASSISTED_COHERENCY := 1
  16. USE_COHERENT_MEM := 0
  17. GIC_ENABLE_V4_EXTN := 1
  18. GICV3_SUPPORT_GIC600 := 1
  19. override NEED_BL2U := no
  20. override ARM_PLAT_MT := 1
  21. # CPU setup
  22. ARM_ARCH_MINOR := 7
  23. BRANCH_PROTECTION := 1
  24. ENABLE_FEAT_MPAM := 1 # default is 2, optimise
  25. ENABLE_SVE_FOR_NS := 2 # to show we use it
  26. ENABLE_SVE_FOR_SWD := 1
  27. ENABLE_TRBE_FOR_NS := 1
  28. ENABLE_SYS_REG_TRACE_FOR_NS := 1
  29. ENABLE_FEAT_AMU := 1
  30. ENABLE_AMU_FCONF := 1
  31. ENABLE_AMU_AUXILIARY_COUNTERS := 1
  32. ENABLE_MPMM := 1
  33. ENABLE_MPMM_FCONF := 1
  34. CTX_INCLUDE_AARCH32_REGS := 0
  35. ifeq (${SPD},spmd)
  36. SPMD_SPM_AT_SEL2 := 1
  37. CTX_INCLUDE_PAUTH_REGS := 1
  38. endif
  39. ifneq ($(shell expr $(TARGET_PLATFORM) \<= 1), 0)
  40. $(warning Platform ${PLAT}$(TARGET_PLATFORM) is deprecated. \
  41. Some of the features might not work as expected)
  42. endif
  43. ifeq ($(shell expr $(TARGET_PLATFORM) \<= 3), 0)
  44. $(error TARGET_PLATFORM must be less than or equal to 3)
  45. endif
  46. ifeq ($(filter ${TARGET_FLAVOUR}, fvp fpga),)
  47. $(error TARGET_FLAVOUR must be fvp or fpga)
  48. endif
  49. $(eval $(call add_defines, \
  50. TARGET_PLATFORM \
  51. TARGET_FLAVOUR_$(call uppercase,${TARGET_FLAVOUR}) \
  52. TC_DPU_USE_SCMI_CLK \
  53. TC_SCMI_PD_CTRL_EN \
  54. TC_IOMMU_EN \
  55. ))
  56. CSS_LOAD_SCP_IMAGES := 1
  57. # Include GICv3 driver files
  58. include drivers/arm/gic/v3/gicv3.mk
  59. ENT_GIC_SOURCES := ${GICV3_SOURCES} \
  60. plat/common/plat_gicv3.c \
  61. plat/arm/common/arm_gicv3.c
  62. TC_BASE = plat/arm/board/tc
  63. PLAT_INCLUDES += -I${TC_BASE}/include/ \
  64. -I${TC_BASE}/fdts/
  65. # CPU libraries for TARGET_PLATFORM=1
  66. ifeq (${TARGET_PLATFORM}, 1)
  67. TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \
  68. lib/cpus/aarch64/cortex_a715.S \
  69. lib/cpus/aarch64/cortex_x3.S
  70. endif
  71. # CPU libraries for TARGET_PLATFORM=2
  72. ifeq (${TARGET_PLATFORM}, 2)
  73. TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
  74. lib/cpus/aarch64/cortex_a720.S \
  75. lib/cpus/aarch64/cortex_x4.S
  76. endif
  77. # CPU libraries for TARGET_PLATFORM=3
  78. ifeq (${TARGET_PLATFORM}, 3)
  79. TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \
  80. lib/cpus/aarch64/cortex_chaberton.S \
  81. lib/cpus/aarch64/cortex_blackhawk.S
  82. endif
  83. INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c
  84. PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \
  85. ${TC_BASE}/include/tc_helpers.S
  86. BL1_SOURCES += ${INTERCONNECT_SOURCES} \
  87. ${TC_CPU_SOURCES} \
  88. ${TC_BASE}/tc_trusted_boot.c \
  89. ${TC_BASE}/tc_err.c \
  90. drivers/arm/sbsa/sbsa.c
  91. BL2_SOURCES += ${TC_BASE}/tc_security.c \
  92. ${TC_BASE}/tc_err.c \
  93. ${TC_BASE}/tc_trusted_boot.c \
  94. ${TC_BASE}/tc_bl2_setup.c \
  95. lib/utils/mem_region.c \
  96. drivers/arm/tzc/tzc400.c \
  97. plat/arm/common/arm_tzc400.c \
  98. plat/arm/common/arm_nor_psci_mem_protect.c
  99. BL31_SOURCES += ${INTERCONNECT_SOURCES} \
  100. ${TC_CPU_SOURCES} \
  101. ${ENT_GIC_SOURCES} \
  102. ${TC_BASE}/tc_bl31_setup.c \
  103. ${TC_BASE}/tc_topology.c \
  104. lib/fconf/fconf.c \
  105. lib/fconf/fconf_dyn_cfg_getter.c \
  106. drivers/cfi/v2m/v2m_flash.c \
  107. lib/utils/mem_region.c \
  108. plat/arm/common/arm_nor_psci_mem_protect.c \
  109. drivers/arm/sbsa/sbsa.c
  110. BL31_SOURCES += ${FDT_WRAPPERS_SOURCES}
  111. # Add the FDT_SOURCES and options for Dynamic Config
  112. FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \
  113. ${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts \
  114. ${TC_BASE}/fdts/${PLAT}_nt_fw_config.dts
  115. FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
  116. TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
  117. FVP_NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb
  118. # Add the FW_CONFIG to FIP and specify the same to certtool
  119. $(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
  120. # Add the TB_FW_CONFIG to FIP and specify the same to certtool
  121. $(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
  122. # Add the NT_FW_CONFIG to FIP and specify the same to certtool
  123. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_NT_FW_CONFIG},--nt-fw-config,${FVP_NT_FW_CONFIG}))
  124. ifeq (${SPD},spmd)
  125. ifeq ($(ARM_SPMC_MANIFEST_DTS),)
  126. ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_test_manifest.dts
  127. endif
  128. FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS}
  129. TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
  130. # Add the TOS_FW_CONFIG to FIP and specify the same to certtool
  131. $(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG}))
  132. endif
  133. #Device tree
  134. TC_HW_CONFIG_DTS := fdts/tc.dts
  135. TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb
  136. FDT_SOURCES += ${TC_HW_CONFIG_DTS}
  137. $(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS)))
  138. # Add the HW_CONFIG to FIP and specify the same to certtool
  139. $(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG}))
  140. # Include Measured Boot makefile before any Crypto library makefile.
  141. # Crypto library makefile may need default definitions of Measured Boot build
  142. # flags present in Measured Boot makefile.
  143. $(info Including rss_comms.mk)
  144. ifeq (${MEASURED_BOOT},1)
  145. $(info Including rss_comms.mk)
  146. include drivers/arm/rss/rss_comms.mk
  147. BL1_SOURCES += ${RSS_COMMS_SOURCES}
  148. BL2_SOURCES += ${RSS_COMMS_SOURCES}
  149. PLAT_INCLUDES += -Iinclude/lib/psa
  150. ifeq (${DICE_PROTECTION_ENVIRONMENT},1)
  151. $(info Including qcbor.mk)
  152. include drivers/measured_boot/rss/qcbor.mk
  153. $(info Including dice_prot_env.mk)
  154. include drivers/measured_boot/rss/dice_prot_env.mk
  155. BL1_SOURCES += ${QCBOR_SOURCES} \
  156. ${DPE_SOURCES} \
  157. plat/arm/board/tc/tc_common_dpe.c \
  158. plat/arm/board/tc/tc_bl1_dpe.c \
  159. lib/psa/dice_protection_environment.c \
  160. drivers/arm/css/sds/sds.c \
  161. drivers/delay_timer/delay_timer.c \
  162. drivers/delay_timer/generic_delay_timer.c
  163. BL2_SOURCES += ${QCBOR_SOURCES} \
  164. ${DPE_SOURCES} \
  165. plat/arm/board/tc/tc_common_dpe.c \
  166. plat/arm/board/tc/tc_bl2_dpe.c \
  167. lib/psa/dice_protection_environment.c
  168. PLAT_INCLUDES += -I${QCBOR_INCLUDES} \
  169. -Iinclude/lib/dice
  170. else
  171. $(info Including rss_measured_boot.mk)
  172. include drivers/measured_boot/rss/rss_measured_boot.mk
  173. BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \
  174. plat/arm/board/tc/tc_common_measured_boot.c \
  175. plat/arm/board/tc/tc_bl1_measured_boot.c \
  176. lib/psa/measured_boot.c
  177. BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \
  178. plat/arm/board/tc/tc_common_measured_boot.c \
  179. plat/arm/board/tc/tc_bl2_measured_boot.c \
  180. lib/psa/measured_boot.c
  181. endif
  182. endif
  183. ifeq (${TRNG_SUPPORT},1)
  184. BL31_SOURCES += plat/arm/board/tc/tc_trng.c
  185. endif
  186. ifneq (${PLATFORM_TEST},)
  187. # Add this include as first, before arm_common.mk. This is necessary
  188. # because arm_common.mk builds Mbed TLS, and platform_test.mk can
  189. # change the list of Mbed TLS files that are to be compiled
  190. # (LIBMBEDTLS_SRCS).
  191. include plat/arm/board/tc/platform_test.mk
  192. endif
  193. include plat/arm/common/arm_common.mk
  194. include plat/arm/css/common/css_common.mk
  195. include plat/arm/soc/common/soc_css.mk
  196. include plat/arm/board/common/board_common.mk