From 3f8702a0d6934d602b68cd718f565fd1e60b3ff7 Mon Sep 17 00:00:00 2001 From: Vince Liu Date: Thu, 26 Dec 2024 10:57:27 +0800 Subject: [PATCH] soc/mediatek/mt8189: Add DPM v2 driver configuration MT8189 equips DPM hardware which is similar to MT8196. Therefore, we use the same DPM v2 loader to run the blob. BUG=b:379008996 BRANCH=none TEST=Make & Boot up pass and see log mtk_init_mcu: Loaded (and reset) dpm.dm in 19 msecs (1004 bytes) mtk_init_mcu: Loaded (and reset) dpm.pm in 19 msecs (36588 bytes) mtk_init_mcu: Loaded (and reset) dpm.dm in 7 msecs (1004 bytes) mtk_init_mcu: Loaded (and reset) dpm.pm in 19 msecs (36588 bytes) Signed-off-by: Mike.Lin Change-Id: I616cc0880d2db3f94b2a960b11d04974af1e94ef Reviewed-on: https://review.coreboot.org/c/coreboot/+/87662 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu Reviewed-by: Yidi Lin --- src/soc/mediatek/mt8189/Kconfig | 12 ++++++++++++ src/soc/mediatek/mt8189/Makefile.mk | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/soc/mediatek/mt8189/Kconfig b/src/soc/mediatek/mt8189/Kconfig index 1bbcb49344..8d5fcc69e0 100644 --- a/src/soc/mediatek/mt8189/Kconfig +++ b/src/soc/mediatek/mt8189/Kconfig @@ -24,4 +24,16 @@ config VBOOT select VBOOT_SEPARATE_VERSTAGE select VBOOT_RETURN_FROM_VERSTAGE +config DPM_DM_FIRMWARE + string + default "dpm.dm" + help + The file name of the MediaTek DPM DM firmware. + +config DPM_PM_FIRMWARE + string + default "dpm.pm" + help + The file name of the MediaTek DPM PM firmware. + endif diff --git a/src/soc/mediatek/mt8189/Makefile.mk b/src/soc/mediatek/mt8189/Makefile.mk index 915728ba1a..c870dec5c7 100644 --- a/src/soc/mediatek/mt8189/Makefile.mk +++ b/src/soc/mediatek/mt8189/Makefile.mk @@ -30,8 +30,10 @@ romstage-y += ../common/pmif_spmi.c pmif_spmi.c romstage-y += ../common/rtc.c ../common/rtc_osc_init.c ../common/rtc_mt6359p.c ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += ../common/bl31.c +ramstage-y += ../common/dpm.c ../common/dpm_v2.c ramstage-y += ../common/dramc_info.c ramstage-y += ../common/emi.c +ramstage-y += ../common/mcu.c ramstage-y += ../common/memory.c ramstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c ramstage-y += ../common/mt6315.c mt6315.c @@ -51,6 +53,17 @@ CPPFLAGS_common += -Isrc/soc/mediatek/common/include MT8189_BLOB_DIR := 3rdparty/blobs/soc/mediatek/mt8189 +firmware-files := \ + $(CONFIG_DPM_DM_FIRMWARE) \ + $(CONFIG_DPM_PM_FIRMWARE) + +$(foreach fw, $(call strip_quotes,$(firmware-files)), \ + $(eval $(fw)-file := $(MT8189_BLOB_DIR)/$(fw)) \ + $(eval $(fw)-type := raw) \ + $(eval $(fw)-compression := LZ4) \ + $(if $(wildcard $($(fw)-file)), $(eval cbfs-files-y += $(fw)), ) \ +) + DRAM_CBFS := $(CONFIG_CBFS_PREFIX)/dram $(DRAM_CBFS)-file := $(MT8189_BLOB_DIR)/dram.elf $(DRAM_CBFS)-type := stage