platform.mk 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #
  2. # Copyright (c) 2020-2024, Arm Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. include lib/xlat_tables_v2/xlat_tables.mk
  7. AML_PLAT := plat/amlogic
  8. AML_PLAT_SOC := ${AML_PLAT}/${PLAT}
  9. AML_PLAT_COMMON := ${AML_PLAT}/common
  10. DOIMAGEPATH ?= tools/amlogic
  11. DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage
  12. PLAT_INCLUDES := -Iinclude/drivers/amlogic/ \
  13. -I${AML_PLAT_SOC}/include \
  14. -I${AML_PLAT_COMMON}/include
  15. GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
  16. drivers/arm/gic/v2/gicv2_main.c \
  17. drivers/arm/gic/v2/gicv2_helpers.c \
  18. plat/common/plat_gicv2.c
  19. BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \
  20. plat/common/plat_psci_common.c \
  21. drivers/amlogic/console/aarch64/meson_console.S \
  22. ${AML_PLAT_SOC}/${PLAT}_bl31_setup.c \
  23. ${AML_PLAT_SOC}/${PLAT}_pm.c \
  24. ${AML_PLAT_SOC}/${PLAT}_common.c \
  25. ${AML_PLAT_COMMON}/aarch64/aml_helpers.S \
  26. ${AML_PLAT_COMMON}/aml_efuse.c \
  27. ${AML_PLAT_COMMON}/aml_mhu.c \
  28. ${AML_PLAT_COMMON}/aml_scpi.c \
  29. ${AML_PLAT_COMMON}/aml_sip_svc.c \
  30. ${AML_PLAT_COMMON}/aml_thermal.c \
  31. ${AML_PLAT_COMMON}/aml_topology.c \
  32. ${AML_PLAT_COMMON}/aml_console.c \
  33. drivers/amlogic/crypto/sha_dma.c \
  34. ${XLAT_TABLES_LIB_SRCS} \
  35. ${GIC_SOURCES}
  36. # Tune compiler for Cortex-A53
  37. ifeq ($($(ARCH)-cc-id),arm-clang)
  38. TF_CFLAGS_aarch64 += -mcpu=cortex-a53
  39. else ifneq ($(filter %-clang,$($(ARCH)-cc-id)),)
  40. TF_CFLAGS_aarch64 += -mcpu=cortex-a53
  41. else
  42. TF_CFLAGS_aarch64 += -mtune=cortex-a53
  43. endif
  44. # Build config flags
  45. # ------------------
  46. # Enable all errata workarounds for Cortex-A53
  47. ERRATA_A53_855873 := 1
  48. ERRATA_A53_819472 := 1
  49. ERRATA_A53_824069 := 1
  50. ERRATA_A53_827319 := 1
  51. WORKAROUND_CVE_2017_5715 := 0
  52. # Have different sections for code and rodata
  53. SEPARATE_CODE_AND_RODATA := 1
  54. # Use Coherent memory
  55. USE_COHERENT_MEM := 1
  56. AML_USE_ATOS := 0
  57. $(eval $(call assert_boolean,AML_USE_ATOS))
  58. $(eval $(call add_define,AML_USE_ATOS))
  59. # Verify build config
  60. # -------------------
  61. ifneq (${RESET_TO_BL31}, 0)
  62. $(error Error: ${PLAT} needs RESET_TO_BL31=0)
  63. endif
  64. ifeq (${ARCH},aarch32)
  65. $(error Error: AArch32 not supported on ${PLAT})
  66. endif
  67. all: ${BUILD_PLAT}/bl31.img
  68. distclean realclean clean: cleanimage
  69. cleanimage:
  70. $(q)${MAKE} -C ${DOIMAGEPATH} clean
  71. ${DOIMAGETOOL}:
  72. $(q)${MAKE} -C ${DOIMAGEPATH}
  73. ${BUILD_PLAT}/bl31.img: ${BUILD_PLAT}/bl31.bin ${DOIMAGETOOL}
  74. ${DOIMAGETOOL} ${BUILD_PLAT}/bl31.bin ${BUILD_PLAT}/bl31.img