platform.mk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.
  2. # Copyright (c) 2022-2024, Advanced Micro Devices, Inc. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. override PROGRAMMABLE_RESET_ADDRESS := 1
  6. PSCI_EXTENDED_STATE_ID := 1
  7. A53_DISABLE_NON_TEMPORAL_HINT := 0
  8. SEPARATE_CODE_AND_RODATA := 1
  9. override RESET_TO_BL31 := 1
  10. PL011_GENERIC_UART := 1
  11. IPI_CRC_CHECK := 0
  12. HARDEN_SLS_ALL := 0
  13. CPU_PWRDWN_SGI ?= 6
  14. $(eval $(call add_define_val,CPU_PWR_DOWN_REQ_INTR,ARM_IRQ_SEC_SGI_${CPU_PWRDWN_SGI}))
  15. # A72 Erratum for SoC
  16. ERRATA_A72_859971 := 1
  17. ERRATA_A72_1319367 := 1
  18. ifdef VERSAL_ATF_MEM_BASE
  19. $(eval $(call add_define,VERSAL_ATF_MEM_BASE))
  20. ifndef VERSAL_ATF_MEM_SIZE
  21. $(error "VERSAL_ATF_MEM_BASE defined without VERSAL_ATF_MEM_SIZE")
  22. endif
  23. $(eval $(call add_define,VERSAL_ATF_MEM_SIZE))
  24. ifdef VERSAL_ATF_MEM_PROGBITS_SIZE
  25. $(eval $(call add_define,VERSAL_ATF_MEM_PROGBITS_SIZE))
  26. endif
  27. endif
  28. ifdef VERSAL_BL32_MEM_BASE
  29. $(eval $(call add_define,VERSAL_BL32_MEM_BASE))
  30. ifndef VERSAL_BL32_MEM_SIZE
  31. $(error "VERSAL_BL32_MEM_BASE defined without VERSAL_BL32_MEM_SIZE")
  32. endif
  33. $(eval $(call add_define,VERSAL_BL32_MEM_SIZE))
  34. endif
  35. ifdef IPI_CRC_CHECK
  36. $(eval $(call add_define,IPI_CRC_CHECK))
  37. endif
  38. ifdef VERSAL_PLATFORM
  39. $(warning "VERSAL_PLATFORM has been deprecated")
  40. endif
  41. ifdef XILINX_OF_BOARD_DTB_ADDR
  42. $(eval $(call add_define,XILINX_OF_BOARD_DTB_ADDR))
  43. endif
  44. PLAT_XLAT_TABLES_DYNAMIC := 0
  45. ifeq (${PLAT_XLAT_TABLES_DYNAMIC},1)
  46. $(eval $(call add_define,PLAT_XLAT_TABLES_DYNAMIC))
  47. endif
  48. # enable assert() for release/debug builds
  49. ENABLE_ASSERTIONS := 1
  50. PLAT_INCLUDES := -Iinclude/plat/arm/common/ \
  51. -Iplat/xilinx/common/include/ \
  52. -Iplat/xilinx/common/ipi_mailbox_service/ \
  53. -Iplat/xilinx/versal/include/ \
  54. -Iplat/xilinx/versal/pm_service/
  55. include lib/libfdt/libfdt.mk
  56. # Include GICv3 driver files
  57. include drivers/arm/gic/v3/gicv3.mk
  58. include lib/xlat_tables_v2/xlat_tables.mk
  59. PLAT_BL_COMMON_SOURCES := drivers/arm/dcc/dcc_console.c \
  60. drivers/delay_timer/delay_timer.c \
  61. drivers/delay_timer/generic_delay_timer.c \
  62. ${GICV3_SOURCES} \
  63. drivers/arm/pl011/aarch64/pl011_console.S \
  64. plat/common/aarch64/crash_console_helpers.S \
  65. plat/arm/common/arm_cci.c \
  66. plat/arm/common/arm_common.c \
  67. plat/common/plat_gicv3.c \
  68. plat/xilinx/versal/aarch64/versal_helpers.S \
  69. plat/xilinx/versal/aarch64/versal_common.c \
  70. ${XLAT_TABLES_LIB_SRCS}
  71. VERSAL_CONSOLE ?= pl011
  72. ifeq (${VERSAL_CONSOLE}, $(filter ${VERSAL_CONSOLE},pl011 pl011_0 pl011_1 dcc dtb none))
  73. else
  74. $(error "Please define VERSAL_CONSOLE")
  75. endif
  76. $(eval $(call add_define_val,VERSAL_CONSOLE,VERSAL_CONSOLE_ID_${VERSAL_CONSOLE}))
  77. # Runtime console in default console in DEBUG build
  78. ifeq ($(DEBUG), 1)
  79. CONSOLE_RUNTIME ?= pl011
  80. endif
  81. # Runtime console
  82. ifdef CONSOLE_RUNTIME
  83. ifeq (${CONSOLE_RUNTIME}, $(filter ${CONSOLE_RUNTIME},pl011 pl011_0 pl011_1 dcc dtb))
  84. $(eval $(call add_define_val,CONSOLE_RUNTIME,RT_CONSOLE_ID_${CONSOLE_RUNTIME}))
  85. else
  86. $(error "Please define CONSOLE_RUNTIME")
  87. endif
  88. endif
  89. BL31_SOURCES += drivers/arm/cci/cci.c \
  90. lib/cpus/aarch64/cortex_a72.S \
  91. common/fdt_wrappers.c \
  92. plat/common/plat_psci_common.c \
  93. plat/xilinx/common/ipi.c \
  94. plat/xilinx/common/plat_fdt.c \
  95. plat/xilinx/common/plat_console.c \
  96. plat/xilinx/common/plat_clkfunc.c \
  97. plat/xilinx/common/plat_startup.c \
  98. plat/xilinx/common/ipi_mailbox_service/ipi_mailbox_svc.c \
  99. plat/xilinx/common/pm_service/pm_ipi.c \
  100. plat/xilinx/common/pm_service/pm_api_sys.c \
  101. plat/xilinx/common/pm_service/pm_svc_main.c \
  102. plat/xilinx/common/versal.c \
  103. plat/xilinx/versal/bl31_versal_setup.c \
  104. plat/xilinx/versal/plat_psci.c \
  105. plat/xilinx/versal/plat_versal.c \
  106. plat/xilinx/versal/plat_topology.c \
  107. plat/xilinx/versal/sip_svc_setup.c \
  108. plat/xilinx/versal/versal_gicv3.c \
  109. plat/xilinx/versal/versal_ipi.c \
  110. plat/xilinx/versal/pm_service/pm_client.c \
  111. common/fdt_fixup.c \
  112. ${LIBFDT_SRCS}
  113. ifeq ($(HARDEN_SLS_ALL), 1)
  114. TF_CFLAGS_aarch64 += -mharden-sls=all
  115. endif
  116. ifeq (${ERRATA_ABI_SUPPORT}, 1)
  117. # enable the cpu macros for errata abi interface
  118. CORTEX_A72_H_INC := 1
  119. $(eval $(call add_define, CORTEX_A72_H_INC))
  120. endif