1#
2# Copyright (c) 2021, MediaTek Inc. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7MTK_PLAT     := plat/mediatek
8MTK_PLAT_SOC := ${MTK_PLAT}/${PLAT}
9
10PLAT_INCLUDES := -I${MTK_PLAT}/common/                            \
11                 -I${MTK_PLAT}/common/drivers/gic600/             \
12                 -I${MTK_PLAT}/common/drivers/gpio/               \
13                 -I${MTK_PLAT}/common/drivers/rtc/                \
14                 -I${MTK_PLAT}/common/drivers/timer/              \
15                 -I${MTK_PLAT}/common/drivers/uart/               \
16                 -I${MTK_PLAT}/common/lpm/                        \
17                 -I${MTK_PLAT_SOC}/drivers/dcm                    \
18                 -I${MTK_PLAT_SOC}/drivers/dfd                    \
19                 -I${MTK_PLAT_SOC}/drivers/dp/                    \
20                 -I${MTK_PLAT_SOC}/drivers/emi_mpu/               \
21                 -I${MTK_PLAT_SOC}/drivers/gpio/                  \
22                 -I${MTK_PLAT_SOC}/drivers/mcdi/                  \
23                 -I${MTK_PLAT_SOC}/drivers/pmic/                  \
24                 -I${MTK_PLAT_SOC}/drivers/spmc/                  \
25                 -I${MTK_PLAT_SOC}/drivers/ptp3/                   \
26                 -I${MTK_PLAT_SOC}/include/
27
28GICV3_SUPPORT_GIC600        :=      1
29include drivers/arm/gic/v3/gicv3.mk
30include lib/xlat_tables_v2/xlat_tables.mk
31
32PLAT_BL_COMMON_SOURCES := ${GICV3_SOURCES}                              \
33                          ${XLAT_TABLES_LIB_SRCS}                       \
34                          plat/common/aarch64/crash_console_helpers.S   \
35                          plat/common/plat_psci_common.c
36
37
38BL31_SOURCES += common/desc_image_load.c                              \
39                drivers/delay_timer/delay_timer.c                     \
40                drivers/gpio/gpio.c                                   \
41                drivers/delay_timer/generic_delay_timer.c             \
42                drivers/ti/uart/aarch64/16550_console.S               \
43                lib/bl_aux_params/bl_aux_params.c                     \
44                lib/cpus/aarch64/cortex_a55.S                         \
45                lib/cpus/aarch64/cortex_a78.S                         \
46                plat/common/plat_gicv3.c                              \
47                ${MTK_PLAT}/common/drivers/gic600/mt_gic_v3.c         \
48                ${MTK_PLAT}/common/drivers/gpio/mtgpio_common.c       \
49                ${MTK_PLAT}/common/drivers/pmic_wrap/pmic_wrap_init_v2.c \
50                ${MTK_PLAT}/common/drivers/rtc/rtc_common.c           \
51                ${MTK_PLAT}/common/drivers/rtc/rtc_mt6359p.c          \
52                ${MTK_PLAT}/common/drivers/timer/mt_timer.c           \
53		${MTK_PLAT}/common/drivers/uart/uart.c                \
54		${MTK_PLAT}/common/lpm/mt_lp_rm.c                     \
55                ${MTK_PLAT}/common/mtk_cirq.c                         \
56                ${MTK_PLAT}/common/mtk_plat_common.c                  \
57                ${MTK_PLAT}/common/mtk_sip_svc.c                      \
58                ${MTK_PLAT}/common/params_setup.c                     \
59                ${MTK_PLAT_SOC}/aarch64/platform_common.c             \
60                ${MTK_PLAT_SOC}/aarch64/plat_helpers.S                \
61                ${MTK_PLAT_SOC}/bl31_plat_setup.c                     \
62                ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm.c                 \
63                ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm_utils.c           \
64                ${MTK_PLAT_SOC}/drivers/dfd/plat_dfd.c                \
65                ${MTK_PLAT_SOC}/drivers/dp/mt_dp.c                    \
66                ${MTK_PLAT_SOC}/drivers/emi_mpu/emi_mpu.c             \
67                ${MTK_PLAT_SOC}/drivers/gpio/mtgpio.c                 \
68                ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm.c              \
69                ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm_cpc.c          \
70                ${MTK_PLAT_SOC}/drivers/mcdi/mt_mcdi.c                \
71		${MTK_PLAT_SOC}/drivers/mcdi/mt_lp_irqremain.c        \
72                ${MTK_PLAT_SOC}/drivers/gpio/mtgpio.c                 \
73                ${MTK_PLAT_SOC}/drivers/pmic/pmic.c                   \
74                ${MTK_PLAT_SOC}/drivers/ptp3/mtk_ptp3_main.c          \
75                ${MTK_PLAT_SOC}/drivers/spmc/mtspmc.c                 \
76                ${MTK_PLAT_SOC}/plat_pm.c                             \
77                ${MTK_PLAT_SOC}/plat_sip_calls.c                      \
78                ${MTK_PLAT_SOC}/plat_topology.c
79
80# Build SPM drivers
81include ${MTK_PLAT_SOC}/drivers/spm/build.mk
82
83# Configs for A78 and A55
84HW_ASSISTED_COHERENCY := 1
85USE_COHERENT_MEM := 0
86CTX_INCLUDE_AARCH32_REGS := 0
87ERRATA_A55_1530923 := 1
88
89# indicate the reset vector address can be programmed
90PROGRAMMABLE_RESET_ADDRESS := 1
91
92COLD_BOOT_SINGLE_CPU := 1
93
94MACH_MT8195 := 1
95$(eval $(call add_define,MACH_MT8195))
96
97include lib/coreboot/coreboot.mk
98