blob: 4153603540926b78cb682726711ab248f21ac8dd [file] [log] [blame]
developer5f735162021-01-04 00:02:34 +08001#
2# Copyright (c) 2020, MediaTek Inc. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# Enable or disable spm feature
8MT_SPM_FEATURE_SUPPORT = yes
9
10# Enable or disable cirq restore
11MT_SPM_CIRQ_FEATURE_SUPPORT = yes
12
13# sspm notifier support
14MT_SPM_SSPM_NOTIFIER_SUPPORT = yes
15
16CUR_SPM_FOLDER = ${MTK_PLAT_SOC}/drivers/spm
17
18# spm common files
19PLAT_SPM_SOURCE_FILES_COMMON += \
20 ${CUR_SPM_FOLDER}/mt_spm.c \
21 ${CUR_SPM_FOLDER}/mt_spm_conservation.c \
22 ${CUR_SPM_FOLDER}/mt_spm_internal.c \
developerafa342e2020-12-14 17:41:08 +080023 ${CUR_SPM_FOLDER}/mt_spm_pmic_wrap.c \
24 ${CUR_SPM_FOLDER}/mt_spm_vcorefs.c
developer5f735162021-01-04 00:02:34 +080025
26# spm platform dependcy files
27PLAT_SPM_SOURCE_FILES += \
28 ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_bus26m.c \
29 ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_cpu_buck_ldo.c \
30 ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_dram.c \
31 ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_syspll.c \
32 ${CUR_SPM_FOLDER}/mt_spm_cond.c \
33 ${CUR_SPM_FOLDER}/mt_spm_suspend.c \
34 ${CUR_SPM_FOLDER}/mt_spm_idle.c
35
36ifeq (${MT_SPM_FEATURE_SUPPORT}, no)
37PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_UNSUPPORT
38BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += ${PLAT_SPM_SOURCE_FILES_COMMON}
39else
40BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += \
41 ${PLAT_SPM_SOURCE_FILES_COMMON} \
42 ${PLAT_SPM_SOURCE_FILES}
43endif
44
45ifeq (${MT_SPM_CIRQ_FEATURE_SUPPORT}, no)
46PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_CIRQ_UNSUPPORT
47endif
48
49ifeq (${MT_SPM_SSPM_NOTIFIER_SUPPORT}, no)
50PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_SSPM_NOTIFIER_UNSUPPORT
51else
52BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += \
53 ${CUR_SPM_FOLDER}/notifier/mt_spm_sspm_notifier.c
54endif
55
56$(info --------------------------------------)
57$(info SPM build flags: ${PLAT_SPM_DEBUG_CFLAGS})
58$(info SPM build files: ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES})
59$(info --------------------------------------)
60
61# Common makefile for platform.mk
62PLAT_INCLUDES += \
63 ${PLAT_SPM_DEBUG_CFLAGS} \
64 -I${CUR_SPM_FOLDER}/ \
65 -I${CUR_SPM_FOLDER}/constraints/ \
66 -I${CUR_SPM_FOLDER}/notifier/
67
68PLAT_BL_COMMON_SOURCES += ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES}