summaryrefslogtreecommitdiffstats
path: root/plat/mediatek/drivers/spm/mt8188/rules.mk
blob: a04e91fcaa2ff63045306588ee4632c5be187484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# Copyright (c) 2023, MediaTek Inc. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

LOCAL_DIR := $(call GET_LOCAL_DIR)
MODULE := spm_${MTK_SOC}

define GET_UPPER_DIR
$(shell dirname ${LOCAL_DIR})
endef
UPPER_DIR := $(call GET_UPPER_DIR)

MT_SPM_FEATURE_SUPPORT := y
MT_SPM_CIRQ_FEATURE_SUPPORT := n
MT_SPMFW_SPM_SRAM_SLEEP_SUPPORT := n
MT_SPM_SSPM_NOTIFIER_SUPPORT := y
MT_SPM_UART_SUSPEND_SUPPORT := n
MT_SPM_RGU_SUPPORT := n

LOCAL_SRCS-y := ${LOCAL_DIR}/mt_spm.c
LOCAL_SRCS-y += ${LOCAL_DIR}/mt_spm_conservation.c
LOCAL_SRCS-y += ${LOCAL_DIR}/mt_spm_internal.c
LOCAL_SRCS-y += ${LOCAL_DIR}/mt_spm_pmic_wrap.c
LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/mt_spm_cond.c
LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/mt_spm_idle.c
LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/mt_spm_suspend.c
LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_api.c
LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_bus26m.c
LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_cpu_buck_ldo.c
LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_dram.c
LOCAL_SRCS-${MT_SPM_FEATURE_SUPPORT} += ${LOCAL_DIR}/constraints/mt_spm_rc_syspll.c
LOCAL_SRCS-${MT_SPM_SSPM_NOTIFIER_SUPPORT} += ${UPPER_DIR}/version/notifier/v1/mt_spm_sspm_notifier.c

ifeq (${MT_SPM_FEATURE_SUPPORT},n)
$(eval $(call add_define,MTK_PLAT_SPM_UNSUPPORT))
endif

ifeq (${MT_SPM_CIRQ_FEATURE_SUPPORT},n)
$(eval $(call add_define,MTK_PLAT_CIRQ_UNSUPPORT))
endif

ifeq (${MT_SPMFW_SPM_SRAM_SLEEP_SUPPORT},n)
$(eval $(call add_define,MTK_PLAT_SPM_SRAM_SLP_UNSUPPORT))
endif

ifeq (${MT_SPM_SSPM_NOTIFIER_SUPPORT},n)
$(eval $(call add_define,MTK_PLAT_SPM_SSPM_NOTIFIER_UNSUPPORT))
endif

ifeq (${MT_SPM_UART_SUSPEND_SUPPORT},n)
$(eval $(call add_define,MTK_PLAT_SPM_UART_UNSUPPORT))
endif

ifeq ($(MTK_VOLTAGE_BIN_VCORE),y)
$(eval $(call add_define,MTK_VOLTAGE_BIN_VCORE_SUPPORT))
endif

ifeq ($(MT_SPM_RGU_SUPPORT),n)
$(eval $(call add_define,MTK_PLAT_SPM_RGU_UNSUPPORT))
endif

$(eval $(call MAKE_MODULE,$(MODULE),$(LOCAL_SRCS-y),$(MTK_BL)))