arm_common.mk 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. #
  2. # Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. include common/fdt_wrappers.mk
  7. ifeq (${ARCH},aarch32)
  8. ifeq (${AARCH32_SP},none)
  9. $(error Variable AARCH32_SP has to be set for AArch32)
  10. endif
  11. endif
  12. ifeq (${ARCH}, aarch64)
  13. # On ARM standard platorms, the TSP can execute from Trusted SRAM, Trusted
  14. # DRAM (if available) or the TZC secured area of DRAM.
  15. # TZC secured DRAM is the default.
  16. ARM_TSP_RAM_LOCATION ?= dram
  17. ifeq (${ARM_TSP_RAM_LOCATION}, tsram)
  18. ARM_TSP_RAM_LOCATION_ID = ARM_TRUSTED_SRAM_ID
  19. else ifeq (${ARM_TSP_RAM_LOCATION}, tdram)
  20. ARM_TSP_RAM_LOCATION_ID = ARM_TRUSTED_DRAM_ID
  21. else ifeq (${ARM_TSP_RAM_LOCATION}, dram)
  22. ARM_TSP_RAM_LOCATION_ID = ARM_DRAM_ID
  23. else
  24. $(error Unsupported ARM_TSP_RAM_LOCATION value)
  25. endif
  26. # Process flags
  27. # Process ARM_BL31_IN_DRAM flag
  28. ARM_BL31_IN_DRAM := 0
  29. $(eval $(call assert_boolean,ARM_BL31_IN_DRAM))
  30. $(eval $(call add_define,ARM_BL31_IN_DRAM))
  31. else
  32. ARM_TSP_RAM_LOCATION_ID = ARM_TRUSTED_SRAM_ID
  33. endif
  34. $(eval $(call add_define,ARM_TSP_RAM_LOCATION_ID))
  35. # For the original power-state parameter format, the State-ID can be encoded
  36. # according to the recommended encoding or zero. This flag determines which
  37. # State-ID encoding to be parsed.
  38. ARM_RECOM_STATE_ID_ENC := 0
  39. # If the PSCI_EXTENDED_STATE_ID is set, then ARM_RECOM_STATE_ID_ENC need to
  40. # be set. Else throw a build error.
  41. ifeq (${PSCI_EXTENDED_STATE_ID}, 1)
  42. ifeq (${ARM_RECOM_STATE_ID_ENC}, 0)
  43. $(error Build option ARM_RECOM_STATE_ID_ENC needs to be set if \
  44. PSCI_EXTENDED_STATE_ID is set for ARM platforms)
  45. endif
  46. endif
  47. # Process ARM_RECOM_STATE_ID_ENC flag
  48. $(eval $(call assert_boolean,ARM_RECOM_STATE_ID_ENC))
  49. $(eval $(call add_define,ARM_RECOM_STATE_ID_ENC))
  50. # Process ARM_DISABLE_TRUSTED_WDOG flag
  51. # By default, Trusted Watchdog is always enabled unless
  52. # SPIN_ON_BL1_EXIT or ENABLE_RME is set
  53. ARM_DISABLE_TRUSTED_WDOG := 0
  54. ifneq ($(filter 1,${SPIN_ON_BL1_EXIT} ${ENABLE_RME}),)
  55. ARM_DISABLE_TRUSTED_WDOG := 1
  56. endif
  57. $(eval $(call assert_boolean,ARM_DISABLE_TRUSTED_WDOG))
  58. $(eval $(call add_define,ARM_DISABLE_TRUSTED_WDOG))
  59. # Process ARM_CONFIG_CNTACR
  60. ARM_CONFIG_CNTACR := 1
  61. $(eval $(call assert_boolean,ARM_CONFIG_CNTACR))
  62. $(eval $(call add_define,ARM_CONFIG_CNTACR))
  63. # Process ARM_BL31_IN_DRAM flag
  64. ARM_BL31_IN_DRAM := 0
  65. $(eval $(call assert_boolean,ARM_BL31_IN_DRAM))
  66. $(eval $(call add_define,ARM_BL31_IN_DRAM))
  67. # As per CCA security model, all root firmware must execute from on-chip secure
  68. # memory. This means we must not run BL31 from TZC-protected DRAM.
  69. ifeq (${ARM_BL31_IN_DRAM},1)
  70. ifeq (${ENABLE_RME},1)
  71. $(error BL31 must not run from DRAM on RME-systems. Please set ARM_BL31_IN_DRAM to 0)
  72. endif
  73. endif
  74. # Process ARM_PLAT_MT flag
  75. ARM_PLAT_MT := 0
  76. $(eval $(call assert_boolean,ARM_PLAT_MT))
  77. $(eval $(call add_define,ARM_PLAT_MT))
  78. # Use translation tables library v2 by default
  79. ARM_XLAT_TABLES_LIB_V1 := 0
  80. $(eval $(call assert_boolean,ARM_XLAT_TABLES_LIB_V1))
  81. $(eval $(call add_define,ARM_XLAT_TABLES_LIB_V1))
  82. # Don't have the Linux kernel as a BL33 image by default
  83. ARM_LINUX_KERNEL_AS_BL33 := 0
  84. $(eval $(call assert_boolean,ARM_LINUX_KERNEL_AS_BL33))
  85. $(eval $(call add_define,ARM_LINUX_KERNEL_AS_BL33))
  86. ifeq (${ARM_LINUX_KERNEL_AS_BL33},1)
  87. ifneq (${ARCH},aarch64)
  88. ifneq (${RESET_TO_SP_MIN},1)
  89. $(error ARM_LINUX_KERNEL_AS_BL33 is only available if RESET_TO_SP_MIN=1.)
  90. endif
  91. endif
  92. ifndef PRELOADED_BL33_BASE
  93. $(error PRELOADED_BL33_BASE must be set if ARM_LINUX_KERNEL_AS_BL33 is used.)
  94. endif
  95. ifeq (${RESET_TO_BL31},1)
  96. ifndef ARM_PRELOADED_DTB_BASE
  97. $(error ARM_PRELOADED_DTB_BASE must be set if ARM_LINUX_KERNEL_AS_BL33 is used with RESET_TO_BL31.)
  98. endif
  99. $(eval $(call add_define,ARM_PRELOADED_DTB_BASE))
  100. endif
  101. endif
  102. # Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images
  103. # in the FIP if the platform requires.
  104. ifneq ($(BL32_EXTRA1),)
  105. $(eval $(call TOOL_ADD_IMG,bl32_extra1,--tos-fw-extra1))
  106. endif
  107. ifneq ($(BL32_EXTRA2),)
  108. $(eval $(call TOOL_ADD_IMG,bl32_extra2,--tos-fw-extra2))
  109. endif
  110. # Enable PSCI_STAT_COUNT/RESIDENCY APIs on ARM platforms
  111. ENABLE_PSCI_STAT := 1
  112. ENABLE_PMF := 1
  113. # Override the standard libc with optimised libc_asm
  114. OVERRIDE_LIBC := 1
  115. ifeq (${OVERRIDE_LIBC},1)
  116. include lib/libc/libc_asm.mk
  117. endif
  118. # On ARM platforms, separate the code and read-only data sections to allow
  119. # mapping the former as executable and the latter as execute-never.
  120. SEPARATE_CODE_AND_RODATA := 1
  121. # On ARM platforms, disable SEPARATE_NOBITS_REGION by default. Both PROGBITS
  122. # and NOBITS sections of BL31 image are adjacent to each other and loaded
  123. # into Trusted SRAM.
  124. SEPARATE_NOBITS_REGION := 0
  125. # In order to support SEPARATE_NOBITS_REGION for Arm platforms, we need to load
  126. # BL31 PROGBITS into secure DRAM space and BL31 NOBITS into SRAM. Hence mandate
  127. # the build to require that ARM_BL31_IN_DRAM is enabled as well.
  128. ifeq ($(SEPARATE_NOBITS_REGION),1)
  129. ifneq ($(ARM_BL31_IN_DRAM),1)
  130. $(error For SEPARATE_NOBITS_REGION, ARM_BL31_IN_DRAM must be enabled)
  131. endif
  132. ifneq ($(RECLAIM_INIT_CODE),0)
  133. $(error For SEPARATE_NOBITS_REGION, RECLAIM_INIT_CODE cannot be supported)
  134. endif
  135. endif
  136. # Enable PIE support for RESET_TO_BL31/RESET_TO_SP_MIN case
  137. ifneq ($(filter 1,${RESET_TO_BL31} ${RESET_TO_SP_MIN}),)
  138. ENABLE_PIE := 1
  139. endif
  140. # On Arm platform, disable ARM_FW_CONFIG_LOAD_ENABLE by default.
  141. ARM_FW_CONFIG_LOAD_ENABLE := 0
  142. $(eval $(call assert_boolean,ARM_FW_CONFIG_LOAD_ENABLE))
  143. $(eval $(call add_define,ARM_FW_CONFIG_LOAD_ENABLE))
  144. # In order to enable ARM_FW_CONFIG_LOAD_ENABLE for the Arm platform, the
  145. # platform should be reset to BL2 (RESET_TO_BL2=1), and FW_CONFIG must be
  146. # specified.
  147. ifeq (${ARM_FW_CONFIG_LOAD_ENABLE},1)
  148. ifneq (${RESET_TO_BL2},1)
  149. $(error RESET_TO_BL2 must be enabled when ARM_FW_CONFIG_LOAD_ENABLE \
  150. is enabled)
  151. endif
  152. ifeq (${FW_CONFIG},)
  153. $(error FW_CONFIG must be specified when ARM_FW_CONFIG_LOAD_ENABLE \
  154. is enabled)
  155. endif
  156. endif
  157. # Disable GPT parser support, use FIP image by default
  158. ARM_GPT_SUPPORT := 0
  159. $(eval $(call assert_boolean,ARM_GPT_SUPPORT))
  160. $(eval $(call add_define,ARM_GPT_SUPPORT))
  161. # Include necessary sources to parse GPT image
  162. ifeq (${ARM_GPT_SUPPORT}, 1)
  163. BL2_SOURCES += drivers/partition/gpt.c \
  164. drivers/partition/partition.c
  165. endif
  166. # Enable CRC instructions via extension for ARMv8-A CPUs.
  167. # For ARMv8.1-A, and onwards CRC instructions are default enabled.
  168. # Enable HW computed CRC support unconditionally in BL2 component.
  169. ifeq (${ARM_ARCH_MAJOR},8)
  170. ifeq (${ARM_ARCH_MINOR},0)
  171. BL2_CPPFLAGS += -march=armv8-a+crc
  172. endif
  173. endif
  174. ifeq ($(PSA_FWU_SUPPORT),1)
  175. # GPT support is recommended as per PSA FWU specification hence
  176. # PSA FWU implementation is tightly coupled with GPT support,
  177. # and it does not support other formats.
  178. ifneq ($(ARM_GPT_SUPPORT),1)
  179. $(error For PSA_FWU_SUPPORT, ARM_GPT_SUPPORT must be enabled)
  180. endif
  181. FWU_MK := drivers/fwu/fwu.mk
  182. $(info Including ${FWU_MK})
  183. include ${FWU_MK}
  184. endif
  185. ifeq (${ARCH}, aarch64)
  186. PLAT_INCLUDES += -Iinclude/plat/arm/common/aarch64
  187. endif
  188. PLAT_BL_COMMON_SOURCES += plat/arm/common/${ARCH}/arm_helpers.S \
  189. plat/arm/common/arm_common.c \
  190. plat/arm/common/arm_console.c
  191. ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1)
  192. PLAT_BL_COMMON_SOURCES += lib/xlat_tables/xlat_tables_common.c \
  193. lib/xlat_tables/${ARCH}/xlat_tables.c
  194. else
  195. ifeq (${XLAT_MPU_LIB_V1}, 1)
  196. include lib/xlat_mpu/xlat_mpu.mk
  197. PLAT_BL_COMMON_SOURCES += ${XLAT_MPU_LIB_V1_SRCS}
  198. else
  199. include lib/xlat_tables_v2/xlat_tables.mk
  200. PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS}
  201. endif
  202. endif
  203. ARM_IO_SOURCES += plat/arm/common/arm_io_storage.c \
  204. plat/arm/common/fconf/arm_fconf_io.c
  205. ifeq (${SPD},spmd)
  206. ifeq (${BL2_ENABLE_SP_LOAD},1)
  207. ARM_IO_SOURCES += plat/arm/common/fconf/arm_fconf_sp.c
  208. endif
  209. endif
  210. BL1_SOURCES += drivers/io/io_fip.c \
  211. drivers/io/io_memmap.c \
  212. drivers/io/io_storage.c \
  213. plat/arm/common/arm_bl1_setup.c \
  214. plat/arm/common/arm_err.c \
  215. ${ARM_IO_SOURCES}
  216. ifdef EL3_PAYLOAD_BASE
  217. # Need the plat_arm_program_trusted_mailbox() function to release secondary CPUs from
  218. # their holding pen
  219. BL1_SOURCES += plat/arm/common/arm_pm.c
  220. endif
  221. BL2_SOURCES += drivers/delay_timer/delay_timer.c \
  222. drivers/delay_timer/generic_delay_timer.c \
  223. drivers/io/io_fip.c \
  224. drivers/io/io_memmap.c \
  225. drivers/io/io_storage.c \
  226. plat/arm/common/arm_bl2_setup.c \
  227. plat/arm/common/arm_err.c \
  228. common/tf_crc32.c \
  229. ${ARM_IO_SOURCES}
  230. # Firmware Configuration Framework sources
  231. include lib/fconf/fconf.mk
  232. BL1_SOURCES += ${FCONF_SOURCES} ${FCONF_DYN_SOURCES}
  233. BL2_SOURCES += ${FCONF_SOURCES} ${FCONF_DYN_SOURCES}
  234. # Add `libfdt` and Arm common helpers required for Dynamic Config
  235. include lib/libfdt/libfdt.mk
  236. DYN_CFG_SOURCES += plat/arm/common/arm_dyn_cfg.c \
  237. plat/arm/common/arm_dyn_cfg_helpers.c \
  238. common/uuid.c
  239. DYN_CFG_SOURCES += ${FDT_WRAPPERS_SOURCES}
  240. BL1_SOURCES += ${DYN_CFG_SOURCES}
  241. BL2_SOURCES += ${DYN_CFG_SOURCES}
  242. ifeq (${RESET_TO_BL2},1)
  243. BL2_SOURCES += plat/arm/common/arm_bl2_el3_setup.c
  244. endif
  245. # Because BL1/BL2 execute in AArch64 mode but BL32 in AArch32 we need to use
  246. # the AArch32 descriptors.
  247. ifeq (${JUNO_AARCH32_EL3_RUNTIME},1)
  248. BL2_SOURCES += plat/arm/common/aarch32/arm_bl2_mem_params_desc.c
  249. else
  250. ifeq ($(filter $(PLAT), corstone1000 rd1ae),)
  251. BL2_SOURCES += plat/arm/common/${ARCH}/arm_bl2_mem_params_desc.c
  252. endif
  253. endif
  254. BL2_SOURCES += plat/arm/common/arm_image_load.c \
  255. common/desc_image_load.c
  256. ifeq (${SPD},opteed)
  257. BL2_SOURCES += lib/optee/optee_utils.c
  258. endif
  259. BL2U_SOURCES += drivers/delay_timer/delay_timer.c \
  260. drivers/delay_timer/generic_delay_timer.c \
  261. plat/arm/common/arm_bl2u_setup.c
  262. BL31_SOURCES += plat/arm/common/arm_bl31_setup.c \
  263. plat/arm/common/arm_pm.c \
  264. plat/arm/common/arm_topology.c \
  265. plat/common/plat_psci_common.c
  266. ifeq (${TRANSFER_LIST}, 1)
  267. TRANSFER_LIST_SOURCES += plat/arm/common/arm_transfer_list.c
  268. endif
  269. ifneq ($(filter 1,${ENABLE_PMF} ${ETHOSN_NPU_DRIVER}),)
  270. ARM_SVC_HANDLER_SRCS :=
  271. ifeq (${ENABLE_PMF},1)
  272. ARM_SVC_HANDLER_SRCS += lib/pmf/pmf_smc.c
  273. endif
  274. ifeq (${ETHOSN_NPU_DRIVER},1)
  275. ARM_SVC_HANDLER_SRCS += plat/arm/common/fconf/fconf_ethosn_getter.c \
  276. drivers/delay_timer/delay_timer.c \
  277. drivers/arm/ethosn/ethosn_smc.c
  278. ifeq (${ETHOSN_NPU_TZMP1},1)
  279. ARM_SVC_HANDLER_SRCS += drivers/arm/ethosn/ethosn_big_fw.c
  280. endif
  281. endif
  282. ifeq (${ARCH}, aarch64)
  283. BL31_SOURCES += plat/arm/common/aarch64/execution_state_switch.c\
  284. plat/arm/common/arm_sip_svc.c \
  285. plat/arm/common/plat_arm_sip_svc.c \
  286. ${ARM_SVC_HANDLER_SRCS}
  287. else
  288. BL32_SOURCES += plat/arm/common/arm_sip_svc.c \
  289. plat/arm/common/plat_arm_sip_svc.c \
  290. ${ARM_SVC_HANDLER_SRCS}
  291. endif
  292. endif
  293. ifeq (${EL3_EXCEPTION_HANDLING},1)
  294. BL31_SOURCES += plat/common/aarch64/plat_ehf.c
  295. endif
  296. ifeq (${SDEI_SUPPORT},1)
  297. BL31_SOURCES += plat/arm/common/aarch64/arm_sdei.c
  298. ifeq (${SDEI_IN_FCONF},1)
  299. BL31_SOURCES += plat/arm/common/fconf/fconf_sdei_getter.c
  300. endif
  301. endif
  302. # RAS sources
  303. ifeq (${ENABLE_FEAT_RAS}-${HANDLE_EA_EL3_FIRST_NS},1-1)
  304. BL31_SOURCES += lib/extensions/ras/std_err_record.c \
  305. lib/extensions/ras/ras_common.c
  306. endif
  307. # Pointer Authentication sources
  308. ifeq (${ENABLE_PAUTH}, 1)
  309. PLAT_BL_COMMON_SOURCES += plat/arm/common/aarch64/arm_pauth.c
  310. endif
  311. ifeq (${SPD},spmd)
  312. BL31_SOURCES += plat/common/plat_spmd_manifest.c \
  313. common/uuid.c \
  314. ${LIBFDT_SRCS}
  315. BL31_SOURCES += ${FDT_WRAPPERS_SOURCES}
  316. endif
  317. ifeq (${DRTM_SUPPORT},1)
  318. BL31_SOURCES += plat/arm/common/arm_err.c
  319. endif
  320. ifneq ($(filter 1,${MEASURED_BOOT} ${TRUSTED_BOARD_BOOT} ${DRTM_SUPPORT}),)
  321. PLAT_INCLUDES += -Iplat/arm/common \
  322. -Iinclude/drivers/auth/mbedtls
  323. # Specify mbed TLS configuration file
  324. ifeq (${PSA_CRYPTO},1)
  325. MBEDTLS_CONFIG_FILE ?= "<plat_arm_psa_mbedtls_config.h>"
  326. else
  327. MBEDTLS_CONFIG_FILE ?= "<plat_arm_mbedtls_config.h>"
  328. endif
  329. endif
  330. ifneq (${TRUSTED_BOARD_BOOT},0)
  331. # Include common TBB sources
  332. AUTH_SOURCES := drivers/auth/auth_mod.c \
  333. drivers/auth/img_parser_mod.c
  334. # Include the selected chain of trust sources.
  335. ifeq (${COT},tbbr)
  336. BL1_SOURCES += drivers/auth/tbbr/tbbr_cot_common.c \
  337. drivers/auth/tbbr/tbbr_cot_bl1.c
  338. ifneq (${COT_DESC_IN_DTB},0)
  339. BL2_SOURCES += lib/fconf/fconf_cot_getter.c
  340. else
  341. # Juno has its own TBBR CoT file for BL2
  342. ifeq (${PLAT},juno)
  343. BL2_SOURCES += drivers/auth/tbbr/tbbr_cot_common.c
  344. endif
  345. endif
  346. else ifeq (${COT},dualroot)
  347. BL1_SOURCES += drivers/auth/dualroot/bl1_cot.c
  348. ifneq (${COT_DESC_IN_DTB},0)
  349. BL2_SOURCES += lib/fconf/fconf_cot_getter.c
  350. endif
  351. else ifeq (${COT},cca)
  352. BL1_SOURCES += drivers/auth/cca/bl1_cot.c
  353. ifneq (${COT_DESC_IN_DTB},0)
  354. BL2_SOURCES += lib/fconf/fconf_cot_getter.c
  355. endif
  356. else
  357. $(error Unknown chain of trust ${COT})
  358. endif
  359. ifeq (${COT_DESC_IN_DTB},0)
  360. ifeq (${COT},dualroot)
  361. COTDTPATH := fdts/dualroot_cot_descriptors.dtsi
  362. else ifeq (${COT},cca)
  363. COTDTPATH := fdts/cca_cot_descriptors.dtsi
  364. else ifeq (${COT},tbbr)
  365. ifneq (${PLAT},juno)
  366. COTDTPATH := fdts/tbbr_cot_descriptors.dtsi
  367. endif
  368. endif
  369. endif
  370. BL1_SOURCES += ${AUTH_SOURCES} \
  371. bl1/tbbr/tbbr_img_desc.c \
  372. plat/arm/common/arm_bl1_fwu.c \
  373. plat/common/tbbr/plat_tbbr.c
  374. BL2_SOURCES += ${AUTH_SOURCES} \
  375. plat/common/tbbr/plat_tbbr.c
  376. $(eval $(call TOOL_ADD_IMG,ns_bl2u,--fwu,FWU_))
  377. IMG_PARSER_LIB_MK := drivers/auth/mbedtls/mbedtls_x509.mk
  378. $(info Including ${IMG_PARSER_LIB_MK})
  379. include ${IMG_PARSER_LIB_MK}
  380. endif
  381. # Include Measured Boot makefile before any Crypto library makefile.
  382. # Crypto library makefile may need default definitions of Measured Boot build
  383. # flags present in Measured Boot makefile.
  384. ifneq ($(filter 1,${MEASURED_BOOT} ${DRTM_SUPPORT}),)
  385. MEASURED_BOOT_MK := drivers/measured_boot/event_log/event_log.mk
  386. $(info Including ${MEASURED_BOOT_MK})
  387. include ${MEASURED_BOOT_MK}
  388. ifeq (${MEASURED_BOOT},1)
  389. BL1_SOURCES += ${EVENT_LOG_SOURCES}
  390. BL2_SOURCES += ${EVENT_LOG_SOURCES}
  391. endif
  392. ifeq (${DRTM_SUPPORT},1)
  393. BL31_SOURCES += ${EVENT_LOG_SOURCES}
  394. endif
  395. endif
  396. ifneq ($(filter 1,${MEASURED_BOOT} ${TRUSTED_BOARD_BOOT} ${DRTM_SUPPORT}),)
  397. CRYPTO_SOURCES := drivers/auth/crypto_mod.c \
  398. lib/fconf/fconf_tbbr_getter.c
  399. BL1_SOURCES += ${CRYPTO_SOURCES}
  400. BL2_SOURCES += ${CRYPTO_SOURCES}
  401. BL31_SOURCES += drivers/auth/crypto_mod.c
  402. # We expect to locate the *.mk files under the directories specified below
  403. CRYPTO_LIB_MK := drivers/auth/mbedtls/mbedtls_crypto.mk
  404. $(info Including ${CRYPTO_LIB_MK})
  405. include ${CRYPTO_LIB_MK}
  406. endif
  407. ifeq (${RECLAIM_INIT_CODE}, 1)
  408. ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1)
  409. $(error To reclaim init code xlat tables v2 must be used)
  410. endif
  411. endif
  412. ifneq ($(COTDTPATH),)
  413. cot-dt-defines = IMAGE_BL2 $(BL2_DEFINES) $(PLAT_BL_COMMON_DEFINES)
  414. cot-dt-include-dirs = $(BL2_INCLUDE_DIRS) $(PLAT_BL_COMMON_INCLUDE_DIRS)
  415. cot-dt-cpp-flags = $(cot-dt-defines:%=-D%)
  416. cot-dt-cpp-flags += $(cot-dt-include-dirs:%=-I%)
  417. cot-dt-cpp-flags += $(BL2_CPPFLAGS) $(PLAT_BL_COMMON_CPPFLAGS)
  418. cot-dt-cpp-flags += $(CPPFLAGS) $(BL_CPPFLAGS) $(TF_CFLAGS_$(ARCH))
  419. cot-dt-cpp-flags += -c -x assembler-with-cpp -E -P -o $@ $<
  420. $(BUILD_PLAT)/$(COTDTPATH:.dtsi=.dts): $(COTDTPATH) | $$(@D)/
  421. $(q)$($(ARCH)-cpp) $(cot-dt-cpp-flags)
  422. $(BUILD_PLAT)/$(COTDTPATH:.dtsi=.c): $(BUILD_PLAT)/$(COTDTPATH:.dtsi=.dts) | $$(@D)/
  423. $(if $(host-poetry),$(q)poetry -q install)
  424. $(q)$(if $(host-poetry),poetry run )cot-dt2c convert-to-c $< $@
  425. BL2_SOURCES += $(BUILD_PLAT)/$(COTDTPATH:.dtsi=.c)
  426. endif