platform.mk 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #
  2. # Copyright (c) 2018-2019, 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. PLAT_INCLUDES := -Iinclude/drivers/amlogic/ \
  11. -I${AML_PLAT_SOC}/include \
  12. -I${AML_PLAT_COMMON}/include
  13. GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
  14. drivers/arm/gic/v2/gicv2_main.c \
  15. drivers/arm/gic/v2/gicv2_helpers.c \
  16. plat/common/plat_gicv2.c
  17. BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \
  18. plat/common/plat_psci_common.c \
  19. drivers/amlogic/console/aarch64/meson_console.S \
  20. ${AML_PLAT_SOC}/${PLAT}_bl31_setup.c \
  21. ${AML_PLAT_SOC}/${PLAT}_pm.c \
  22. ${AML_PLAT_SOC}/${PLAT}_common.c \
  23. ${AML_PLAT_COMMON}/aarch64/aml_helpers.S \
  24. ${AML_PLAT_COMMON}/aml_efuse.c \
  25. ${AML_PLAT_COMMON}/aml_mhu.c \
  26. ${AML_PLAT_COMMON}/aml_scpi.c \
  27. ${AML_PLAT_COMMON}/aml_sip_svc.c \
  28. ${AML_PLAT_COMMON}/aml_thermal.c \
  29. ${AML_PLAT_COMMON}/aml_topology.c \
  30. ${AML_PLAT_COMMON}/aml_console.c \
  31. ${XLAT_TABLES_LIB_SRCS} \
  32. ${GIC_SOURCES}
  33. # Tune compiler for Cortex-A53
  34. ifeq ($(notdir $(CC)),armclang)
  35. TF_CFLAGS_aarch64 += -mcpu=cortex-a53
  36. else ifneq ($(findstring clang,$(notdir $(CC))),)
  37. TF_CFLAGS_aarch64 += -mcpu=cortex-a53
  38. else
  39. TF_CFLAGS_aarch64 += -mtune=cortex-a53
  40. endif
  41. # Build config flags
  42. # ------------------
  43. # Enable all errata workarounds for Cortex-A53
  44. ERRATA_A53_826319 := 1
  45. ERRATA_A53_835769 := 1
  46. ERRATA_A53_836870 := 1
  47. ERRATA_A53_843419 := 1
  48. ERRATA_A53_855873 := 1
  49. WORKAROUND_CVE_2017_5715 := 0
  50. # Have different sections for code and rodata
  51. SEPARATE_CODE_AND_RODATA := 1
  52. # Use Coherent memory
  53. USE_COHERENT_MEM := 1
  54. # Verify build config
  55. # -------------------
  56. ifneq (${RESET_TO_BL31}, 0)
  57. $(error Error: ${PLAT} needs RESET_TO_BL31=0)
  58. endif
  59. ifeq (${ARCH},aarch32)
  60. $(error Error: AArch32 not supported on ${PLAT})
  61. endif