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