From fe3420644216af4a6eea55ba41277348413b2186 Mon Sep 17 00:00:00 2001 From: Vince Liu Date: Mon, 12 May 2025 14:09:37 +0800 Subject: [PATCH] soc/mediatek/mt8189: Add audio/display bus protection release functions Add audio and display bus protection release functions to enable audio and display subsystems. These functions should be called after mtcmos_audio_power_on() and mtcmos_display_power_on() respectively. BUG=b:379008996 BRANCH=none TEST=build pass and driver init ok. Signed-off-by: Irving-CH.lin Change-Id: Idb9d6e7b3adac275ccbcb71e22126eed88149d0d Reviewed-on: https://review.coreboot.org/c/coreboot/+/87640 Tested-by: build bot (Jenkins) Reviewed-by: Yidi Lin Reviewed-by: Yu-Ping Wu --- src/soc/mediatek/mt8189/mtcmos.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/soc/mediatek/mt8189/mtcmos.c b/src/soc/mediatek/mt8189/mtcmos.c index 2f10517886..8b89e58ad2 100644 --- a/src/soc/mediatek/mt8189/mtcmos.c +++ b/src/soc/mediatek/mt8189/mtcmos.c @@ -80,3 +80,24 @@ void mtcmos_init(void) for (i = 0; i < ARRAY_SIZE(pd_plat); i++) mtcmos_power_on(&pd_plat[i]); } + +void mtcmos_protect_audio_bus(void) +{ + write32(&mtk_infracfg_ao->perisys_protect.clr, BIT(6)); + + /* AUDIO CG Clear */ + clrbits32(&mtk_afe->audio_audio_top[0], 0x03364F80); + clrbits32(&mtk_afe->audio_audio_top[1], 0x00F000FF); + clrbits32(&mtk_afe->audio_audio_top[2], 0x01323000); + clrbits32(&mtk_afe->audio_audio_top[3], 0x03F00000); + clrbits32(&mtk_afe->audio_audio_top[4], 0x0000301F); +} + +void mtcmos_protect_display_bus(void) +{ + write32(&mtk_infracfg_ao->mmsys_protect[0].clr, BIT(1) | BIT(0)); + + /* MMSYS_CONFIG CG Clear */ + write32(&mtk_mmsys_config->mmsys_config_mmsys_cg_0_clr, 0xFF7FFFFF); + write32(&mtk_mmsys_config->mmsys_config_mmsys_cg_1_clr, 0x0000007B); +}