soc/mediatek/mt8196: Fix RTC recovery by disabling external XTAL

Configure PMIC register 0x50c bit0 which decides whether to use external
xtal. This bit of mt6685 should be set to 1, to disable external xtal.

BRANCH=rauru
BUG=b:395485005
TEST=emerge-rauru coreboot chromeos-bootimage, remove battery and
charger, then insert battery and charge, RTC boots normally.

Signed-off-by: Shunxi Zhang <ot_shunxi.zhang@mediatek.com>
Change-Id: Iea44f13af030f24c02993dd43a35a9d8b4f72179
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86353
Reviewed-by: Shunxi Zhang <ot_shunxi.zhang@mediatek.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
This commit is contained in:
Shunxi Zhang 2025-02-10 16:47:28 +08:00 committed by Yidi Lin
commit d669736841

View file

@ -345,6 +345,10 @@ static void rtc_recovery_flow(void)
{
printk(BIOS_INFO, "%s: enter\n", __func__);
config_interface(SCK_TOP_XTAL_SEL_ADDR, 1, SCK_TOP_XTAL_SEL_MASK,
SCK_TOP_XTAL_SEL_SHIFT);
udelay(100);
if (!retry(RECOVERY_RETRY_COUNT,
rtc_frequency_meter_check() &&
rtc_init_after_recovery())) {