Yidi Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/86353?usp=email )
Change subject: soc/mediatek/mt8196: Fix RTC recovery by disabling external XTAL ......................................................................
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 --- M src/soc/mediatek/mt8196/mt6685_rtc.c 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: Yu-Ping Wu: Looks good to me, approved Yidi Lin: Looks good to me, approved build bot (Jenkins): Verified Shunxi Zhang: Looks good to me, but someone else must approve
diff --git a/src/soc/mediatek/mt8196/mt6685_rtc.c b/src/soc/mediatek/mt8196/mt6685_rtc.c index 4564a31..4e63f10 100644 --- a/src/soc/mediatek/mt8196/mt6685_rtc.c +++ b/src/soc/mediatek/mt8196/mt6685_rtc.c @@ -345,6 +345,10 @@ { 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())) {