soc/mediatek/common: Correct MT6359 RTC EOSC setting
According to the MT6359 datasheet, set the RTC EOSC calibration period to 8 seconds to ensure that the power source VXO22 in the MT6359 meets the expected power sequence in AP power-off mode. BUG=b:397292746 BRANCH=none TEST=build pass & boot pass Change-Id: I4043f4e82baeb8e0358e74dd6d088895e4deb0f4 Signed-off-by: Shunxi Zhang <ot_shunxi.zhang@mediatek.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/87705 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yidi Lin <yidilin@google.com>
This commit is contained in:
parent
ae2f3ab153
commit
b9a4d6ede1
2 changed files with 9 additions and 0 deletions
|
|
@ -72,6 +72,10 @@ enum {
|
|||
RTC_TC_MTH_MASK = 0xf,
|
||||
};
|
||||
|
||||
enum {
|
||||
RTC_EOSC_CALI_TD_DEFAULT = 6U << 5,
|
||||
};
|
||||
|
||||
enum {
|
||||
RTC_K_EOSC_RSV_0 = 1 << 8,
|
||||
RTC_K_EOSC_RSV_1 = 1 << 9,
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ int rtc_init(int recover)
|
|||
{
|
||||
int ret;
|
||||
u16 year;
|
||||
u16 al_dow;
|
||||
|
||||
rtc_info("recovery: %d\n", recover);
|
||||
|
||||
|
|
@ -256,6 +257,10 @@ int rtc_init(int recover)
|
|||
goto err;
|
||||
}
|
||||
|
||||
/* RTC EOSC calibration period setting and day-of-week value of alarm counter setting */
|
||||
rtc_read(RTC_AL_DOW, &al_dow);
|
||||
rtc_write(RTC_AL_DOW, al_dow | RTC_EOSC_CALI_TD_DEFAULT);
|
||||
|
||||
/* solution1 for EOSC cali*/
|
||||
rtc_read(RTC_AL_YEA, &year);
|
||||
rtc_write(RTC_AL_YEA, (year | RTC_K_EOSC_RSV_0) & (~RTC_K_EOSC_RSV_1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue