mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-01-22 01:30:35 -05:00
iMX233 RTC init: make clock source (32kHz/24MHz) explicit for targets
Change-Id: Ib4fa56ad8ee28f3799b6c6c3c058d156353dd15c
This commit is contained in:
parent
2f2b90535a
commit
873163c671
1 changed files with 15 additions and 8 deletions
|
|
@ -86,23 +86,30 @@ static inline void imx233_rtc_init(void)
|
|||
BF_CLR(RTC_CTRL, SFTRST);
|
||||
udelay(5); /* only need 3 GPMI clocks (1us) */
|
||||
BF_CLR(RTC_CTRL, CLKGATE);
|
||||
/* TODO: classify other imx233/STMP37xx/STMP36xx targets
|
||||
* (e.g. CREATIVE_ZENXFI, CREATIVE_ZENV, SONY_NWZE360, SONY_NWZE370) */
|
||||
#if defined(SANSA_FUZEPLUS)
|
||||
#ifdef BM_RTC_PERSISTENT0_DISABLE_XTALOK
|
||||
/* RTC runs on 24MHz crystal */
|
||||
# if IMX233_SUBTARGET >= 3700
|
||||
while (BF_RD(RTC_STAT, NEW_REGS)!=0) {};
|
||||
BF_SET(RTC_PERSISTENT0, XTAL24MHZ_PWRUP, DISABLE_XTALOK);
|
||||
#endif
|
||||
# endif
|
||||
while (BF_RD(RTC_STAT, NEW_REGS)!=0) {};
|
||||
BF_CLR(RTC_PERSISTENT0, CLOCKSOURCE);
|
||||
#else
|
||||
/* confirmed for CREATIVE_ZEN and CREATIVE_ZENXFI2 */
|
||||
/* FIXME: test SONY_NWZE360 and SONY_NWZE370 targets */
|
||||
#ifdef BM_RTC_PERSISTENT0_DISABLE_XTALOK
|
||||
#elif defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI2)
|
||||
/* RTC runs on 32.768 kHz crystal */
|
||||
# if IMX233_SUBTARGET >= 3700
|
||||
while (BF_RD(RTC_STAT, NEW_REGS)!=0) {};
|
||||
BF_SET(RTC_PERSISTENT0, XTAL32KHZ_PWRUP, CLOCKSOURCE);
|
||||
while (BF_RD(RTC_STAT, NEW_REGS)!=0) {};
|
||||
BF_CLR(RTC_PERSISTENT0, XTAL24MHZ_PWRUP, DISABLE_XTALOK);
|
||||
#endif
|
||||
#endif
|
||||
# else
|
||||
while (BF_RD(RTC_STAT, NEW_REGS)!=0) {};
|
||||
BF_CLR(RTC_PERSISTENT0, XTAL32_PDOWN);
|
||||
while (BF_RD(RTC_STAT, NEW_REGS)!=0) {};
|
||||
BF_SET(RTC_PERSISTENT0, XTAL24_PDOWN, CLOCKSOURCE);
|
||||
# endif
|
||||
#endif /* defined(target name) */
|
||||
imx233_rtc_enable_watchdog(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue