blob: 68f4a1f91cca2cb7a2c5d3d584b2eba1a0e1731b [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/ \
developerafdd96a2022-09-29 10:41:26 +080011 -I${MTK_PLAT}/common/lpm \
developerbdeb0ba2022-07-08 14:48:56 +080012 -I${MTK_PLAT}/drivers/cirq/ \
developerfe14b9f2022-09-05 11:18:04 +080013 -I${MTK_PLAT}/drivers/gic600/ \
14 -I${MTK_PLAT}/drivers/gpio/ \
developerc9d2bfa2022-06-22 19:51:41 +080015 -I${MTK_PLAT}/drivers/msdc/ \
16 -I${MTK_PLAT}/drivers/msdc/${PLAT} \
developer0e2a2842022-09-01 15:16:23 +080017 -I${MTK_PLAT}/drivers/pmic_wrap/ \
developerfe14b9f2022-09-05 11:18:04 +080018 -I${MTK_PLAT}/drivers/timer/ \
19 -I${MTK_PLAT}/drivers/uart/ \
developer8c327e82022-05-29 22:25:44 +080020 -I${MTK_PLAT}/include/ \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080021 -I${MTK_PLAT_SOC}/drivers/spm/ \
Edward-JW Yang63582ec2021-11-01 20:20:18 +080022 -I${MTK_PLAT_SOC}/drivers/dcm/ \
developerfe14b9f2022-09-05 11:18:04 +080023 -I${MTK_PLAT_SOC}/drivers/dfd/ \
Penny Janfb70fb42021-10-03 10:11:04 +080024 -I${MTK_PLAT_SOC}/drivers/emi_mpu/ \
developerfe14b9f2022-09-05 11:18:04 +080025 -I${MTK_PLAT_SOC}/drivers/gpio/ \
developerba7b7d22021-11-14 10:14:45 +080026 -I${MTK_PLAT_SOC}/drivers/mcdi/ \
James Lo4ac7a412021-10-06 18:12:30 +080027 -I${MTK_PLAT_SOC}/drivers/pmic/ \
Yuchen Huangad040442021-11-12 16:56:33 +080028 -I${MTK_PLAT_SOC}/drivers/rtc/ \
developerc3dabd82021-11-08 11:30:40 +080029 -I${MTK_PLAT_SOC}/drivers/spmc/ \
Rex-BC Chen749b2112021-09-28 11:24:09 +080030 -I${MTK_PLAT_SOC}/include/
31
Christine Zhuccd26002021-10-11 21:29:58 +080032GICV3_SUPPORT_GIC600 := 1
Rex-BC Chen749b2112021-09-28 11:24:09 +080033include drivers/arm/gic/v3/gicv3.mk
34include lib/xlat_tables_v2/xlat_tables.mk
35
36PLAT_BL_COMMON_SOURCES := ${GICV3_SOURCES} \
37 ${XLAT_TABLES_LIB_SRCS} \
38 plat/common/aarch64/crash_console_helpers.S \
39 plat/common/plat_psci_common.c
40
41
42BL31_SOURCES += common/desc_image_load.c \
Rex-BC Chen0bee8f92021-10-06 19:00:13 +080043 drivers/delay_timer/delay_timer.c \
Guodong Liu532016e2021-10-15 16:52:18 +080044 drivers/gpio/gpio.c \
Rex-BC Chen0bee8f92021-10-06 19:00:13 +080045 drivers/delay_timer/generic_delay_timer.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080046 drivers/ti/uart/aarch64/16550_console.S \
47 lib/bl_aux_params/bl_aux_params.c \
48 lib/cpus/aarch64/cortex_a55.S \
49 lib/cpus/aarch64/cortex_a76.S \
50 plat/common/plat_gicv3.c \
51 ${MTK_PLAT}/common/mtk_plat_common.c \
Rex-BC Chenabd9ecf2021-10-06 19:25:50 +080052 ${MTK_PLAT}/common/mtk_sip_svc.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080053 ${MTK_PLAT}/common/params_setup.c \
developerafdd96a2022-09-29 10:41:26 +080054 ${MTK_PLAT}/common/lpm/mt_lp_rm.c \
developerbdeb0ba2022-07-08 14:48:56 +080055 ${MTK_PLAT}/drivers/cirq/mt_cirq.c \
developerfe14b9f2022-09-05 11:18:04 +080056 ${MTK_PLAT}/drivers/gic600/mt_gic_v3.c \
57 ${MTK_PLAT}/drivers/gpio/mtgpio_common.c \
developerc9d2bfa2022-06-22 19:51:41 +080058 ${MTK_PLAT}/drivers/msdc/mt_msdc.c \
developerfe14b9f2022-09-05 11:18:04 +080059 ${MTK_PLAT}/drivers/pmic_wrap/pmic_wrap_init.c \
60 ${MTK_PLAT}/drivers/rtc/rtc_common.c \
61 ${MTK_PLAT}/drivers/timer/mt_timer.c \
62 ${MTK_PLAT}/drivers/uart/uart.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080063 ${MTK_PLAT_SOC}/aarch64/platform_common.c \
64 ${MTK_PLAT_SOC}/aarch64/plat_helpers.S \
65 ${MTK_PLAT_SOC}/bl31_plat_setup.c \
Edward-JW Yang63582ec2021-11-01 20:20:18 +080066 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm.c \
67 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm_utils.c \
Rex-BC Chen1782ce92021-12-02 14:03:44 +080068 ${MTK_PLAT_SOC}/drivers/dfd/plat_dfd.c \
Penny Janfb70fb42021-10-03 10:11:04 +080069 ${MTK_PLAT_SOC}/drivers/emi_mpu/emi_mpu.c \
Guodong Liu532016e2021-10-15 16:52:18 +080070 ${MTK_PLAT_SOC}/drivers/gpio/mtgpio.c \
developerba7b7d22021-11-14 10:14:45 +080071 ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm.c \
72 ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm_cpc.c \
73 ${MTK_PLAT_SOC}/drivers/mcdi/mt_mcdi.c \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080074 ${MTK_PLAT_SOC}/drivers/mcdi/mt_lp_irqremain.c \
James Lo4ac7a412021-10-06 18:12:30 +080075 ${MTK_PLAT_SOC}/drivers/pmic/pmic.c \
Yuchen Huangad040442021-11-12 16:56:33 +080076 ${MTK_PLAT_SOC}/drivers/rtc/rtc.c \
developerc3dabd82021-11-08 11:30:40 +080077 ${MTK_PLAT_SOC}/drivers/spmc/mtspmc.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080078 ${MTK_PLAT_SOC}/plat_pm.c \
Rex-BC Chenabd9ecf2021-10-06 19:25:50 +080079 ${MTK_PLAT_SOC}/plat_sip_calls.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080080 ${MTK_PLAT_SOC}/plat_topology.c
81
jason-ch chenfa82b9b2021-11-16 09:48:20 +080082# Build SPM drivers
83include ${MTK_PLAT_SOC}/drivers/spm/build.mk
84
Rex-BC Chen749b2112021-09-28 11:24:09 +080085# Configs for A76 and A55
86HW_ASSISTED_COHERENCY := 1
87USE_COHERENT_MEM := 0
88CTX_INCLUDE_AARCH32_REGS := 0
89ERRATA_A55_1530923 := 1
90ERRATA_A55_1221012 := 1
91
Rex-BC Chen4a1570a2021-11-25 18:55:04 +080092ERRATA_A76_1257314 := 1
93ERRATA_A76_1262606 := 1
94ERRATA_A76_1262888 := 1
95ERRATA_A76_1275112 := 1
96ERRATA_A76_1286807 := 1
97ERRATA_A76_1791580 := 1
98ERRATA_A76_1165522 := 1
99ERRATA_A76_1868343 := 1
100ERRATA_A76_1946160 := 1
101
Rex-BC Chen749b2112021-09-28 11:24:09 +0800102# indicate the reset vector address can be programmed
103PROGRAMMABLE_RESET_ADDRESS := 1
104
105COLD_BOOT_SINGLE_CPU := 1
106
107MACH_MT8186 := 1
108$(eval $(call add_define,MACH_MT8186))
109
110include lib/coreboot/coreboot.mk