imx7.mk 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #
  2. # Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. # Architecture
  7. $(eval $(call add_define,ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING))
  8. TF_CFLAGS += -mfpu=neon
  9. ASFLAGS += -mfpu=neon
  10. # Platform
  11. PLAT_INCLUDES := -Idrivers/imx/uart \
  12. -Iplat/imx/common/include \
  13. -Iplat/imx/imx7/include \
  14. -Idrivers/imx/timer \
  15. -Idrivers/imx/usdhc \
  16. -Iinclude/common/tbbr
  17. # Translation tables library
  18. include lib/xlat_tables_v2/xlat_tables.mk
  19. BL2_SOURCES += common/desc_image_load.c \
  20. drivers/delay_timer/delay_timer.c \
  21. drivers/mmc/mmc.c \
  22. drivers/io/io_block.c \
  23. drivers/io/io_fip.c \
  24. drivers/io/io_memmap.c \
  25. drivers/io/io_storage.c \
  26. drivers/imx/timer/imx_gpt.c \
  27. drivers/imx/uart/imx_uart.c \
  28. drivers/imx/uart/imx_crash_uart.S \
  29. lib/aarch32/arm32_aeabi_divmod.c \
  30. lib/aarch32/arm32_aeabi_divmod_a32.S \
  31. lib/cpus/aarch32/cortex_a7.S \
  32. lib/optee/optee_utils.c \
  33. plat/imx/common/imx_aips.c \
  34. plat/imx/common/imx_caam.c \
  35. plat/imx/common/imx_clock.c \
  36. plat/imx/common/imx_csu.c \
  37. plat/imx/common/imx_io_mux.c \
  38. plat/imx/common/imx_snvs.c \
  39. plat/imx/common/imx_wdog.c \
  40. plat/imx/common/imx7_clock.c \
  41. plat/imx/imx7/common/imx7_bl2_mem_params_desc.c \
  42. plat/imx/imx7/common/imx7_bl2_el3_common.c \
  43. plat/imx/imx7/common/imx7_helpers.S \
  44. plat/imx/imx7/common/imx7_image_load.c \
  45. plat/imx/common/imx_io_storage.c \
  46. plat/imx/common/aarch32/imx_uart_console.S \
  47. ${XLAT_TABLES_LIB_SRCS}
  48. ifneq (${TRUSTED_BOARD_BOOT},0)
  49. include drivers/auth/mbedtls/mbedtls_crypto.mk
  50. include drivers/auth/mbedtls/mbedtls_x509.mk
  51. AUTH_SOURCES := drivers/auth/auth_mod.c \
  52. drivers/auth/crypto_mod.c \
  53. drivers/auth/img_parser_mod.c \
  54. drivers/auth/tbbr/tbbr_cot_common.c
  55. BL2_SOURCES += ${AUTH_SOURCES} \
  56. plat/common/tbbr/plat_tbbr.c \
  57. plat/imx/imx7/common/imx7_trusted_boot.c \
  58. plat/imx/imx7/common/imx7_rotpk.S \
  59. drivers/auth/tbbr/tbbr_cot_bl2.c
  60. ROT_KEY = $(BUILD_PLAT)/rot_key.pem
  61. ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin
  62. $(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"'))
  63. $(BUILD_PLAT)/bl2/imx7_rotpk.o: $(ROTPK_HASH)
  64. certificates: $(ROT_KEY)
  65. $(ROT_KEY): | $$(@D)/
  66. $(s)echo " OPENSSL $@"
  67. $(q)if [ ! -f $(ROT_KEY) ]; then \
  68. ${OPENSSL_BIN_PATH}/openssl genrsa 2048 > $@ 2>/dev/null; \
  69. fi
  70. $(ROTPK_HASH): $(ROT_KEY) | $$(@D)/
  71. $(s)echo " OPENSSL $@"
  72. $(q)${OPENSSL_BIN_PATH}/openssl rsa -in $< -pubout -outform DER 2>/dev/null |\
  73. ${OPENSSL_BIN_PATH}/openssl dgst -sha256 -binary > $@ 2>/dev/null
  74. endif
  75. # Add the build options to pack BLx images and kernel device tree
  76. # in the FIP if the platform requires.
  77. ifneq ($(BL2),)
  78. $(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/tb_fw.crt,--tb-fw-cert))
  79. endif
  80. ifneq ($(BL32_EXTRA1),)
  81. $(eval $(call TOOL_ADD_IMG,BL32_EXTRA1,--tos-fw-extra1))
  82. endif
  83. ifneq ($(BL32_EXTRA2),)
  84. $(eval $(call TOOL_ADD_IMG,BL32_EXTRA2,--tos-fw-extra2))
  85. endif
  86. ifneq ($(HW_CONFIG),)
  87. $(eval $(call TOOL_ADD_IMG,HW_CONFIG,--hw-config))
  88. endif
  89. # Verify build config
  90. # -------------------
  91. ifeq (${ARCH},aarch64)
  92. $(error Error: AArch64 not supported on i.mx7)
  93. endif
  94. ifeq (${AARCH32_SP}, none)
  95. $(error Variable AARCH32_SP has to be set for AArch32)
  96. endif