build.mk 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #
  2. # Copyright (c) 2022, MediaTek Inc. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. # Enable or disable spm feature
  7. MT_SPM_FEATURE_SUPPORT=yes
  8. # Enable or disable cirq restore
  9. MT_SPM_CIRQ_FEATURE_SUPPORT=yes
  10. # sspm notifier support
  11. MT_SPM_SSPM_NOTIFIER_SUPPORT=yes
  12. CUR_SPM_FOLDER = ${MTK_PLAT_SOC}/drivers/spm
  13. # spm common files
  14. PLAT_SPM_SOURCE_FILES_COMMON += \
  15. ${CUR_SPM_FOLDER}/mt_spm.c \
  16. ${CUR_SPM_FOLDER}/mt_spm_internal.c \
  17. ${CUR_SPM_FOLDER}/mt_spm_pmic_wrap.c \
  18. ${CUR_SPM_FOLDER}/mt_spm_vcorefs.c \
  19. ${CUR_SPM_FOLDER}/mt_spm_conservation.c \
  20. ${CUR_SPM_FOLDER}/mt_spm_extern.c
  21. # spm platform dependcy files
  22. PLAT_SPM_SOURCE_FILES += \
  23. ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_syspll.c \
  24. ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_bus26m.c \
  25. ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_cpu_buck_ldo.c \
  26. ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_dram.c \
  27. ${CUR_SPM_FOLDER}/mt_spm_cond.c \
  28. ${CUR_SPM_FOLDER}/mt_spm_suspend.c \
  29. ${CUR_SPM_FOLDER}/mt_spm_idle.c
  30. ifeq (${MT_SPM_FEATURE_SUPPORT}, no)
  31. PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_UNSUPPORT
  32. BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += ${PLAT_SPM_SOURCE_FILES_COMMON}
  33. else
  34. BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += \
  35. ${PLAT_SPM_SOURCE_FILES_COMMON} \
  36. ${PLAT_SPM_SOURCE_FILES}
  37. endif
  38. ifeq (${MT_SPM_CIRQ_FEATURE_SUPPORT}, no)
  39. PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_CIRQ_UNSUPPORT
  40. endif
  41. ifeq (${MT_SPM_SSPM_NOTIFIER_SUPPORT}, no)
  42. PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_SSPM_NOTIFIER_UNSUPPORT
  43. else
  44. BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += ${CUR_SPM_FOLDER}/notifier/mt_spm_sspm_notifier.c
  45. endif
  46. ifeq (${MTK_VOLTAGE_BIN_VCORE}, yes)
  47. PLAT_SPM_DEBUG_CFLAGS += -DATF_VOLTAGE_BIN_VCORE_SUPPORT
  48. endif
  49. ifeq ($(MTK_SPM_EXTENSION_CONFIG), pmic6362)
  50. MTK_SPM_EXTENSION_PMIC_CONTROL := 6362
  51. $(eval $(call add_define,MTK_SPM_EXTENSION_PMIC_CONTROL))
  52. endif
  53. $(info --------------------------------------)
  54. $(info SPM build flags: ${PLAT_SPM_DEBUG_CFLAGS})
  55. $(info SPM build files: ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES})
  56. $(info --------------------------------------)
  57. # Common makefile for platform.mk
  58. PLAT_INCLUDES += \
  59. ${PLAT_SPM_DEBUG_CFLAGS} \
  60. -I${CUR_SPM_FOLDER}/ \
  61. -I${CUR_SPM_FOLDER}/constraints/ \
  62. -I${CUR_SPM_FOLDER}/notifier/
  63. PLAT_BL_COMMON_SOURCES += ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES}