jason-ch chen | fa82b9b | 2021-11-16 09:48:20 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2022, MediaTek Inc. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | # Enable or disable spm feature |
| 8 | MT_SPM_FEATURE_SUPPORT=yes |
| 9 | |
| 10 | # Enable or disable cirq restore |
| 11 | MT_SPM_CIRQ_FEATURE_SUPPORT=yes |
| 12 | |
| 13 | # sspm notifier support |
| 14 | MT_SPM_SSPM_NOTIFIER_SUPPORT=yes |
| 15 | |
| 16 | CUR_SPM_FOLDER = ${MTK_PLAT_SOC}/drivers/spm |
| 17 | |
| 18 | # spm common files |
| 19 | PLAT_SPM_SOURCE_FILES_COMMON += \ |
| 20 | ${CUR_SPM_FOLDER}/mt_spm.c \ |
| 21 | ${CUR_SPM_FOLDER}/mt_spm_internal.c \ |
| 22 | ${CUR_SPM_FOLDER}/mt_spm_pmic_wrap.c \ |
jason-ch chen | a07e3ea | 2021-11-16 10:18:46 +0800 | [diff] [blame] | 23 | ${CUR_SPM_FOLDER}/mt_spm_vcorefs.c \ |
jason-ch chen | fa82b9b | 2021-11-16 09:48:20 +0800 | [diff] [blame] | 24 | ${CUR_SPM_FOLDER}/mt_spm_conservation.c \ |
| 25 | ${CUR_SPM_FOLDER}/mt_spm_extern.c |
| 26 | |
| 27 | # spm platform dependcy files |
| 28 | PLAT_SPM_SOURCE_FILES += \ |
| 29 | ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_syspll.c \ |
| 30 | ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_bus26m.c \ |
| 31 | ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_cpu_buck_ldo.c \ |
| 32 | ${CUR_SPM_FOLDER}/constraints/mt_spm_rc_dram.c \ |
| 33 | ${CUR_SPM_FOLDER}/mt_spm_cond.c \ |
| 34 | ${CUR_SPM_FOLDER}/mt_spm_suspend.c \ |
| 35 | ${CUR_SPM_FOLDER}/mt_spm_idle.c |
| 36 | |
| 37 | ifeq (${MT_SPM_FEATURE_SUPPORT}, no) |
| 38 | PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_UNSUPPORT |
| 39 | |
| 40 | BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += ${PLAT_SPM_SOURCE_FILES_COMMON} |
| 41 | else |
| 42 | BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += \ |
| 43 | ${PLAT_SPM_SOURCE_FILES_COMMON} \ |
| 44 | ${PLAT_SPM_SOURCE_FILES} |
| 45 | endif |
| 46 | |
| 47 | ifeq (${MT_SPM_CIRQ_FEATURE_SUPPORT}, no) |
| 48 | PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_CIRQ_UNSUPPORT |
| 49 | endif |
| 50 | |
| 51 | ifeq (${MT_SPM_SSPM_NOTIFIER_SUPPORT}, no) |
| 52 | PLAT_SPM_DEBUG_CFLAGS += -DATF_PLAT_SPM_SSPM_NOTIFIER_UNSUPPORT |
| 53 | else |
| 54 | BL31_MT_LPM_PLAT_SPM_SOURCE_FILES += ${CUR_SPM_FOLDER}/notifier/mt_spm_sspm_notifier.c |
| 55 | endif |
| 56 | |
| 57 | ifeq (${MTK_VOLTAGE_BIN_VCORE}, yes) |
| 58 | PLAT_SPM_DEBUG_CFLAGS += -DATF_VOLTAGE_BIN_VCORE_SUPPORT |
| 59 | endif |
| 60 | |
| 61 | ifeq ($(MTK_SPM_EXTENSION_CONFIG), pmic6362) |
| 62 | MTK_SPM_EXTENSION_PMIC_CONTROL := 6362 |
| 63 | $(eval $(call add_define,MTK_SPM_EXTENSION_PMIC_CONTROL)) |
| 64 | endif |
| 65 | |
| 66 | $(info --------------------------------------) |
| 67 | $(info SPM build flags: ${PLAT_SPM_DEBUG_CFLAGS}) |
| 68 | $(info SPM build files: ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES}) |
| 69 | $(info --------------------------------------) |
| 70 | |
| 71 | # Common makefile for platform.mk |
| 72 | PLAT_INCLUDES += \ |
| 73 | ${PLAT_SPM_DEBUG_CFLAGS} \ |
| 74 | -I${CUR_SPM_FOLDER}/ \ |
| 75 | -I${CUR_SPM_FOLDER}/constraints/ \ |
| 76 | -I${CUR_SPM_FOLDER}/notifier/ |
| 77 | |
| 78 | PLAT_BL_COMMON_SOURCES += ${BL31_MT_LPM_PLAT_SPM_SOURCE_FILES} |