From bdd4561536380b19880d48d9271ff4d831e36226 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Thu, 9 Oct 2025 13:48:38 +0800 Subject: [PATCH] soc/mediatek/mt8196: Add mtk_ddp_ovlsys_start for rendering framebuffer Implement mtk_ddp_ovlsys_start in order to render the logo in coreboot. The implementation is ported from depthcharge[1]. [1]: https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/heads/main/src/drivers/video/mtk_ddp.c BUG=b:319511268 TEST=Draw the logo in ramstage Change-Id: I37f929b85d4df818163e3af364038631f7b4623d Signed-off-by: Yidi Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/89542 Reviewed-by: Hung-Te Lin Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/soc/mediatek/common/include/soc/display.h | 1 + src/soc/mediatek/mt8196/ddp.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/soc/mediatek/common/include/soc/display.h b/src/soc/mediatek/common/include/soc/display.h index a874412aff..fdcfcfdef2 100644 --- a/src/soc/mediatek/common/include/soc/display.h +++ b/src/soc/mediatek/common/include/soc/display.h @@ -33,5 +33,6 @@ int mtk_display_init(void); void mtk_ddp_init(void); void mtk_ddp_mode_set(const struct edid *edid, enum disp_path_sel path); +void mtk_ddp_ovlsys_start(uintptr_t fb_addr); #endif diff --git a/src/soc/mediatek/mt8196/ddp.c b/src/soc/mediatek/mt8196/ddp.c index 9453622a6e..6e57e78301 100644 --- a/src/soc/mediatek/mt8196/ddp.c +++ b/src/soc/mediatek/mt8196/ddp.c @@ -310,3 +310,11 @@ void mtk_ddp_mode_set(const struct edid *edid, enum disp_path_sel path) main_disp_path_setup(width, height, vrefresh, path); ovlsys_layer_config(fmt, bpp, width, height); } + +void mtk_ddp_ovlsys_start(uintptr_t fb_addr) +{ + write32(&exdma2_reg->ovl_addr, fb_addr); + setbits32(&exdma2_reg->ovl_en, BIT(0)); + setbits32(&exdma2_reg->ovl_l_en, BIT(0)); + setbits32(&blenders[0]->bld_l_en, BIT(0)); +}