blob: 9c03340c53dc447a1b4519984e441ffbbd048f44 [file] [log] [blame]
Rex-BC Chen749b2112021-09-28 11:24:09 +08001#
developer01abd6d2024-09-19 18:52:33 +08002# Copyright (c) 2021-2024, 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
developer01abd6d2024-09-19 18:52:33 +080010# True Random Number Generator firmware Interface
11TRNG_SUPPORT := 1
12
Rex-BC Chen749b2112021-09-28 11:24:09 +080013PLAT_INCLUDES := -I${MTK_PLAT}/common/ \
developerbdeb0ba2022-07-08 14:48:56 +080014 -I${MTK_PLAT}/drivers/cirq/ \
developerfe14b9f2022-09-05 11:18:04 +080015 -I${MTK_PLAT}/drivers/gic600/ \
16 -I${MTK_PLAT}/drivers/gpio/ \
developerc9d2bfa2022-06-22 19:51:41 +080017 -I${MTK_PLAT}/drivers/msdc/ \
18 -I${MTK_PLAT}/drivers/msdc/${PLAT} \
developer0e2a2842022-09-01 15:16:23 +080019 -I${MTK_PLAT}/drivers/pmic_wrap/ \
developerfe14b9f2022-09-05 11:18:04 +080020 -I${MTK_PLAT}/drivers/timer/ \
21 -I${MTK_PLAT}/drivers/uart/ \
developer8c327e82022-05-29 22:25:44 +080022 -I${MTK_PLAT}/include/ \
developer92e7aec2023-01-06 14:53:37 +080023 -I${MTK_PLAT}/include/lpm \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080024 -I${MTK_PLAT_SOC}/drivers/spm/ \
Edward-JW Yang63582ec2021-11-01 20:20:18 +080025 -I${MTK_PLAT_SOC}/drivers/dcm/ \
developerfe14b9f2022-09-05 11:18:04 +080026 -I${MTK_PLAT_SOC}/drivers/dfd/ \
Penny Janfb70fb42021-10-03 10:11:04 +080027 -I${MTK_PLAT_SOC}/drivers/emi_mpu/ \
developerfe14b9f2022-09-05 11:18:04 +080028 -I${MTK_PLAT_SOC}/drivers/gpio/ \
developerba7b7d22021-11-14 10:14:45 +080029 -I${MTK_PLAT_SOC}/drivers/mcdi/ \
James Lo4ac7a412021-10-06 18:12:30 +080030 -I${MTK_PLAT_SOC}/drivers/pmic/ \
Yuchen Huangad040442021-11-12 16:56:33 +080031 -I${MTK_PLAT_SOC}/drivers/rtc/ \
developerc3dabd82021-11-08 11:30:40 +080032 -I${MTK_PLAT_SOC}/drivers/spmc/ \
Rex-BC Chen749b2112021-09-28 11:24:09 +080033 -I${MTK_PLAT_SOC}/include/
34
Christine Zhuccd26002021-10-11 21:29:58 +080035GICV3_SUPPORT_GIC600 := 1
Rex-BC Chen749b2112021-09-28 11:24:09 +080036include drivers/arm/gic/v3/gicv3.mk
37include lib/xlat_tables_v2/xlat_tables.mk
38
39PLAT_BL_COMMON_SOURCES := ${GICV3_SOURCES} \
40 ${XLAT_TABLES_LIB_SRCS} \
41 plat/common/aarch64/crash_console_helpers.S \
42 plat/common/plat_psci_common.c
43
44
45BL31_SOURCES += common/desc_image_load.c \
Rex-BC Chen0bee8f92021-10-06 19:00:13 +080046 drivers/delay_timer/delay_timer.c \
Guodong Liu532016e2021-10-15 16:52:18 +080047 drivers/gpio/gpio.c \
Rex-BC Chen0bee8f92021-10-06 19:00:13 +080048 drivers/delay_timer/generic_delay_timer.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080049 drivers/ti/uart/aarch64/16550_console.S \
50 lib/bl_aux_params/bl_aux_params.c \
51 lib/cpus/aarch64/cortex_a55.S \
52 lib/cpus/aarch64/cortex_a76.S \
53 plat/common/plat_gicv3.c \
54 ${MTK_PLAT}/common/mtk_plat_common.c \
Rex-BC Chenabd9ecf2021-10-06 19:25:50 +080055 ${MTK_PLAT}/common/mtk_sip_svc.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080056 ${MTK_PLAT}/common/params_setup.c \
developerafdd96a2022-09-29 10:41:26 +080057 ${MTK_PLAT}/common/lpm/mt_lp_rm.c \
developerbdeb0ba2022-07-08 14:48:56 +080058 ${MTK_PLAT}/drivers/cirq/mt_cirq.c \
developerfe14b9f2022-09-05 11:18:04 +080059 ${MTK_PLAT}/drivers/gic600/mt_gic_v3.c \
60 ${MTK_PLAT}/drivers/gpio/mtgpio_common.c \
developerc9d2bfa2022-06-22 19:51:41 +080061 ${MTK_PLAT}/drivers/msdc/mt_msdc.c \
developerfe14b9f2022-09-05 11:18:04 +080062 ${MTK_PLAT}/drivers/pmic_wrap/pmic_wrap_init.c \
63 ${MTK_PLAT}/drivers/rtc/rtc_common.c \
64 ${MTK_PLAT}/drivers/timer/mt_timer.c \
65 ${MTK_PLAT}/drivers/uart/uart.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080066 ${MTK_PLAT_SOC}/aarch64/platform_common.c \
67 ${MTK_PLAT_SOC}/aarch64/plat_helpers.S \
68 ${MTK_PLAT_SOC}/bl31_plat_setup.c \
Edward-JW Yang63582ec2021-11-01 20:20:18 +080069 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm.c \
70 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm_utils.c \
Rex-BC Chen1782ce92021-12-02 14:03:44 +080071 ${MTK_PLAT_SOC}/drivers/dfd/plat_dfd.c \
Penny Janfb70fb42021-10-03 10:11:04 +080072 ${MTK_PLAT_SOC}/drivers/emi_mpu/emi_mpu.c \
Guodong Liu532016e2021-10-15 16:52:18 +080073 ${MTK_PLAT_SOC}/drivers/gpio/mtgpio.c \
developerba7b7d22021-11-14 10:14:45 +080074 ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm.c \
75 ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm_cpc.c \
76 ${MTK_PLAT_SOC}/drivers/mcdi/mt_mcdi.c \
jason-ch chenfa82b9b2021-11-16 09:48:20 +080077 ${MTK_PLAT_SOC}/drivers/mcdi/mt_lp_irqremain.c \
James Lo4ac7a412021-10-06 18:12:30 +080078 ${MTK_PLAT_SOC}/drivers/pmic/pmic.c \
Yuchen Huangad040442021-11-12 16:56:33 +080079 ${MTK_PLAT_SOC}/drivers/rtc/rtc.c \
developerc3dabd82021-11-08 11:30:40 +080080 ${MTK_PLAT_SOC}/drivers/spmc/mtspmc.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080081 ${MTK_PLAT_SOC}/plat_pm.c \
Rex-BC Chenabd9ecf2021-10-06 19:25:50 +080082 ${MTK_PLAT_SOC}/plat_sip_calls.c \
Rex-BC Chen749b2112021-09-28 11:24:09 +080083 ${MTK_PLAT_SOC}/plat_topology.c
84
developer01abd6d2024-09-19 18:52:33 +080085ifeq (${TRNG_SUPPORT},1)
86BL31_SOURCES += ${MTK_PLAT}/drivers/rng/rng.c \
87 ${MTK_PLAT}/drivers/rng/${PLAT}/rng_plat.c
88endif
89
jason-ch chenfa82b9b2021-11-16 09:48:20 +080090# Build SPM drivers
91include ${MTK_PLAT_SOC}/drivers/spm/build.mk
92
Rex-BC Chen749b2112021-09-28 11:24:09 +080093# Configs for A76 and A55
94HW_ASSISTED_COHERENCY := 1
95USE_COHERENT_MEM := 0
96CTX_INCLUDE_AARCH32_REGS := 0
97ERRATA_A55_1530923 := 1
98ERRATA_A55_1221012 := 1
99
Rex-BC Chen4a1570a2021-11-25 18:55:04 +0800100ERRATA_A76_1257314 := 1
101ERRATA_A76_1262606 := 1
102ERRATA_A76_1262888 := 1
103ERRATA_A76_1275112 := 1
104ERRATA_A76_1286807 := 1
105ERRATA_A76_1791580 := 1
106ERRATA_A76_1165522 := 1
107ERRATA_A76_1868343 := 1
108ERRATA_A76_1946160 := 1
109
Rex-BC Chen749b2112021-09-28 11:24:09 +0800110# indicate the reset vector address can be programmed
111PROGRAMMABLE_RESET_ADDRESS := 1
112
113COLD_BOOT_SINGLE_CPU := 1
114
115MACH_MT8186 := 1
116$(eval $(call add_define,MACH_MT8186))
117
118include lib/coreboot/coreboot.mk