Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 1 | # |
developer | 01abd6d | 2024-09-19 18:52:33 +0800 | [diff] [blame^] | 2 | # Copyright (c) 2021-2024, MediaTek Inc. All rights reserved. |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | MTK_PLAT := plat/mediatek |
| 8 | MTK_PLAT_SOC := ${MTK_PLAT}/${PLAT} |
| 9 | |
developer | 01abd6d | 2024-09-19 18:52:33 +0800 | [diff] [blame^] | 10 | # True Random Number Generator firmware Interface |
| 11 | TRNG_SUPPORT := 1 |
| 12 | |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 13 | PLAT_INCLUDES := -I${MTK_PLAT}/common/ \ |
developer | bdeb0ba | 2022-07-08 14:48:56 +0800 | [diff] [blame] | 14 | -I${MTK_PLAT}/drivers/cirq/ \ |
developer | fe14b9f | 2022-09-05 11:18:04 +0800 | [diff] [blame] | 15 | -I${MTK_PLAT}/drivers/gic600/ \ |
| 16 | -I${MTK_PLAT}/drivers/gpio/ \ |
developer | c9d2bfa | 2022-06-22 19:51:41 +0800 | [diff] [blame] | 17 | -I${MTK_PLAT}/drivers/msdc/ \ |
| 18 | -I${MTK_PLAT}/drivers/msdc/${PLAT} \ |
developer | 0e2a284 | 2022-09-01 15:16:23 +0800 | [diff] [blame] | 19 | -I${MTK_PLAT}/drivers/pmic_wrap/ \ |
developer | fe14b9f | 2022-09-05 11:18:04 +0800 | [diff] [blame] | 20 | -I${MTK_PLAT}/drivers/timer/ \ |
| 21 | -I${MTK_PLAT}/drivers/uart/ \ |
developer | 8c327e8 | 2022-05-29 22:25:44 +0800 | [diff] [blame] | 22 | -I${MTK_PLAT}/include/ \ |
developer | 92e7aec | 2023-01-06 14:53:37 +0800 | [diff] [blame] | 23 | -I${MTK_PLAT}/include/lpm \ |
jason-ch chen | fa82b9b | 2021-11-16 09:48:20 +0800 | [diff] [blame] | 24 | -I${MTK_PLAT_SOC}/drivers/spm/ \ |
Edward-JW Yang | 63582ec | 2021-11-01 20:20:18 +0800 | [diff] [blame] | 25 | -I${MTK_PLAT_SOC}/drivers/dcm/ \ |
developer | fe14b9f | 2022-09-05 11:18:04 +0800 | [diff] [blame] | 26 | -I${MTK_PLAT_SOC}/drivers/dfd/ \ |
Penny Jan | fb70fb4 | 2021-10-03 10:11:04 +0800 | [diff] [blame] | 27 | -I${MTK_PLAT_SOC}/drivers/emi_mpu/ \ |
developer | fe14b9f | 2022-09-05 11:18:04 +0800 | [diff] [blame] | 28 | -I${MTK_PLAT_SOC}/drivers/gpio/ \ |
developer | ba7b7d2 | 2021-11-14 10:14:45 +0800 | [diff] [blame] | 29 | -I${MTK_PLAT_SOC}/drivers/mcdi/ \ |
James Lo | 4ac7a41 | 2021-10-06 18:12:30 +0800 | [diff] [blame] | 30 | -I${MTK_PLAT_SOC}/drivers/pmic/ \ |
Yuchen Huang | ad04044 | 2021-11-12 16:56:33 +0800 | [diff] [blame] | 31 | -I${MTK_PLAT_SOC}/drivers/rtc/ \ |
developer | c3dabd8 | 2021-11-08 11:30:40 +0800 | [diff] [blame] | 32 | -I${MTK_PLAT_SOC}/drivers/spmc/ \ |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 33 | -I${MTK_PLAT_SOC}/include/ |
| 34 | |
Christine Zhu | ccd2600 | 2021-10-11 21:29:58 +0800 | [diff] [blame] | 35 | GICV3_SUPPORT_GIC600 := 1 |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 36 | include drivers/arm/gic/v3/gicv3.mk |
| 37 | include lib/xlat_tables_v2/xlat_tables.mk |
| 38 | |
| 39 | PLAT_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 | |
| 45 | BL31_SOURCES += common/desc_image_load.c \ |
Rex-BC Chen | 0bee8f9 | 2021-10-06 19:00:13 +0800 | [diff] [blame] | 46 | drivers/delay_timer/delay_timer.c \ |
Guodong Liu | 532016e | 2021-10-15 16:52:18 +0800 | [diff] [blame] | 47 | drivers/gpio/gpio.c \ |
Rex-BC Chen | 0bee8f9 | 2021-10-06 19:00:13 +0800 | [diff] [blame] | 48 | drivers/delay_timer/generic_delay_timer.c \ |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 49 | 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 Chen | abd9ecf | 2021-10-06 19:25:50 +0800 | [diff] [blame] | 55 | ${MTK_PLAT}/common/mtk_sip_svc.c \ |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 56 | ${MTK_PLAT}/common/params_setup.c \ |
developer | afdd96a | 2022-09-29 10:41:26 +0800 | [diff] [blame] | 57 | ${MTK_PLAT}/common/lpm/mt_lp_rm.c \ |
developer | bdeb0ba | 2022-07-08 14:48:56 +0800 | [diff] [blame] | 58 | ${MTK_PLAT}/drivers/cirq/mt_cirq.c \ |
developer | fe14b9f | 2022-09-05 11:18:04 +0800 | [diff] [blame] | 59 | ${MTK_PLAT}/drivers/gic600/mt_gic_v3.c \ |
| 60 | ${MTK_PLAT}/drivers/gpio/mtgpio_common.c \ |
developer | c9d2bfa | 2022-06-22 19:51:41 +0800 | [diff] [blame] | 61 | ${MTK_PLAT}/drivers/msdc/mt_msdc.c \ |
developer | fe14b9f | 2022-09-05 11:18:04 +0800 | [diff] [blame] | 62 | ${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 Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 66 | ${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 Yang | 63582ec | 2021-11-01 20:20:18 +0800 | [diff] [blame] | 69 | ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm.c \ |
| 70 | ${MTK_PLAT_SOC}/drivers/dcm/mtk_dcm_utils.c \ |
Rex-BC Chen | 1782ce9 | 2021-12-02 14:03:44 +0800 | [diff] [blame] | 71 | ${MTK_PLAT_SOC}/drivers/dfd/plat_dfd.c \ |
Penny Jan | fb70fb4 | 2021-10-03 10:11:04 +0800 | [diff] [blame] | 72 | ${MTK_PLAT_SOC}/drivers/emi_mpu/emi_mpu.c \ |
Guodong Liu | 532016e | 2021-10-15 16:52:18 +0800 | [diff] [blame] | 73 | ${MTK_PLAT_SOC}/drivers/gpio/mtgpio.c \ |
developer | ba7b7d2 | 2021-11-14 10:14:45 +0800 | [diff] [blame] | 74 | ${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 chen | fa82b9b | 2021-11-16 09:48:20 +0800 | [diff] [blame] | 77 | ${MTK_PLAT_SOC}/drivers/mcdi/mt_lp_irqremain.c \ |
James Lo | 4ac7a41 | 2021-10-06 18:12:30 +0800 | [diff] [blame] | 78 | ${MTK_PLAT_SOC}/drivers/pmic/pmic.c \ |
Yuchen Huang | ad04044 | 2021-11-12 16:56:33 +0800 | [diff] [blame] | 79 | ${MTK_PLAT_SOC}/drivers/rtc/rtc.c \ |
developer | c3dabd8 | 2021-11-08 11:30:40 +0800 | [diff] [blame] | 80 | ${MTK_PLAT_SOC}/drivers/spmc/mtspmc.c \ |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 81 | ${MTK_PLAT_SOC}/plat_pm.c \ |
Rex-BC Chen | abd9ecf | 2021-10-06 19:25:50 +0800 | [diff] [blame] | 82 | ${MTK_PLAT_SOC}/plat_sip_calls.c \ |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 83 | ${MTK_PLAT_SOC}/plat_topology.c |
| 84 | |
developer | 01abd6d | 2024-09-19 18:52:33 +0800 | [diff] [blame^] | 85 | ifeq (${TRNG_SUPPORT},1) |
| 86 | BL31_SOURCES += ${MTK_PLAT}/drivers/rng/rng.c \ |
| 87 | ${MTK_PLAT}/drivers/rng/${PLAT}/rng_plat.c |
| 88 | endif |
| 89 | |
jason-ch chen | fa82b9b | 2021-11-16 09:48:20 +0800 | [diff] [blame] | 90 | # Build SPM drivers |
| 91 | include ${MTK_PLAT_SOC}/drivers/spm/build.mk |
| 92 | |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 93 | # Configs for A76 and A55 |
| 94 | HW_ASSISTED_COHERENCY := 1 |
| 95 | USE_COHERENT_MEM := 0 |
| 96 | CTX_INCLUDE_AARCH32_REGS := 0 |
| 97 | ERRATA_A55_1530923 := 1 |
| 98 | ERRATA_A55_1221012 := 1 |
| 99 | |
Rex-BC Chen | 4a1570a | 2021-11-25 18:55:04 +0800 | [diff] [blame] | 100 | ERRATA_A76_1257314 := 1 |
| 101 | ERRATA_A76_1262606 := 1 |
| 102 | ERRATA_A76_1262888 := 1 |
| 103 | ERRATA_A76_1275112 := 1 |
| 104 | ERRATA_A76_1286807 := 1 |
| 105 | ERRATA_A76_1791580 := 1 |
| 106 | ERRATA_A76_1165522 := 1 |
| 107 | ERRATA_A76_1868343 := 1 |
| 108 | ERRATA_A76_1946160 := 1 |
| 109 | |
Rex-BC Chen | 749b211 | 2021-09-28 11:24:09 +0800 | [diff] [blame] | 110 | # indicate the reset vector address can be programmed |
| 111 | PROGRAMMABLE_RESET_ADDRESS := 1 |
| 112 | |
| 113 | COLD_BOOT_SINGLE_CPU := 1 |
| 114 | |
| 115 | MACH_MT8186 := 1 |
| 116 | $(eval $(call add_define,MACH_MT8186)) |
| 117 | |
| 118 | include lib/coreboot/coreboot.mk |