build.mk 1.91 KB
Newer Older
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
65
66
67
#
# Copyright (c) 2020, MediaTek Inc. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#

# Enable or disable spm feature
MT_SPM_FEATURE_SUPPORT = yes

# Enable or disable cirq restore
MT_SPM_CIRQ_FEATURE_SUPPORT = yes

# sspm notifier support
MT_SPM_SSPM_NOTIFIER_SUPPORT = yes

CUR_SPM_FOLDER = ${MTK_PLAT_SOC}/drivers/spm

# spm common files
PLAT_SPM_SOURCE_FILES_COMMON +=			\
	${CUR_SPM_FOLDER}/mt_spm.c		\
	${CUR_SPM_FOLDER}/mt_spm_conservation.c	\
	${CUR_SPM_FOLDER}/mt_spm_internal.c	\
	${CUR_SPM_FOLDER}/mt_spm_pmic_wrap.c

# spm platform dependcy files
PLAT_SPM_SOURCE_FILES +=					\
	${CUR_SPM_FOLDER}/constraints/mt_spm_rc_bus26m.c	\
	${CUR_SPM_FOLDER}/constraints/mt_spm_rc_cpu_buck_ldo.c	\
	${CUR_SPM_FOLDER}/constraints/mt_spm_rc_dram.c		\
	${CUR_SPM_FOLDER}/constraints/mt_spm_rc_syspll.c	\
	${CUR_SPM_FOLDER}/mt_spm_cond.c				\
	${CUR_SPM_FOLDER}/mt_spm_suspend.c			\
	${CUR_SPM_FOLDER}/mt_spm_idle.c

ifeq (${MT_SPM_FEATURE_SUPPORT}, no)
PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_UNSUPPORT
BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += ${PLAT_SPM_SOURCE_FILES_COMMON}
else
BL31_MT_LPM_PLAT_SPM_SOURCE_FILES +=	\
	${PLAT_SPM_SOURCE_FILES_COMMON} \
	${PLAT_SPM_SOURCE_FILES}
endif

ifeq (${MT_SPM_CIRQ_FEATURE_SUPPORT}, no)
PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_CIRQ_UNSUPPORT
endif

ifeq (${MT_SPM_SSPM_NOTIFIER_SUPPORT}, no)
PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_SSPM_NOTIFIER_UNSUPPORT
else
BL31_MT_LPM_PLAT_SPM_SOURCE_FILES +=	\
	${CUR_SPM_FOLDER}/notifier/mt_spm_sspm_notifier.c
endif

$(info --------------------------------------)
$(info SPM build flags: ${PLAT_SPM_DEBUG_CFLAGS})
$(info SPM build files: ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES})
$(info --------------------------------------)

# Common makefile for platform.mk
PLAT_INCLUDES +=				\
	${PLAT_SPM_DEBUG_CFLAGS}		\
	-I${CUR_SPM_FOLDER}/			\
	-I${CUR_SPM_FOLDER}/constraints/	\
	-I${CUR_SPM_FOLDER}/notifier/

PLAT_BL_COMMON_SOURCES += ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES}