platform.mk 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #
  2. # Copyright (c) 2019-2023, Arm Limited. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. include common/fdt_wrappers.mk
  7. ifdef ARM_CORTEX_A5
  8. # Use the SP804 timer instead of the generic one
  9. USE_SP804_TIMER := 1
  10. BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
  11. endif
  12. # Include GICv2 driver files
  13. include drivers/arm/gic/v2/gicv2.mk
  14. FVP_VE_GIC_SOURCES := ${GICV2_SOURCES} \
  15. plat/common/plat_gicv2.c \
  16. plat/arm/common/arm_gicv2.c
  17. FVP_VE_SECURITY_SOURCES := plat/arm/board/fvp_ve/fvp_ve_security.c
  18. PLAT_INCLUDES := -Iplat/arm/board/fvp_ve/include
  19. PLAT_BL_COMMON_SOURCES := plat/arm/board/fvp_ve/fvp_ve_common.c \
  20. plat/arm/common/${ARCH}/arm_helpers.S \
  21. plat/arm/common/arm_common.c \
  22. plat/arm/common/arm_console.c \
  23. drivers/arm/pl011/${ARCH}/pl011_console.S \
  24. plat/arm/board/common/${ARCH}/board_arm_helpers.S
  25. ifdef ARM_CORTEX_A5
  26. FVP_VE_CPU_LIBS := lib/cpus/aarch32/cortex_a5.S
  27. else
  28. FVP_VE_CPU_LIBS := lib/cpus/aarch32/cortex_a7.S
  29. endif
  30. BL1_SOURCES += drivers/arm/sp805/sp805.c \
  31. drivers/io/io_fip.c \
  32. drivers/io/io_memmap.c \
  33. drivers/io/io_storage.c \
  34. plat/arm/common/arm_bl1_setup.c \
  35. plat/arm/common/arm_err.c \
  36. plat/arm/board/fvp_ve/fvp_ve_err.c \
  37. plat/arm/common/arm_io_storage.c \
  38. plat/arm/common/fconf/arm_fconf_io.c \
  39. drivers/cfi/v2m/v2m_flash.c \
  40. plat/arm/board/fvp_ve/${ARCH}/fvp_ve_helpers.S \
  41. plat/arm/board/fvp_ve/fvp_ve_bl1_setup.c \
  42. lib/aarch32/arm32_aeabi_divmod.c \
  43. lib/aarch32/arm32_aeabi_divmod_a32.S \
  44. ${FVP_VE_CPU_LIBS} \
  45. ${DYN_CFG_SOURCES}
  46. BL2_SOURCES += plat/arm/board/fvp_ve/fvp_ve_bl2_setup.c \
  47. lib/aarch32/arm32_aeabi_divmod.c \
  48. lib/aarch32/arm32_aeabi_divmod_a32.S \
  49. drivers/delay_timer/delay_timer.c \
  50. drivers/delay_timer/generic_delay_timer.c \
  51. drivers/cfi/v2m/v2m_flash.c \
  52. drivers/io/io_fip.c \
  53. drivers/io/io_memmap.c \
  54. drivers/io/io_storage.c \
  55. plat/arm/common/arm_bl2_setup.c \
  56. plat/arm/common/arm_err.c \
  57. plat/arm/board/fvp_ve/fvp_ve_err.c \
  58. plat/arm/common/arm_io_storage.c \
  59. plat/arm/common/fconf/arm_fconf_io.c \
  60. plat/arm/common/${ARCH}/arm_bl2_mem_params_desc.c \
  61. plat/arm/common/arm_image_load.c \
  62. common/desc_image_load.c \
  63. ${DYN_CFG_SOURCES} \
  64. ${FVP_VE_SECURITY_SOURCES}
  65. # Add the FDT_SOURCES and options for Dynamic Config (only for Unix env)
  66. ifdef UNIX_MK
  67. FDT_SOURCES += plat/arm/board/fvp_ve/fdts/fvp_ve_fw_config.dts \
  68. plat/arm/board/fvp_ve/fdts/fvp_ve_tb_fw_config.dts
  69. FVP_FW_CONFIG := ${BUILD_PLAT}/fdts/fvp_ve_fw_config.dtb
  70. FVP_TB_FW_CONFIG := ${BUILD_PLAT}/fdts/fvp_ve_tb_fw_config.dtb
  71. # Add the FW_CONFIG to FIP and specify the same to certtool
  72. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_FW_CONFIG},--fw-config,${FVP_FW_CONFIG}))
  73. # Add the TB_FW_CONFIG to FIP and specify the same to certtool
  74. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_TB_FW_CONFIG},--tb-fw-config,${FVP_TB_FW_CONFIG}))
  75. FDT_SOURCES += ${FVP_HW_CONFIG_DTS}
  76. $(eval FVP_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb, \
  77. fdts/$(notdir ${FVP_HW_CONFIG_DTS})))
  78. # Add the HW_CONFIG to FIP and specify the same to certtool
  79. $(eval $(call TOOL_ADD_PAYLOAD,${FVP_HW_CONFIG},--hw-config,${FVP_HW_CONFIG}))
  80. endif
  81. NEED_BL32 := yes
  82. ifeq (${AARCH32_SP},none)
  83. $(error Variable AARCH32_SP has to be set for AArch32)
  84. endif
  85. # Modification of arm_common.mk
  86. # Process ARM_DISABLE_TRUSTED_WDOG flag
  87. # By default, Trusted Watchdog is always enabled unless SPIN_ON_BL1_EXIT is set
  88. ARM_DISABLE_TRUSTED_WDOG := 0
  89. ifeq (${SPIN_ON_BL1_EXIT}, 1)
  90. ARM_DISABLE_TRUSTED_WDOG := 1
  91. endif
  92. $(eval $(call assert_boolean,ARM_DISABLE_TRUSTED_WDOG))
  93. $(eval $(call add_define,ARM_DISABLE_TRUSTED_WDOG))
  94. # Use translation tables library v1 if using Cortex-A5
  95. ifdef ARM_CORTEX_A5
  96. ARM_XLAT_TABLES_LIB_V1 := 1
  97. else
  98. ARM_XLAT_TABLES_LIB_V1 := 0
  99. endif
  100. $(eval $(call assert_boolean,ARM_XLAT_TABLES_LIB_V1))
  101. $(eval $(call add_define,ARM_XLAT_TABLES_LIB_V1))
  102. ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1)
  103. # Only use nonlpae version of xlatv1 otherwise use xlat v2
  104. PLAT_BL_COMMON_SOURCES += lib/xlat_tables/${ARCH}/nonlpae_tables.c
  105. else
  106. include lib/xlat_tables_v2/xlat_tables.mk
  107. PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS}
  108. endif
  109. # Firmware Configuration Framework sources
  110. include lib/fconf/fconf.mk
  111. BL1_SOURCES += ${FCONF_SOURCES} ${FCONF_DYN_SOURCES}
  112. BL2_SOURCES += ${FCONF_SOURCES} ${FCONF_DYN_SOURCES}
  113. # Add `libfdt` and Arm common helpers required for Dynamic Config
  114. include lib/libfdt/libfdt.mk
  115. DYN_CFG_SOURCES += plat/arm/common/arm_dyn_cfg.c \
  116. plat/arm/common/arm_dyn_cfg_helpers.c
  117. DYN_CFG_SOURCES += ${FDT_WRAPPERS_SOURCES}