Gavin Liu | a65fadf | 2024-10-21 14:22:19 +0800 | [diff] [blame] | 1 | # |
Hope Wang | d4e6f98 | 2024-12-13 16:04:57 +0800 | [diff] [blame] | 2 | # Copyright (c) 2025, MediaTek Inc. All rights reserved. |
Gavin Liu | a65fadf | 2024-10-21 14:22:19 +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 | MTK_SOC := ${PLAT} |
| 10 | ARM_ARCH_MAJOR := 9 |
| 11 | |
| 12 | include plat/mediatek/build_helpers/mtk_build_helpers.mk |
| 13 | include drivers/arm/gic/v3/gicv3.mk |
| 14 | include lib/xlat_tables_v2/xlat_tables.mk |
| 15 | |
| 16 | PLAT_INCLUDES := -I${MTK_PLAT}/common \ |
Cathy Xu | 4cb9f2a | 2024-02-27 17:07:31 +0800 | [diff] [blame] | 17 | -I${MTK_PLAT}/drivers/gpio/ \ |
Gavin Liu | a65fadf | 2024-10-21 14:22:19 +0800 | [diff] [blame] | 18 | -I${MTK_PLAT}/include \ |
| 19 | -I${MTK_PLAT}/include/${ARCH_VERSION} \ |
| 20 | -I${MTK_PLAT} \ |
Cathy Xu | 4cb9f2a | 2024-02-27 17:07:31 +0800 | [diff] [blame] | 21 | -I${MTK_PLAT_SOC}/drivers/gpio/ \ |
Gavin Liu | a65fadf | 2024-10-21 14:22:19 +0800 | [diff] [blame] | 22 | -I${MTK_PLAT_SOC}/include \ |
| 23 | -Idrivers/arm/gic \ |
| 24 | |
| 25 | MODULES-y += $(MTK_PLAT)/common |
| 26 | MODULES-y += $(MTK_PLAT)/lib/mtk_init |
| 27 | MODULES-y += $(MTK_PLAT)/lib/pm |
Karl Li | f5a6aa0 | 2024-11-14 21:07:39 +0800 | [diff] [blame] | 28 | MODULES-y += $(MTK_PLAT)/drivers/apusys |
Mac Shen | 3e43d1d | 2024-12-10 14:15:20 +0800 | [diff] [blame] | 29 | MODULES-y += $(MTK_PLAT)/drivers/dp |
Gavin Liu | 39f5e27 | 2024-12-31 14:34:00 +0800 | [diff] [blame] | 30 | MODULES-y += $(MTK_PLAT)/drivers/emi |
Gavin Liu | a65fadf | 2024-10-21 14:22:19 +0800 | [diff] [blame] | 31 | MODULES-y += $(MTK_PLAT)/drivers/mcusys |
| 32 | MODULES-y += $(MTK_PLAT)/drivers/timer |
Xiangzhi Tang | a1763ae | 2024-11-01 09:31:11 +0800 | [diff] [blame] | 33 | MODULES-y += $(MTK_PLAT)/drivers/vcp |
Gavin Liu | a65fadf | 2024-10-21 14:22:19 +0800 | [diff] [blame] | 34 | MODULES-y += $(MTK_PLAT)/helpers |
| 35 | MODULES-y += $(MTK_PLAT)/topology |
Hope Wang | d4e6f98 | 2024-12-13 16:04:57 +0800 | [diff] [blame] | 36 | MODULES-$(CONFIG_MTK_PMIC) += $(MTK_PLAT)/drivers/pmic |
Hope Wang | adf73ae | 2024-12-13 16:21:01 +0800 | [diff] [blame] | 37 | MODULES-$(CONFIG_MTK_SPMI) += $(MTK_PLAT)/drivers/spmi |
Gavin Liu | a65fadf | 2024-10-21 14:22:19 +0800 | [diff] [blame] | 38 | |
Gavin Liu | e033943 | 2024-12-31 14:32:16 +0800 | [diff] [blame] | 39 | ifneq ($(MTKLIB_PATH),) |
| 40 | LDFLAGS += -L $(dir $(MTKLIB_PATH)) |
| 41 | LDLIBS += -l$(patsubst lib%.a,%,$(notdir $(MTKLIB_PATH))) |
| 42 | endif |
| 43 | |
Gavin Liu | a65fadf | 2024-10-21 14:22:19 +0800 | [diff] [blame] | 44 | PLAT_BL_COMMON_SOURCES := common/desc_image_load.c \ |
| 45 | drivers/ti/uart/aarch64/16550_console.S \ |
| 46 | lib/bl_aux_params/bl_aux_params.c |
| 47 | |
| 48 | BL31_SOURCES += drivers/delay_timer/delay_timer.c \ |
| 49 | drivers/delay_timer/generic_delay_timer.c \ |
Cathy Xu | 4cb9f2a | 2024-02-27 17:07:31 +0800 | [diff] [blame] | 50 | drivers/gpio/gpio.c \ |
Gavin Liu | a65fadf | 2024-10-21 14:22:19 +0800 | [diff] [blame] | 51 | lib/cpus/aarch64/cortex_a720.S \ |
| 52 | lib/cpus/aarch64/cortex_x4.S \ |
| 53 | lib/cpus/aarch64/cortex_x925.S \ |
| 54 | ${GICV3_SOURCES} \ |
| 55 | ${XLAT_TABLES_LIB_SRCS} \ |
| 56 | plat/common/plat_gicv3.c \ |
| 57 | plat/common/plat_psci_common.c \ |
| 58 | plat/common/aarch64/crash_console_helpers.S \ |
| 59 | ${MTK_PLAT}/common/mtk_plat_common.c \ |
| 60 | ${MTK_PLAT}/common/params_setup.c \ |
Cathy Xu | 4cb9f2a | 2024-02-27 17:07:31 +0800 | [diff] [blame] | 61 | ${MTK_PLAT}/drivers/gpio/mtgpio_common.c \ |
| 62 | $(MTK_PLAT)/$(MTK_SOC)/drivers/gpio/mtgpio.c \ |
Gavin Liu | a65fadf | 2024-10-21 14:22:19 +0800 | [diff] [blame] | 63 | $(MTK_PLAT)/$(MTK_SOC)/plat_mmap.c |
| 64 | |
| 65 | include plat/mediatek/build_helpers/mtk_build_helpers_epilogue.mk |
| 66 | |
| 67 | include lib/coreboot/coreboot.mk |