blob: 8717d7d3e2bca32dacca94fd382780a05f7adf23 [file] [log] [blame]
Rex-BC Chen749b2112021-09-28 11:24:09 +08001#
jason-ch chenfa82b9b2021-11-16 09:48:20 +08002# Copyright (c) 2021-2022, MediaTek Inc. All rights reserved.
Rex-BC Chen749b2112021-09-28 11:24:09 +08003#
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/ \
developerbdeb0ba2022-07-08 14:48:56 +080011 -I${MTK_PLAT}/drivers/cirq/ \
developerfe14b9f2022-09-05 11:18:04 +080012 -I${MTK_PLAT}/drivers/gic600/ \
13 -I${MTK_PLAT}/drivers/gpio/ \
14 -I${MTK_PLAT}/drivers/lpm/ \
developer0e2a2842022-09-01 15:16:23 +080015 -I${MTK_PLAT}/drivers/pmic_wrap/ \
developerfe14b9f2022-09-05 11:18:04 +080016 -I${MTK_PLAT}/drivers/timer/ \
17 -I${MTK_PLAT}/drivers/uart/ \
developer8c327e82022-05-29 22:25:44 +080018 -I${MTK_PLAT}/include/ \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080019 -I${MTK_PLAT_SOC}/drivers/spm/ \
Edward-JW Yang63582ec2021-11-01 20:20:18 +080020 -I${MTK_PLAT_SOC}/drivers/dcm/ \
developerfe14b9f2022-09-05 11:18:04 +080021 -I${MTK_PLAT_SOC}/drivers/dfd/ \
Penny Janfb70fb42021-10-03 10:11:04 +080022 -I${MTK_PLAT_SOC}/drivers/emi_mpu/ \
developerfe14b9f2022-09-05 11:18:04 +080023 -I${MTK_PLAT_SOC}/drivers/gpio/ \
developerba7b7d22021-11-14 10:14:45 +080024 -I${MTK_PLAT_SOC}/drivers/mcdi/ \
James Lo4ac7a412021-10-06 18:12:30 +080025 -I${MTK_PLAT_SOC}/drivers/pmic/ \
Yuchen Huangad040442021-11-12 16:56:33 +080026 -I${MTK_PLAT_SOC}/drivers/rtc/ \
developerc3dabd82021-11-08 11:30:40 +080027 -I${MTK_PLAT_SOC}/drivers/spmc/ \
Rex-BC Chen749b2112021-09-28 11:24:09 +080028 -I${MTK_PLAT_SOC}/include/
29
Christine Zhuccd26002021-10-11 21:29:58 +080030GICV3_SUPPORT_GIC600 := 1
Rex-BC Chen749b2112021-09-28 11:24:09 +080031include drivers/arm/gic/v3/gicv3.mk
32include lib/xlat_tables_v2/xlat_tables.mk
33
34PLAT_BL_COMMON_SOURCES := ${GICV3_SOURCES} \
35 ${XLAT_TABLES_LIB_SRCS} \
36 plat/common/aarch64/crash_console_helpers.S \
37 plat/common/plat_psci_common.c
38
39
40BL31_SOURCES += common/desc_image_load.c \
Rex-BC Chen0bee8f92021-10-06 19:00:13 +080041 drivers/delay_timer/delay_timer.c \
Guodong Liu532016e2021-10-15 16:52:18 +080042 drivers/gpio/gpio.c \
Rex-BC Chen0bee8f92021-10-06 19:00:13 +080043 drivers/delay_timer/generic_delay_timer.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080044 drivers/ti/uart/aarch64/16550_console.S \
45 lib/bl_aux_params/bl_aux_params.c \
46 lib/cpus/aarch64/cortex_a55.S \
47 lib/cpus/aarch64/cortex_a76.S \
48 plat/common/plat_gicv3.c \
49 ${MTK_PLAT}/common/mtk_plat_common.c \
Rex-BC Chenabd9ecf2021-10-06 19:25:50 +080050 ${MTK_PLAT}/common/mtk_sip_svc.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080051 ${MTK_PLAT}/common/params_setup.c \
developerbdeb0ba2022-07-08 14:48:56 +080052 ${MTK_PLAT}/drivers/cirq/mt_cirq.c \
developerfe14b9f2022-09-05 11:18:04 +080053 ${MTK_PLAT}/drivers/gic600/mt_gic_v3.c \
54 ${MTK_PLAT}/drivers/gpio/mtgpio_common.c \
55 ${MTK_PLAT}/drivers/lpm/mt_lp_rm.c \
56 ${MTK_PLAT}/drivers/pmic_wrap/pmic_wrap_init.c \
57 ${MTK_PLAT}/drivers/rtc/rtc_common.c \
58 ${MTK_PLAT}/drivers/timer/mt_timer.c \
59 ${MTK_PLAT}/drivers/uart/uart.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080060 ${MTK_PLAT_SOC}/aarch64/platform_common.c \
61 ${MTK_PLAT_SOC}/aarch64/plat_helpers.S \
62 ${MTK_PLAT_SOC}/bl31_plat_setup.c \
Edward-JW Yang63582ec2021-11-01 20:20:18 +080063 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm.c \
64 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm_utils.c \
Rex-BC Chen1782ce92021-12-02 14:03:44 +080065 ${MTK_PLAT_SOC}/drivers/dfd/plat_dfd.c \
Penny Janfb70fb42021-10-03 10:11:04 +080066 ${MTK_PLAT_SOC}/drivers/emi_mpu/emi_mpu.c \
Guodong Liu532016e2021-10-15 16:52:18 +080067 ${MTK_PLAT_SOC}/drivers/gpio/mtgpio.c \
developerba7b7d22021-11-14 10:14:45 +080068 ${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 \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080071 ${MTK_PLAT_SOC}/drivers/mcdi/mt_lp_irqremain.c \
James Lo4ac7a412021-10-06 18:12:30 +080072 ${MTK_PLAT_SOC}/drivers/pmic/pmic.c \
Yuchen Huangad040442021-11-12 16:56:33 +080073 ${MTK_PLAT_SOC}/drivers/rtc/rtc.c \
developerc3dabd82021-11-08 11:30:40 +080074 ${MTK_PLAT_SOC}/drivers/spmc/mtspmc.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080075 ${MTK_PLAT_SOC}/plat_pm.c \
Rex-BC Chenabd9ecf2021-10-06 19:25:50 +080076 ${MTK_PLAT_SOC}/plat_sip_calls.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080077 ${MTK_PLAT_SOC}/plat_topology.c
78
jason-ch chenfa82b9b2021-11-16 09:48:20 +080079# Build SPM drivers
80include ${MTK_PLAT_SOC}/drivers/spm/build.mk
81
Rex-BC Chen749b2112021-09-28 11:24:09 +080082# Configs for A76 and A55
83HW_ASSISTED_COHERENCY := 1
84USE_COHERENT_MEM := 0
85CTX_INCLUDE_AARCH32_REGS := 0
86ERRATA_A55_1530923 := 1
87ERRATA_A55_1221012 := 1
88
Rex-BC Chen4a1570a2021-11-25 18:55:04 +080089ERRATA_A76_1257314 := 1
90ERRATA_A76_1262606 := 1
91ERRATA_A76_1262888 := 1
92ERRATA_A76_1275112 := 1
93ERRATA_A76_1286807 := 1
94ERRATA_A76_1791580 := 1
95ERRATA_A76_1165522 := 1
96ERRATA_A76_1868343 := 1
97ERRATA_A76_1946160 := 1
98
Rex-BC Chen749b2112021-09-28 11:24:09 +080099# indicate the reset vector address can be programmed
100PROGRAMMABLE_RESET_ADDRESS := 1
101
102COLD_BOOT_SINGLE_CPU := 1
103
104MACH_MT8186 := 1
105$(eval $(call add_define,MACH_MT8186))
106
107include lib/coreboot/coreboot.mk