summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8183/rtc.c
diff options
context:
space:
mode:
authorWeiyi Lu <weiyi.lu@mediatek.com>2019-08-05 17:45:24 +0800
committerPatrick Georgi <pgeorgi@google.com>2019-09-04 10:56:09 +0000
commite78d140b1193f09d5510316d610283ee2f2c8b15 (patch)
treed912ee5d622a7cb1e6b04316eeca54f865ea8bde /src/soc/mediatek/mt8183/rtc.c
parentbcbf2deb42362232eb5e1414c5d99026f045e2e4 (diff)
downloadcoreboot-e78d140b1193f09d5510316d610283ee2f2c8b15.tar.xz
mediatek/mt8183: postpone dcxo low power mode setting
Consider the association between modem[1] and DCXO, this patch is a fix for eb5e47d("mediatek/mt8183: update dcxo output buffer setting") [2] We should not disable XO_CEL and block the bblpm request when modem is still ON. For power-saving, we still could disable unused XO_CEL and mask request to disable unused power mode when modem is no longer be used. [1] https://review.coreboot.org/c/coreboot/+/32666 [2] https://review.coreboot.org/c/coreboot/+/32323 BRANCH=none TEST=Boots correctly on Krane. Change-Id: I047ebed615e874977ca211aafd52b5551c71b764 Signed-off-by: Weiyi Lu <weiyi.lu@mediatek.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/34777 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'src/soc/mediatek/mt8183/rtc.c')
-rw-r--r--src/soc/mediatek/mt8183/rtc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/soc/mediatek/mt8183/rtc.c b/src/soc/mediatek/mt8183/rtc.c
index f8d81f8c39..19b717cc82 100644
--- a/src/soc/mediatek/mt8183/rtc.c
+++ b/src/soc/mediatek/mt8183/rtc.c
@@ -411,10 +411,9 @@ static void dcxo_init(void)
rtc_write(PMIC_RG_DCXO_CW16, 0x9855);
/* 26M enable control */
- /* Enable clock buffer XO_SOC */
- rtc_write(PMIC_RG_DCXO_CW00, 0x4005);
+ /* Enable clock buffer XO_SOC, XO_CEL */
+ rtc_write(PMIC_RG_DCXO_CW00, 0x4805);
rtc_write(PMIC_RG_DCXO_CW11, 0x8000);
- rtc_write(PMIC_RG_DCXO_CW23, 0x0053);
/* Load thermal coefficient */
rtc_write(PMIC_RG_TOP_TMA_KEY, 0x9CA7);
@@ -432,6 +431,14 @@ static void dcxo_init(void)
mdelay(5);
}
+void mt6358_dcxo_disable_unused(void)
+{
+ /* Disable clock buffer XO_CEL */
+ rtc_write(PMIC_RG_DCXO_CW00_CLR, 0x0800);
+ /* Mask bblpm */
+ rtc_write(PMIC_RG_DCXO_CW23, 0x0053);
+}
+
/* the rtc boot flow entry */
void rtc_boot(void)
{