build.mk 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #
  2. # Copyright (c) 2020, 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_conservation.c \
  17. ${CUR_SPM_FOLDER}/mt_spm_internal.c \
  18. ${CUR_SPM_FOLDER}/mt_spm_pmic_wrap.c \
  19. ${CUR_SPM_FOLDER}/mt_spm_vcorefs.c
  20. # spm platform dependcy files
  21. PLAT_SPM_SOURCE_FILES += \
  22. ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_bus26m.c \
  23. ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_cpu_buck_ldo.c \
  24. ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_dram.c \
  25. ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_syspll.c \
  26. ${CUR_SPM_FOLDER}/mt_spm_cond.c \
  27. ${CUR_SPM_FOLDER}/mt_spm_suspend.c \
  28. ${CUR_SPM_FOLDER}/mt_spm_idle.c
  29. ifeq (${MT_SPM_FEATURE_SUPPORT}, no)
  30. PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_UNSUPPORT
  31. BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += ${PLAT_SPM_SOURCE_FILES_COMMON}
  32. else
  33. BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += \
  34. ${PLAT_SPM_SOURCE_FILES_COMMON} \
  35. ${PLAT_SPM_SOURCE_FILES}
  36. endif
  37. ifeq (${MT_SPM_CIRQ_FEATURE_SUPPORT}, no)
  38. PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_CIRQ_UNSUPPORT
  39. endif
  40. ifeq (${MT_SPM_SSPM_NOTIFIER_SUPPORT}, no)
  41. PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_SSPM_NOTIFIER_UNSUPPORT
  42. else
  43. BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += \
  44. ${CUR_SPM_FOLDER}/notifier/mt_spm_sspm_notifier.c
  45. endif
  46. $(info --------------------------------------)
  47. $(info SPM build flags: ${PLAT_SPM_DEBUG_CFLAGS})
  48. $(info SPM build files: ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES})
  49. $(info --------------------------------------)
  50. # Common makefile for platform.mk
  51. PLAT_INCLUDES += \
  52. ${PLAT_SPM_DEBUG_CFLAGS} \
  53. -I${CUR_SPM_FOLDER}/ \
  54. -I${CUR_SPM_FOLDER}/constraints/ \
  55. -I${CUR_SPM_FOLDER}/notifier/
  56. PLAT_BL_COMMON_SOURCES += ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES}