blob: b6d9ca8c323dcac32f5498eca803eea06c44ea33 [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/ \
Christine Zhuccd26002021-10-11 21:29:58 +080011 -I${MTK_PLAT}/common/drivers/gic600/ \
Guodong Liu532016e2021-10-15 16:52:18 +080012 -I${MTK_PLAT}/common/drivers/gpio/ \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080013 -I${MTK_PLAT}/common/drivers/uart/ \
Rex-BC Chend24c05d2021-10-06 18:55:53 +080014 -I${MTK_PLAT}/common/drivers/timer/ \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080015 -I${MTK_PLAT}/common/lpm/ \
16 -I${MTK_PLAT_SOC}/drivers/spm/ \
Edward-JW Yang63582ec2021-11-01 20:20:18 +080017 -I${MTK_PLAT_SOC}/drivers/dcm/ \
Rex-BC Chen1782ce92021-12-02 14:03:44 +080018 -I${MTK_PLAT_SOC}/drivers/dfd/ \
Penny Janfb70fb42021-10-03 10:11:04 +080019 -I${MTK_PLAT_SOC}/drivers/emi_mpu/ \
Guodong Liu532016e2021-10-15 16:52:18 +080020 -I${MTK_PLAT_SOC}/drivers/gpio/ \
developerba7b7d22021-11-14 10:14:45 +080021 -I${MTK_PLAT_SOC}/drivers/mcdi/ \
James Lo4ac7a412021-10-06 18:12:30 +080022 -I${MTK_PLAT_SOC}/drivers/pmic/ \
Yuchen Huangad040442021-11-12 16:56:33 +080023 -I${MTK_PLAT_SOC}/drivers/rtc/ \
developerc3dabd82021-11-08 11:30:40 +080024 -I${MTK_PLAT_SOC}/drivers/spmc/ \
Rex-BC Chen749b2112021-09-28 11:24:09 +080025 -I${MTK_PLAT_SOC}/include/
26
Christine Zhuccd26002021-10-11 21:29:58 +080027GICV3_SUPPORT_GIC600 := 1
Rex-BC Chen749b2112021-09-28 11:24:09 +080028include drivers/arm/gic/v3/gicv3.mk
29include lib/xlat_tables_v2/xlat_tables.mk
30
31PLAT_BL_COMMON_SOURCES := ${GICV3_SOURCES} \
32 ${XLAT_TABLES_LIB_SRCS} \
33 plat/common/aarch64/crash_console_helpers.S \
34 plat/common/plat_psci_common.c
35
36
37BL31_SOURCES += common/desc_image_load.c \
Rex-BC Chen0bee8f92021-10-06 19:00:13 +080038 drivers/delay_timer/delay_timer.c \
Guodong Liu532016e2021-10-15 16:52:18 +080039 drivers/gpio/gpio.c \
Rex-BC Chen0bee8f92021-10-06 19:00:13 +080040 drivers/delay_timer/generic_delay_timer.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080041 drivers/ti/uart/aarch64/16550_console.S \
42 lib/bl_aux_params/bl_aux_params.c \
43 lib/cpus/aarch64/cortex_a55.S \
44 lib/cpus/aarch64/cortex_a76.S \
45 plat/common/plat_gicv3.c \
Christine Zhuccd26002021-10-11 21:29:58 +080046 ${MTK_PLAT}/common/drivers/gic600/mt_gic_v3.c \
Guodong Liu532016e2021-10-15 16:52:18 +080047 ${MTK_PLAT}/common/drivers/gpio/mtgpio_common.c \
James Lo4ac7a412021-10-06 18:12:30 +080048 ${MTK_PLAT}/common/drivers/pmic_wrap/pmic_wrap_init.c \
Yuchen Huangad040442021-11-12 16:56:33 +080049 ${MTK_PLAT}/common/drivers/rtc/rtc_common.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080050 ${MTK_PLAT}/common/mtk_plat_common.c \
Rex-BC Chenabd9ecf2021-10-06 19:25:50 +080051 ${MTK_PLAT}/common/mtk_sip_svc.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080052 ${MTK_PLAT}/common/params_setup.c \
Rex-BC Chend24c05d2021-10-06 18:55:53 +080053 ${MTK_PLAT}/common/drivers/timer/mt_timer.c \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080054 ${MTK_PLAT}/common/drivers/uart/uart.c \
Zhengnan Chenfd835f92021-10-12 17:05:49 +080055 ${MTK_PLAT}/common/mtk_cirq.c \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080056 ${MTK_PLAT}/common/lpm/mt_lp_rm.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080057 ${MTK_PLAT_SOC}/aarch64/platform_common.c \
58 ${MTK_PLAT_SOC}/aarch64/plat_helpers.S \
59 ${MTK_PLAT_SOC}/bl31_plat_setup.c \
Edward-JW Yang63582ec2021-11-01 20:20:18 +080060 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm.c \
61 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm_utils.c \
Rex-BC Chen1782ce92021-12-02 14:03:44 +080062 ${MTK_PLAT_SOC}/drivers/dfd/plat_dfd.c \
Penny Janfb70fb42021-10-03 10:11:04 +080063 ${MTK_PLAT_SOC}/drivers/emi_mpu/emi_mpu.c \
Guodong Liu532016e2021-10-15 16:52:18 +080064 ${MTK_PLAT_SOC}/drivers/gpio/mtgpio.c \
developerba7b7d22021-11-14 10:14:45 +080065 ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm.c \
66 ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm_cpc.c \
67 ${MTK_PLAT_SOC}/drivers/mcdi/mt_mcdi.c \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080068 ${MTK_PLAT_SOC}/drivers/mcdi/mt_lp_irqremain.c \
James Lo4ac7a412021-10-06 18:12:30 +080069 ${MTK_PLAT_SOC}/drivers/pmic/pmic.c \
Yuchen Huangad040442021-11-12 16:56:33 +080070 ${MTK_PLAT_SOC}/drivers/rtc/rtc.c \
developerc3dabd82021-11-08 11:30:40 +080071 ${MTK_PLAT_SOC}/drivers/spmc/mtspmc.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080072 ${MTK_PLAT_SOC}/plat_pm.c \
Rex-BC Chenabd9ecf2021-10-06 19:25:50 +080073 ${MTK_PLAT_SOC}/plat_sip_calls.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080074 ${MTK_PLAT_SOC}/plat_topology.c
75
jason-ch chenfa82b9b2021-11-16 09:48:20 +080076# Build SPM drivers
77include ${MTK_PLAT_SOC}/drivers/spm/build.mk
78
Rex-BC Chen749b2112021-09-28 11:24:09 +080079# Configs for A76 and A55
80HW_ASSISTED_COHERENCY := 1
81USE_COHERENT_MEM := 0
82CTX_INCLUDE_AARCH32_REGS := 0
83ERRATA_A55_1530923 := 1
84ERRATA_A55_1221012 := 1
85
Rex-BC Chen4a1570a2021-11-25 18:55:04 +080086ERRATA_A76_1257314 := 1
87ERRATA_A76_1262606 := 1
88ERRATA_A76_1262888 := 1
89ERRATA_A76_1275112 := 1
90ERRATA_A76_1286807 := 1
91ERRATA_A76_1791580 := 1
92ERRATA_A76_1165522 := 1
93ERRATA_A76_1868343 := 1
94ERRATA_A76_1946160 := 1
95
Rex-BC Chen749b2112021-09-28 11:24:09 +080096# indicate the reset vector address can be programmed
97PROGRAMMABLE_RESET_ADDRESS := 1
98
99COLD_BOOT_SINGLE_CPU := 1
100
101MACH_MT8186 := 1
102$(eval $(call add_define,MACH_MT8186))
103
104include lib/coreboot/coreboot.mk