soc/mediatek: Move mtk_dsi_reset() to mtk_dsi_common.c for reuse

Move mtk_dsi_reset() from mtk_mipi_dphy.c to mtk_dsi_common.c so that it
can also be used when using the C-PHY interface, improving code reuse.

BUG=b:433422905,b:428854543
BRANCH=skywaler
TEST=build passed

Signed-off-by: Vince Liu <vince-wl.liu@mediatek.corp-partner.google.com>
Change-Id: I3f080127af4411584f66e307f7d2b13abbb051bf
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89619
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
Vince Liu 2025-10-17 11:03:56 +08:00 committed by Yu-Ping Wu
commit 6ffbc9a929
6 changed files with 16 additions and 8 deletions

View file

@ -0,0 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
#include <device/mmio.h>
#include <soc/dsi.h>
void mtk_dsi_reset(void)
{
write32(&dsi0->dsi_force_commit,
DSI_FORCE_COMMIT_USE_MMSYS | DSI_FORCE_COMMIT_ALWAYS);
write32(&dsi0->dsi_con_ctrl, 1);
write32(&dsi0->dsi_con_ctrl, 0);
}

View file

@ -61,11 +61,3 @@ void mtk_dsi_configure_mipi_tx(u32 data_rate, u32 lanes)
setbits32(&mipi_tx->ck_ckmode_en, DSI_CK_CKMODE_EN);
}
void mtk_dsi_reset(void)
{
write32(&dsi0->dsi_force_commit,
DSI_FORCE_COMMIT_USE_MMSYS | DSI_FORCE_COMMIT_ALWAYS);
write32(&dsi0->dsi_con_ctrl, 1);
write32(&dsi0->dsi_con_ctrl, 0);
}

View file

@ -55,6 +55,7 @@ ramstage-y += ../common/i2c.c i2c.c
ramstage-y += ../common/mcu.c
ramstage-y += ../common/mmu_operations.c mmu_operations.c
ramstage-y += ../common/mtcmos.c mtcmos.c
ramstage-y += ../common/mtk_dsi_common.c
ramstage-y += ../common/pmic_wrap.c
ramstage-y += ../common/rtc.c ../common/rtc_pwrap_ops.c ../common/rtc_osc_init.c rtc.c
ramstage-y += soc.c

View file

@ -47,6 +47,7 @@ ramstage-y += ../common/mcu.c
ramstage-y += ../common/mmu_operations.c
ramstage-$(CONFIG_COMMONLIB_STORAGE_MMC) += ../common/msdc.c msdc.c
ramstage-y += ../common/mtcmos.c mtcmos.c
ramstage-y += ../common/mtk_dsi_common.c
ramstage-y += ../common/pmic_wrap.c pmic_wrap.c pmif.c mt6366.c
ramstage-y += ../common/rtc.c ../common/rtc_pwrap_ops.c ../common/rtc_osc_init.c rtc.c
ramstage-y += soc.c

View file

@ -54,6 +54,7 @@ ramstage-y += ../common/mmu_operations.c
ramstage-$(CONFIG_COMMONLIB_STORAGE_MMC) += ../common/msdc.c msdc.c
ramstage-y += ../common/mt6359p.c mt6359p.c
ramstage-y += ../common/mtcmos.c mtcmos.c
ramstage-y += ../common/mtk_dsi_common.c
ramstage-y += ../common/pmif.c ../common/pmif_clk.c ../common/pmif_init.c pmif_clk.c
ramstage-y += ../common/pmif_spi.c pmif_spi.c
ramstage-y += ../common/pmif_spmi.c ../common/pmif_spmi_v1.c pmif_spmi.c

View file

@ -47,6 +47,7 @@ ramstage-y += ../common/mcupm.c
ramstage-y += ../common/mmu_operations.c
ramstage-$(CONFIG_COMMONLIB_STORAGE_MMC) += ../common/msdc.c msdc.c
ramstage-y += ../common/mtcmos.c mtcmos.c
ramstage-y += ../common/mtk_dsi_common.c
ramstage-y += ../common/pmif.c ../common/pmif_init.c
ramstage-y += ../common/rtc.c ../common/rtc_mt6359p.c
ramstage-y += soc.c