mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 13:45:03 -05:00
Creative ZEN: fix RTC regression
Creative ZEN lost it's time when shutting down. The bug was introduced with commit7f282b9280(g#2601), followed bye3f6e9d9f6(g#2616). I guarded all persistent register writes with wait loops, as described in the datasheet. TODO: test SONY_NWZE360 and SONY_NWZE370 targets Change-Id: Ib38ab8691fd1c6e8d0771c1e2eca20dfeb6fc87f
This commit is contained in:
parent
69bc230e7d
commit
297af3a483
2 changed files with 13 additions and 2 deletions
|
|
@ -86,10 +86,21 @@ 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);
|
||||
#if defined(SANSA_FUZEPLUS)
|
||||
#ifdef BM_RTC_PERSISTENT0_DISABLE_XTALOK
|
||||
while (BF_RD(RTC_STAT, NEW_REGS)!=0) {};
|
||||
BF_SET(RTC_PERSISTENT0, XTAL24MHZ_PWRUP, DISABLE_XTALOK);
|
||||
#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 */
|
||||
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
|
||||
imx233_rtc_enable_watchdog(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue