Martin Roth | 9231f0b | 2022-10-28 22:39:23 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 2 | ifeq ($(CONFIG_SOC_MEDIATEK_MT8188),y) |
| 3 | |
Rex-BC Chen | f615576 | 2022-06-13 19:10:02 +0800 | [diff] [blame] | 4 | all-y += ../common/flash_controller.c |
Guodong Liu | ccaafdf | 2022-06-11 10:37:47 +0800 | [diff] [blame] | 5 | all-y += ../common/gpio.c ../common/gpio_op.c gpio.c |
kewei.xu | 2680eec | 2022-06-28 17:33:04 +0800 | [diff] [blame] | 6 | all-y += ../common/i2c.c i2c.c |
garmin chang | 4e8a1ec | 2022-06-08 14:20:58 +0800 | [diff] [blame] | 7 | all-y += ../common/pll.c pll.c |
Liya Li | 0d13e80 | 2022-07-23 14:23:04 +0800 | [diff] [blame] | 8 | all-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c |
Yidi Lin | db95b24 | 2023-08-02 12:48:04 +0800 | [diff] [blame] | 9 | all-y += timer.c ../common/timer_prepare.c |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 10 | all-y += ../common/uart.c |
| 11 | |
Yidi Lin | c68176c | 2024-01-16 15:08:41 +0800 | [diff] [blame] | 12 | bootblock-y += ../common/bootblock.c bootblock.c |
Johnson Wang | 159e64c | 2022-11-11 17:31:49 +0800 | [diff] [blame] | 13 | bootblock-y += ../common/eint_event.c |
ot_zhenguo.li | 6bd9d95 | 2023-02-24 13:55:27 +0800 | [diff] [blame] | 14 | bootblock-y += ../common/lastbus_v2.c lastbus.c |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 15 | bootblock-y += ../common/mmu_operations.c |
Rex-BC Chen | 1dcc669 | 2022-08-04 15:21:48 +0800 | [diff] [blame] | 16 | bootblock-y += ../common/tracker.c ../common/tracker_v2.c |
Bo-Chen Chen | 22d30c4 | 2022-07-04 19:46:33 +0800 | [diff] [blame] | 17 | bootblock-y += ../common/wdt.c ../common/wdt_req.c wdt.c |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 18 | |
| 19 | romstage-y += ../common/cbmem.c |
Song Fan | 86dde5f | 2022-07-25 18:27:44 +0800 | [diff] [blame] | 20 | romstage-y += ../common/clkbuf.c |
Xi Chen | 22ce1e8 | 2022-07-28 13:43:51 +0800 | [diff] [blame] | 21 | romstage-y += ../common/dram_init.c |
| 22 | romstage-y += ../common/dramc_param.c |
Xi Chen | 3729b1c | 2022-08-15 10:18:04 +0800 | [diff] [blame] | 23 | romstage-y += ../common/emi.c |
Xi Chen | 22ce1e8 | 2022-07-28 13:43:51 +0800 | [diff] [blame] | 24 | romstage-y += ../common/memory.c |
| 25 | romstage-y += ../common/memory_test.c |
Rex-BC Chen | 29f1866 | 2022-06-15 11:49:16 +0800 | [diff] [blame] | 26 | romstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c |
Hui Liu | f1d9e42 | 2022-07-05 14:59:03 +0800 | [diff] [blame] | 27 | romstage-y += ../common/mt6315.c mt6315.c |
| 28 | romstage-y += ../common/mt6359p.c mt6359p.c |
| 29 | romstage-y += ../common/pmif.c ../common/pmif_clk.c pmif_clk.c |
| 30 | romstage-y += ../common/pmif_spi.c pmif_spi.c |
| 31 | romstage-y += ../common/pmif_spmi.c pmif_spmi.c |
Song Fan | 11089e2 | 2022-07-25 18:18:35 +0800 | [diff] [blame] | 32 | romstage-y += ../common/rtc.c ../common/rtc_osc_init.c ../common/rtc_mt6359p.c |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 33 | |
Hui Liu | feb573e | 2022-07-25 14:51:36 +0800 | [diff] [blame] | 34 | ramstage-y += ../common/auxadc.c |
Bo-Chen Chen | bc18fb3 | 2022-09-06 14:41:57 +0800 | [diff] [blame] | 35 | ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += ../common/bl31.c |
Liju-Clr Chen | 5ab991d | 2022-11-01 10:35:33 +0800 | [diff] [blame] | 36 | ramstage-y += cpu_input_gating.c |
Nathan Lu | 4ac8598 | 2022-09-26 14:11:32 +0800 | [diff] [blame] | 37 | ramstage-y += ../common/ddp.c ddp.c |
Nina Wu | c0797f5 | 2022-08-18 11:13:31 +0800 | [diff] [blame] | 38 | ramstage-y += ../common/devapc.c devapc.c |
Rex-BC Chen | c3d2e9c | 2022-08-04 17:11:22 +0800 | [diff] [blame] | 39 | ramstage-y += ../common/dfd.c |
Yidi Lin | ba604b5 | 2024-01-03 16:07:24 +0800 | [diff] [blame] | 40 | ramstage-y += ../common/display.c |
Bo-Chen Chen | 8a604bd | 2022-09-29 17:31:23 +0800 | [diff] [blame] | 41 | ramstage-y += ../common/dp/dp_intf.c ../common/dp/dptx.c ../common/dp/dptx_hal.c dp_intf.c |
Xi Chen | df03961 | 2022-08-18 11:23:26 +0800 | [diff] [blame] | 42 | ramstage-y += ../common/dpm.c |
| 43 | ramstage-$(CONFIG_DPM_FOUR_CHANNEL) += ../common/dpm_4ch.c |
Bo-Chen Chen | 35693c5 | 2022-11-23 17:24:25 +0800 | [diff] [blame] | 44 | ramstage-y += ../common/dsi.c ../common/mtk_mipi_dphy.c |
Xi Chen | 3729b1c | 2022-08-15 10:18:04 +0800 | [diff] [blame] | 45 | ramstage-y += ../common/emi.c |
Rex-BC Chen | 0c7a0f9 | 2022-07-22 11:09:55 +0800 | [diff] [blame] | 46 | ramstage-y += ../common/mcu.c |
| 47 | ramstage-y += ../common/mcupm.c |
Rex-BC Chen | 29f1866 | 2022-06-15 11:49:16 +0800 | [diff] [blame] | 48 | ramstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c |
Andy-ld Lu | eb2a111 | 2022-07-13 21:10:16 +0800 | [diff] [blame] | 49 | ramstage-$(CONFIG_COMMONLIB_STORAGE_MMC) += ../common/msdc.c msdc.c |
Hui Liu | 8ba3e34 | 2022-07-15 13:58:09 +0800 | [diff] [blame] | 50 | ramstage-y += ../common/mt6359p.c mt6359p.c |
Bo-Chen Chen | f09872c | 2022-09-29 18:45:37 +0800 | [diff] [blame] | 51 | ramstage-y += ../common/mtcmos.c mtcmos.c |
Hui Liu | 8ba3e34 | 2022-07-15 13:58:09 +0800 | [diff] [blame] | 52 | ramstage-y += ../common/pmif.c ../common/pmif_clk.c pmif_clk.c |
| 53 | ramstage-y += ../common/pmif_spi.c pmif_spi.c |
Rex-BC Chen | d7b7460 | 2023-01-17 11:04:58 +0800 | [diff] [blame] | 54 | ramstage-y += ../common/pmif_spmi.c pmif_spmi.c |
Liju-Clr Chen | c5b32ee | 2022-11-10 16:51:45 +0800 | [diff] [blame] | 55 | ramstage-y += ../common/rtc.c ../common/rtc_osc_init.c ../common/rtc_mt6359p.c |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 56 | ramstage-y += soc.c |
Rex-BC Chen | c23235e | 2022-08-10 18:23:01 +0800 | [diff] [blame] | 57 | ramstage-y += ../common/spm.c spm.c |
Rex-BC Chen | 202f60b | 2022-07-22 13:41:45 +0800 | [diff] [blame] | 58 | ramstage-y += ../common/sspm.c |
Ruihai Zhou | 4a60418 | 2023-05-29 20:27:06 +0800 | [diff] [blame] | 59 | ramstage-y += ../common/tps65132s.c |
Shaocheng Wang | 15e5a3b | 2022-07-05 15:41:18 +0800 | [diff] [blame] | 60 | ramstage-y += ../common/usb.c usb.c |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 61 | |
kiwi liu | 4bd1236 | 2023-11-01 15:07:33 +0800 | [diff] [blame] | 62 | BL31_MAKEARGS += PLAT=mt8188 SPD=opteed |
| 63 | BL31_MAKEARGS += OPTEE_ALLOW_SMC_LOAD=1 PLAT_XLAT_TABLES_DYNAMIC=1 |
Rex-BC Chen | 7329653 | 2022-07-07 17:29:19 +0800 | [diff] [blame] | 64 | |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 65 | CPPFLAGS_common += -Isrc/soc/mediatek/mt8188/include |
Bo-Chen Chen | 8a604bd | 2022-09-29 17:31:23 +0800 | [diff] [blame] | 66 | CPPFLAGS_common += -Isrc/soc/mediatek/common/dp/include |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 67 | CPPFLAGS_common += -Isrc/soc/mediatek/common/include |
| 68 | |
Rex-BC Chen | 0c7a0f9 | 2022-07-22 11:09:55 +0800 | [diff] [blame] | 69 | MT8188_BLOB_DIR := 3rdparty/blobs/soc/mediatek/mt8188 |
| 70 | |
| 71 | mcu-firmware-files := \ |
Xi Chen | cd37368 | 2022-08-18 11:46:18 +0800 | [diff] [blame] | 72 | $(CONFIG_DPM_DM_FIRMWARE) \ |
| 73 | $(CONFIG_DPM_PM_FIRMWARE) \ |
Rex-BC Chen | 202f60b | 2022-07-22 13:41:45 +0800 | [diff] [blame] | 74 | $(CONFIG_MCUPM_FIRMWARE) \ |
Rex-BC Chen | c23235e | 2022-08-10 18:23:01 +0800 | [diff] [blame] | 75 | $(CONFIG_SPM_FIRMWARE) \ |
Rex-BC Chen | 202f60b | 2022-07-22 13:41:45 +0800 | [diff] [blame] | 76 | $(CONFIG_SSPM_FIRMWARE) |
Rex-BC Chen | 0c7a0f9 | 2022-07-22 11:09:55 +0800 | [diff] [blame] | 77 | |
| 78 | $(foreach fw, $(call strip_quotes,$(mcu-firmware-files)), \ |
| 79 | $(eval $(fw)-file := $(MT8188_BLOB_DIR)/$(fw)) \ |
| 80 | $(eval $(fw)-type := raw) \ |
| 81 | $(eval $(fw)-compression := LZ4) \ |
| 82 | $(if $(wildcard $($(fw)-file)), $(eval cbfs-files-y += $(fw)), ) \ |
| 83 | ) |
| 84 | |
Xi Chen | 22ce1e8 | 2022-07-28 13:43:51 +0800 | [diff] [blame] | 85 | DRAM_CBFS := $(CONFIG_CBFS_PREFIX)/dram |
| 86 | $(DRAM_CBFS)-file := $(MT8188_BLOB_DIR)/dram.elf |
| 87 | $(DRAM_CBFS)-type := stage |
| 88 | $(DRAM_CBFS)-compression := $(CBFS_PRERAM_COMPRESS_FLAG) |
| 89 | ifneq ($(wildcard $($(DRAM_CBFS)-file)),) |
| 90 | cbfs-files-y += $(DRAM_CBFS) |
| 91 | endif |
| 92 | |
Rex-BC Chen | 3f83c6f | 2022-05-24 19:45:59 +0800 | [diff] [blame] | 93 | $(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin |
| 94 | ./util/mtkheader/gen-bl-img.py mt8183 sf $< $@ |
| 95 | |
| 96 | endif |