platform.mk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # Copyright (c) 2018-2022, Arm Limited and Contributors. All rights reserved.
  2. # Copyright (c) 2021-2022, Xilinx, Inc. All rights reserved.
  3. # Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
  4. #
  5. # SPDX-License-Identifier: BSD-3-Clause
  6. PLAT_PATH := plat/xilinx/versal_net
  7. # A78 Erratum for SoC
  8. ERRATA_A78_AE_1941500 := 1
  9. ERRATA_A78_AE_1951502 := 1
  10. ERRATA_A78_AE_2376748 := 1
  11. ERRATA_A78_AE_2395408 := 1
  12. override PROGRAMMABLE_RESET_ADDRESS := 1
  13. PSCI_EXTENDED_STATE_ID := 1
  14. SEPARATE_CODE_AND_RODATA := 1
  15. override RESET_TO_BL31 := 1
  16. PL011_GENERIC_UART := 1
  17. IPI_CRC_CHECK := 0
  18. GIC_ENABLE_V4_EXTN := 0
  19. GICV3_SUPPORT_GIC600 := 1
  20. TFA_NO_PM := 0
  21. CPU_PWRDWN_SGI ?= 6
  22. $(eval $(call add_define_val,CPU_PWR_DOWN_REQ_INTR,ARM_IRQ_SEC_SGI_${CPU_PWRDWN_SGI}))
  23. override CTX_INCLUDE_AARCH32_REGS := 0
  24. ifdef TFA_NO_PM
  25. $(eval $(call add_define,TFA_NO_PM))
  26. endif
  27. ifdef VERSAL_NET_ATF_MEM_BASE
  28. $(eval $(call add_define,VERSAL_NET_ATF_MEM_BASE))
  29. ifndef VERSAL_NET_ATF_MEM_SIZE
  30. $(error "VERSAL_NET_ATF_MEM_BASE defined without VERSAL_NET_ATF_MEM_SIZE")
  31. endif
  32. $(eval $(call add_define,VERSAL_NET_ATF_MEM_SIZE))
  33. ifdef VERSAL_NET_ATF_MEM_PROGBITS_SIZE
  34. $(eval $(call add_define,VERSAL_NET_ATF_MEM_PROGBITS_SIZE))
  35. endif
  36. endif
  37. ifdef VERSAL_NET_BL32_MEM_BASE
  38. $(eval $(call add_define,VERSAL_NET_BL32_MEM_BASE))
  39. ifndef VERSAL_NET_BL32_MEM_SIZE
  40. $(error "VERSAL_NET_BL32_MEM_BASE defined without VERSAL_NET_BL32_MEM_SIZE")
  41. endif
  42. $(eval $(call add_define,VERSAL_NET_BL32_MEM_SIZE))
  43. endif
  44. ifdef IPI_CRC_CHECK
  45. $(eval $(call add_define,IPI_CRC_CHECK))
  46. endif
  47. USE_COHERENT_MEM := 0
  48. HW_ASSISTED_COHERENCY := 1
  49. VERSAL_NET_CONSOLE ?= pl011
  50. ifeq (${VERSAL_NET_CONSOLE}, $(filter ${VERSAL_NET_CONSOLE},pl011 pl011_0 pl011_1 dcc dtb none))
  51. else
  52. $(error Please define VERSAL_NET_CONSOLE)
  53. endif
  54. $(eval $(call add_define_val,VERSAL_NET_CONSOLE,VERSAL_NET_CONSOLE_ID_${VERSAL_NET_CONSOLE}))
  55. ifdef XILINX_OF_BOARD_DTB_ADDR
  56. $(eval $(call add_define,XILINX_OF_BOARD_DTB_ADDR))
  57. endif
  58. # Runtime console in default console in DEBUG build
  59. ifeq ($(DEBUG), 1)
  60. CONSOLE_RUNTIME ?= pl011
  61. endif
  62. # Runtime console
  63. ifdef CONSOLE_RUNTIME
  64. ifeq (${CONSOLE_RUNTIME}, $(filter ${CONSOLE_RUNTIME},pl011 pl011_0 pl011_1 dcc dtb))
  65. $(eval $(call add_define_val,CONSOLE_RUNTIME,RT_CONSOLE_ID_${CONSOLE_RUNTIME}))
  66. else
  67. $(error "Please define CONSOLE_RUNTIME")
  68. endif
  69. endif
  70. # enable assert() for release/debug builds
  71. ENABLE_ASSERTIONS := 1
  72. PLAT_INCLUDES := -Iinclude/plat/arm/common/ \
  73. -Iplat/xilinx/common/include/ \
  74. -Iplat/xilinx/common/ipi_mailbox_service/ \
  75. -I${PLAT_PATH}/include/ \
  76. -Iplat/xilinx/versal/pm_service/
  77. # Include GICv3 driver files
  78. include drivers/arm/gic/v3/gicv3.mk
  79. include lib/xlat_tables_v2/xlat_tables.mk
  80. include lib/libfdt/libfdt.mk
  81. PLAT_BL_COMMON_SOURCES := \
  82. drivers/arm/dcc/dcc_console.c \
  83. drivers/delay_timer/delay_timer.c \
  84. drivers/delay_timer/generic_delay_timer.c \
  85. ${GICV3_SOURCES} \
  86. drivers/arm/pl011/aarch64/pl011_console.S \
  87. plat/common/aarch64/crash_console_helpers.S \
  88. plat/arm/common/arm_common.c \
  89. plat/common/plat_gicv3.c \
  90. ${PLAT_PATH}/aarch64/versal_net_helpers.S \
  91. ${PLAT_PATH}/aarch64/versal_net_common.c \
  92. ${PLAT_PATH}/plat_topology.c \
  93. ${XLAT_TABLES_LIB_SRCS}
  94. BL31_SOURCES += drivers/arm/cci/cci.c \
  95. lib/cpus/aarch64/cortex_a78_ae.S \
  96. lib/cpus/aarch64/cortex_a78.S \
  97. plat/common/plat_psci_common.c
  98. ifeq ($(TFA_NO_PM), 0)
  99. BL31_SOURCES += plat/xilinx/common/pm_service/pm_api_sys.c \
  100. plat/xilinx/common/pm_service/pm_ipi.c \
  101. ${PLAT_PATH}/plat_psci_pm.c \
  102. plat/xilinx/common/pm_service/pm_svc_main.c \
  103. ${PLAT_PATH}/pm_service/pm_client.c \
  104. ${PLAT_PATH}/versal_net_ipi.c
  105. else
  106. BL31_SOURCES += ${PLAT_PATH}/plat_psci.c
  107. endif
  108. BL31_SOURCES += plat/xilinx/common/plat_fdt.c \
  109. plat/xilinx/common/plat_startup.c \
  110. plat/xilinx/common/plat_console.c \
  111. plat/xilinx/common/plat_clkfunc.c \
  112. plat/xilinx/common/ipi.c \
  113. plat/xilinx/common/ipi_mailbox_service/ipi_mailbox_svc.c \
  114. plat/xilinx/common/versal.c \
  115. ${PLAT_PATH}/bl31_versal_net_setup.c \
  116. common/fdt_fixup.c \
  117. common/fdt_wrappers.c \
  118. plat/arm/common/arm_gicv3.c \
  119. ${LIBFDT_SRCS} \
  120. ${PLAT_PATH}/sip_svc_setup.c \
  121. ${XLAT_TABLES_LIB_SRCS}