rules.mk 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #
  2. # Copyright (c) 2023, MediaTek Inc. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. LOCAL_DIR := $(call GET_LOCAL_DIR)
  7. MODULE := spm_${MTK_SOC}
  8. define GET_UPPER_DIR
  9. $(shell dirname ${LOCAL_DIR})
  10. endef
  11. UPPER_DIR := $(call GET_UPPER_DIR)
  12. MT_SPM_FEATURE_SUPPORT := y
  13. MT_SPM_CIRQ_FEATURE_SUPPORT := n
  14. MT_SPMFW_SPM_SRAM_SLEEP_SUPPORT := n
  15. MT_SPM_SSPM_NOTIFIER_SUPPORT := y
  16. MT_SPM_UART_SUSPEND_SUPPORT := n
  17. MT_SPM_RGU_SUPPORT := n
  18. LOCAL_SRCS-y := ${LOCAL_DIR}/mt_spm.c
  19. LOCAL_SRCS-y += ${LOCAL_DIR}/mt_spm_conservation.c
  20. LOCAL_SRCS-y += ${LOCAL_DIR}/mt_spm_internal.c
  21. LOCAL_SRCS-y += ${LOCAL_DIR}/mt_spm_pmic_wrap.c
  22. LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/mt_spm_cond.c
  23. LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/mt_spm_idle.c
  24. LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/mt_spm_suspend.c
  25. LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_api.c
  26. LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_bus26m.c
  27. LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_cpu_buck_ldo.c
  28. LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_dram.c
  29. LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_syspll.c
  30. LOCAL_SRCS-${MT_SPM_SSPM_NOTIFIER_SUPPORT} += ${UPPER_DIR}/version/notifier/v1/mt_spm_sspm_notifier.c
  31. ifeq (${MT_SPM_FEATURE_SUPPORT},n)
  32. $(eval $(call add_define,MTK_PLAT_SPM_UNSUPPORT))
  33. endif
  34. ifeq (${MT_SPM_CIRQ_FEATURE_SUPPORT},n)
  35. $(eval $(call add_define,MTK_PLAT_CIRQ_UNSUPPORT))
  36. endif
  37. ifeq (${MT_SPMFW_SPM_SRAM_SLEEP_SUPPORT},n)
  38. $(eval $(call add_define,MTK_PLAT_SPM_SRAM_SLP_UNSUPPORT))
  39. endif
  40. ifeq (${MT_SPM_SSPM_NOTIFIER_SUPPORT},n)
  41. $(eval $(call add_define,MTK_PLAT_SPM_SSPM_NOTIFIER_UNSUPPORT))
  42. endif
  43. ifeq (${MT_SPM_UART_SUSPEND_SUPPORT},n)
  44. $(eval $(call add_define,MTK_PLAT_SPM_UART_UNSUPPORT))
  45. endif
  46. ifeq ($(MTK_VOLTAGE_BIN_VCORE),y)
  47. $(eval $(call add_define,MTK_VOLTAGE_BIN_VCORE_SUPPORT))
  48. endif
  49. ifeq ($(MT_SPM_RGU_SUPPORT),n)
  50. $(eval $(call add_define,MTK_PLAT_SPM_RGU_UNSUPPORT))
  51. endif
  52. $(eval $(call MAKE_MODULE,$(MODULE),$(LOCAL_SRCS-y),$(MTK_BL)))