platform.mk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #
  2. # Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
  3. # Copyright (c) 2024, The Linux Foundation. All rights reserved.
  4. #
  5. # SPDX-License-Identifier: BSD-3-Clause
  6. #
  7. # Makefile for QCS615 QTI platform.
  8. QTI_PLAT_PATH := plat/qti
  9. CHIPSET := ${PLAT}
  10. # Turn On Separate code & data.
  11. SEPARATE_CODE_AND_RODATA := 1
  12. USE_COHERENT_MEM := 0
  13. WARMBOOT_ENABLE_DCACHE_EARLY := 1
  14. HW_ASSISTED_COHERENCY := 1
  15. # Enable errata configs for cortex_a76 and cortex_a55
  16. # QCS615 CPU core revisions are r1p0
  17. ERRATA_A55_1221012 := 1
  18. ERRATA_A55_1530923 := 1
  19. ERRATA_A76_1073348 := 1
  20. ERRATA_A76_1130799 := 1
  21. ERRATA_A76_1220197 := 1
  22. ERRATA_A76_1257314 := 1
  23. ERRATA_A76_1262606 := 1
  24. ERRATA_A76_1262888 := 1
  25. ERRATA_A76_1275112 := 1
  26. ERRATA_A76_1791580 := 1
  27. ERRATA_A76_1165522 := 1
  28. ERRATA_A76_1868343 := 1
  29. ERRATA_A76_1946160 := 1
  30. ERRATA_A76_2743102 := 1
  31. # Disable the PSCI platform compatibility layer
  32. ENABLE_PLAT_COMPAT := 0
  33. # Enable PSCI v1.0 extended state ID format
  34. PSCI_EXTENDED_STATE_ID := 1
  35. ARM_RECOM_STATE_ID_ENC := 1
  36. PSCI_OS_INIT_MODE := 1
  37. COLD_BOOT_SINGLE_CPU := 1
  38. PROGRAMMABLE_RESET_ADDRESS := 1
  39. RESET_TO_BL31 := 0
  40. QTI_SDI_BUILD := 0
  41. $(eval $(call assert_boolean,QTI_SDI_BUILD))
  42. $(eval $(call add_define,QTI_SDI_BUILD))
  43. #disable CTX_INCLUDE_AARCH32_REGS to support QCS615 gold cores
  44. override CTX_INCLUDE_AARCH32_REGS := 0
  45. # Set dynamic CVE_2018_3639 explicitly as it defaults to 0.
  46. # Others which are applicable: CVE_2017_5715 & CVE_2022_23960 default to 1
  47. DYNAMIC_WORKAROUND_CVE_2018_3639 := 1
  48. # Enable stack protector.
  49. ENABLE_STACK_PROTECTOR := strong
  50. QTI_EXTERNAL_INCLUDES := -I${QTI_PLAT_PATH}/${CHIPSET}/inc \
  51. -I${QTI_PLAT_PATH}/common/inc \
  52. -I${QTI_PLAT_PATH}/common/inc/$(ARCH) \
  53. -I${QTI_PLAT_PATH}/qtiseclib/inc \
  54. -I${QTI_PLAT_PATH}/qtiseclib/inc/${CHIPSET} \
  55. QTI_BL31_SOURCES := $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_helpers.S \
  56. $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_kryo4_silver.S \
  57. $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_kryo4_gold.S \
  58. $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_uart_console.S \
  59. $(QTI_PLAT_PATH)/common/src/pm_ps_hold.c \
  60. $(QTI_PLAT_PATH)/common/src/qti_stack_protector.c \
  61. $(QTI_PLAT_PATH)/common/src/qti_common.c \
  62. $(QTI_PLAT_PATH)/common/src/qti_bl31_setup.c \
  63. $(QTI_PLAT_PATH)/common/src/qti_gic_v3.c \
  64. $(QTI_PLAT_PATH)/common/src/qti_interrupt_svc.c \
  65. $(QTI_PLAT_PATH)/common/src/qti_syscall.c \
  66. $(QTI_PLAT_PATH)/common/src/qti_topology.c \
  67. $(QTI_PLAT_PATH)/common/src/qti_pm.c \
  68. $(QTI_PLAT_PATH)/common/src/qti_rng.c \
  69. $(QTI_PLAT_PATH)/common/src/spmi_arb.c \
  70. $(QTI_PLAT_PATH)/qtiseclib/src/qtiseclib_cb_interface.c \
  71. PLAT_INCLUDES := -Iinclude/plat/common/ \
  72. ${QTI_EXTERNAL_INCLUDES}
  73. include lib/xlat_tables_v2/xlat_tables.mk
  74. PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} \
  75. plat/common/aarch64/crash_console_helpers.S \
  76. common/desc_image_load.c \
  77. lib/bl_aux_params/bl_aux_params.c \
  78. include lib/coreboot/coreboot.mk
  79. #PSCI Sources.
  80. PSCI_SOURCES := plat/common/plat_psci_common.c \
  81. # GIC-600 configuration
  82. GICV3_SUPPORT_GIC600 := 1
  83. # Include GICv3 driver files
  84. include drivers/arm/gic/v3/gicv3.mk
  85. #Timer sources
  86. TIMER_SOURCES := drivers/delay_timer/generic_delay_timer.c \
  87. drivers/delay_timer/delay_timer.c \
  88. #GIC sources.
  89. GIC_SOURCES := plat/common/plat_gicv3.c \
  90. ${GICV3_SOURCES} \
  91. CPU_SOURCES := lib/cpus/aarch64/cortex_a76.S \
  92. lib/cpus/aarch64/cortex_a55.S \
  93. BL31_SOURCES += ${QTI_BL31_SOURCES} \
  94. ${PSCI_SOURCES} \
  95. ${GIC_SOURCES} \
  96. ${TIMER_SOURCES} \
  97. ${CPU_SOURCES} \
  98. LIB_QTI_PATH := ${QTI_PLAT_PATH}/qtiseclib/lib/${CHIPSET}
  99. # Override this on the command line to point to the qtiseclib library which
  100. # will be available in coreboot.org
  101. QTISECLIB_PATH ?=
  102. ifeq ($(QTISECLIB_PATH),)
  103. # if No lib then use stub implementation for qtiseclib interface
  104. $(warning QTISECLIB_PATH is not provided while building, using stub implementation. \
  105. Please refer docs/plat/qti.rst for more details \
  106. THIS FIRMWARE WILL NOT BOOT!)
  107. BL31_SOURCES += plat/qti/qtiseclib/src/qtiseclib_interface_stub.c
  108. else
  109. # use library provided by QTISECLIB_PATH
  110. LDFLAGS += -L $(dir $(QTISECLIB_PATH))
  111. LDLIBS += -l$(patsubst lib%.a,%,$(notdir $(QTISECLIB_PATH)))
  112. endif