platform.mk 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #
  2. # Copyright (c) 2018-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. # Verify build config
  57. # -------------------
  58. ifneq (${RESET_TO_BL31}, 0)
  59. $(error Error: ${PLAT} needs RESET_TO_BL31=0)
  60. endif
  61. ifeq (${ARCH},aarch32)
  62. $(error Error: AArch32 not supported on ${PLAT})
  63. endif
  64. all: ${BUILD_PLAT}/bl31.img
  65. distclean realclean clean: cleanimage
  66. cleanimage:
  67. $(q)${MAKE} -C ${DOIMAGEPATH} clean
  68. ${DOIMAGETOOL}:
  69. $(q)${MAKE} -C ${DOIMAGEPATH}
  70. ${BUILD_PLAT}/bl31.img: ${BUILD_PLAT}/bl31.bin ${DOIMAGETOOL}
  71. ${DOIMAGETOOL} ${BUILD_PLAT}/bl31.bin ${BUILD_PLAT}/bl31.img