blob: 48dafa3cde5e1cbffbd6d3acd5c6f28d678cf70c [file] [log] [blame]
developer8670d252021-03-19 22:13:11 +08001#
developer92e7aec2023-01-06 14:53:37 +08002# Copyright (c) 2021-2023, MediaTek Inc. All rights reserved.
developer8670d252021-03-19 22:13:11 +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/ \
developerec6eef72022-07-11 18:48:43 +080012 -I${MTK_PLAT}/drivers/dp/ \
developerfe14b9f2022-09-05 11:18:04 +080013 -I${MTK_PLAT}/drivers/gic600/ \
14 -I${MTK_PLAT}/drivers/gpio/ \
developer929097e2022-09-01 16:32:46 +080015 -I${MTK_PLAT}/drivers/pmic/ \
developer0e2a2842022-09-01 15:16:23 +080016 -I${MTK_PLAT}/drivers/pmic_wrap/ \
developer8d3be082022-11-03 19:49:23 +080017 -I${MTK_PLAT}/drivers/ptp3/ \
developerfe14b9f2022-09-05 11:18:04 +080018 -I${MTK_PLAT}/drivers/rtc/ \
19 -I${MTK_PLAT}/drivers/timer/ \
20 -I${MTK_PLAT}/drivers/uart/ \
developer8c327e82022-05-29 22:25:44 +080021 -I${MTK_PLAT}/include/ \
developer92e7aec2023-01-06 14:53:37 +080022 -I${MTK_PLAT}/include/lpm/ \
developer47917892021-11-01 16:43:47 +080023 -I${MTK_PLAT_SOC}/drivers/apusys/ \
developer90b13412021-07-02 15:54:57 +080024 -I${MTK_PLAT_SOC}/drivers/dcm \
Rex-BC Chen17903042021-08-10 11:10:58 +080025 -I${MTK_PLAT_SOC}/drivers/dfd \
developere2be2dd2021-08-19 15:34:43 +080026 -I${MTK_PLAT_SOC}/drivers/emi_mpu/ \
developer912c7d22021-03-31 14:53:43 +080027 -I${MTK_PLAT_SOC}/drivers/gpio/ \
developer037c99f2020-06-15 16:41:03 +080028 -I${MTK_PLAT_SOC}/drivers/mcdi/ \
developerddb7f402021-04-08 16:37:15 +080029 -I${MTK_PLAT_SOC}/drivers/pmic/ \
developer2a56b2c2020-06-16 13:28:28 +080030 -I${MTK_PLAT_SOC}/drivers/spmc/ \
developerfe14b9f2022-09-05 11:18:04 +080031 -I${MTK_PLAT_SOC}/drivers/ptp3/ \
developer8670d252021-03-19 22:13:11 +080032 -I${MTK_PLAT_SOC}/include/
33
christine.zhua22c10b2021-03-24 21:44:52 +080034GICV3_SUPPORT_GIC600 := 1
developer8670d252021-03-19 22:13:11 +080035include drivers/arm/gic/v3/gicv3.mk
36include lib/xlat_tables_v2/xlat_tables.mk
37
38PLAT_BL_COMMON_SOURCES := ${GICV3_SOURCES} \
39 ${XLAT_TABLES_LIB_SRCS} \
40 plat/common/aarch64/crash_console_helpers.S \
41 plat/common/plat_psci_common.c
42
43
44BL31_SOURCES += common/desc_image_load.c \
developer98b97182021-03-26 18:33:43 +080045 drivers/delay_timer/delay_timer.c \
developer912c7d22021-03-31 14:53:43 +080046 drivers/gpio/gpio.c \
developer98b97182021-03-26 18:33:43 +080047 drivers/delay_timer/generic_delay_timer.c \
developer8670d252021-03-19 22:13:11 +080048 drivers/ti/uart/aarch64/16550_console.S \
49 lib/bl_aux_params/bl_aux_params.c \
50 lib/cpus/aarch64/cortex_a55.S \
51 lib/cpus/aarch64/cortex_a78.S \
52 plat/common/plat_gicv3.c \
developer8670d252021-03-19 22:13:11 +080053 ${MTK_PLAT}/common/mtk_plat_common.c \
developerc0c07822021-03-29 16:50:30 +080054 ${MTK_PLAT}/common/mtk_sip_svc.c \
developer8670d252021-03-19 22:13:11 +080055 ${MTK_PLAT}/common/params_setup.c \
developerafdd96a2022-09-29 10:41:26 +080056 ${MTK_PLAT}/common/lpm/mt_lp_rm.c \
developerbdeb0ba2022-07-08 14:48:56 +080057 ${MTK_PLAT}/drivers/cirq/mt_cirq.c \
developerec6eef72022-07-11 18:48:43 +080058 ${MTK_PLAT}/drivers/dp/mt_dp.c \
developerfe14b9f2022-09-05 11:18:04 +080059 ${MTK_PLAT}/drivers/gic600/mt_gic_v3.c \
60 ${MTK_PLAT}/drivers/gpio/mtgpio_common.c \
developer929097e2022-09-01 16:32:46 +080061 ${MTK_PLAT}/drivers/pmic/pmic.c \
developerfe14b9f2022-09-05 11:18:04 +080062 ${MTK_PLAT}/drivers/pmic_wrap/pmic_wrap_init_v2.c \
developer8d3be082022-11-03 19:49:23 +080063 ${MTK_PLAT}/drivers/ptp3/ptp3_common.c \
developerfe14b9f2022-09-05 11:18:04 +080064 ${MTK_PLAT}/drivers/rtc/rtc_common.c \
65 ${MTK_PLAT}/drivers/rtc/rtc_mt6359p.c \
66 ${MTK_PLAT}/drivers/timer/mt_timer.c \
67 ${MTK_PLAT}/drivers/uart/uart.c \
developer8670d252021-03-19 22:13:11 +080068 ${MTK_PLAT_SOC}/aarch64/platform_common.c \
69 ${MTK_PLAT_SOC}/aarch64/plat_helpers.S \
70 ${MTK_PLAT_SOC}/bl31_plat_setup.c \
developer80159062021-11-08 16:37:39 +080071 ${MTK_PLAT_SOC}/drivers/apusys/apupll.c \
72 ${MTK_PLAT_SOC}/drivers/apusys/apupwr_clkctl.c \
developerfe14b9f2022-09-05 11:18:04 +080073 ${MTK_PLAT_SOC}/drivers/apusys/mtk_apusys.c \
developer90b13412021-07-02 15:54:57 +080074 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm.c \
75 ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm_utils.c \
Rex-BC Chen17903042021-08-10 11:10:58 +080076 ${MTK_PLAT_SOC}/drivers/dfd/plat_dfd.c \
developere2be2dd2021-08-19 15:34:43 +080077 ${MTK_PLAT_SOC}/drivers/emi_mpu/emi_mpu.c \
developer912c7d22021-03-31 14:53:43 +080078 ${MTK_PLAT_SOC}/drivers/gpio/mtgpio.c \
developer037c99f2020-06-15 16:41:03 +080079 ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm.c \
80 ${MTK_PLAT_SOC}/drivers/mcdi/mt_cpu_pm_cpc.c \
81 ${MTK_PLAT_SOC}/drivers/mcdi/mt_mcdi.c \
developerfe14b9f2022-09-05 11:18:04 +080082 ${MTK_PLAT_SOC}/drivers/mcdi/mt_lp_irqremain.c \
developer912c7d22021-03-31 14:53:43 +080083 ${MTK_PLAT_SOC}/drivers/gpio/mtgpio.c \
developer2a56b2c2020-06-16 13:28:28 +080084 ${MTK_PLAT_SOC}/drivers/spmc/mtspmc.c \
developer8670d252021-03-19 22:13:11 +080085 ${MTK_PLAT_SOC}/plat_pm.c \
developerc0c07822021-03-29 16:50:30 +080086 ${MTK_PLAT_SOC}/plat_sip_calls.c \
developer8670d252021-03-19 22:13:11 +080087 ${MTK_PLAT_SOC}/plat_topology.c
88
Edward-JW Yang1c7fd0b2021-06-28 11:29:51 +080089# Build SPM drivers
90include ${MTK_PLAT_SOC}/drivers/spm/build.mk
91
developer8670d252021-03-19 22:13:11 +080092# Configs for A78 and A55
93HW_ASSISTED_COHERENCY := 1
94USE_COHERENT_MEM := 0
95CTX_INCLUDE_AARCH32_REGS := 0
96ERRATA_A55_1530923 := 1
97
Rex-BC Chen733885a2022-01-05 14:51:57 +080098ERRATA_A78_1688305 := 1
99ERRATA_A78_1941498 := 1
100ERRATA_A78_1951500 := 1
101ERRATA_A78_1821534 := 1
102ERRATA_A78_2132060 := 1
103ERRATA_A78_2242635 := 1
104
developer8670d252021-03-19 22:13:11 +0800105# indicate the reset vector address can be programmed
106PROGRAMMABLE_RESET_ADDRESS := 1
107
108COLD_BOOT_SINGLE_CPU := 1
109
110MACH_MT8195 := 1
111$(eval $(call add_define,MACH_MT8195))
112
113include lib/coreboot/coreboot.mk