From ba5b5ea406c72570552d9b69946d669420b879c3 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Thu, 18 Dec 2025 17:03:24 +0800 Subject: [PATCH] soc/mediatek/mt8196: Move DPM and SPM initialization Move dpm_init() and spm_init() from mainboard_init() in rauru to soc_init() in mt8196. This centralizes the power management initialization within the SoC-specific code. BUG=none TEST=Build pass, boot ok. Change-Id: Ic2914fd0fc85032c96ce076416e9b9c46fe19e0d Signed-off-by: Yidi Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/90550 Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) Reviewed-by: Chen-Tsung Hsieh --- src/mainboard/google/rauru/mainboard.c | 8 -------- src/soc/mediatek/mt8196/soc.c | 14 +++++++++++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/mainboard/google/rauru/mainboard.c b/src/mainboard/google/rauru/mainboard.c index d0ed3ad7f7..93489426b8 100644 --- a/src/mainboard/google/rauru/mainboard.c +++ b/src/mainboard/google/rauru/mainboard.c @@ -7,13 +7,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -128,12 +126,6 @@ static void mainboard_init(struct device *dev) if (CONFIG(RAURU_SDCARD_INIT)) mtk_msdc_configure_sdcard(); - if (dpm_init()) - printk(BIOS_ERR, "dpm init failed, DVFS may not work\n"); - - if (spm_init()) - printk(BIOS_ERR, "spm init failed, Suspend may not work\n"); - if (CONFIG(ARM64_USE_ARM_TRUSTED_FIRMWARE)) register_reset_to_bl31(GPIO_AP_EC_WARM_RST_REQ.id, true); } diff --git a/src/soc/mediatek/mt8196/soc.c b/src/soc/mediatek/mt8196/soc.c index bacbe0c2c5..24077a0fbc 100644 --- a/src/soc/mediatek/mt8196/soc.c +++ b/src/soc/mediatek/mt8196/soc.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -14,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -54,7 +56,7 @@ static void mte_setup(void) booker_mte_init(mte_start); } -static void soc_init(struct device *dev) +static void fsp_init(void) { uint32_t storage_type = mainboard_get_storage_type(); @@ -63,8 +65,18 @@ static void soc_init(struct device *dev) mtk_fsp_add_param(FSP_PARAM_TYPE_STORAGE, sizeof(storage_type), &storage_type); pi_image_add_mtk_fsp_params(); mtk_fsp_load_and_run(); +} +static void soc_init(struct device *dev) +{ mtk_mmu_disable_l2c_sram(); + + if (dpm_init()) + printk(BIOS_ERR, "dpm init failed, DVFS may not work\n"); + if (spm_init()) + printk(BIOS_ERR, "spm init failed, Suspend may not work\n"); + + fsp_init(); sspm_init(); gpueb_init(); mcupm_init();