1
0
Fork 0
forked from len0rd/rockbox

imx233: rewrite rtc using new registers

Change-Id: I30794dac2175d5717ea8e05e911abec65a214c44
This commit is contained in:
Amaury Pouly 2013-06-16 17:21:12 +02:00
parent 3e8c2dc46d
commit 2d12ef6c73
2 changed files with 11 additions and 62 deletions

View file

@ -23,9 +23,9 @@
static void imx233_rtc_write_reg(volatile uint32_t *reg, uint32_t val)
{
while(__XTRACT(HW_RTC_STAT, NEW_REGS) != 0);
while(BF_RD(RTC_STAT, NEW_REGS) != 0);
*reg = val;
while(__XTRACT(HW_RTC_STAT, NEW_REGS) != 0);
while(BF_RD(RTC_STAT, NEW_REGS) != 0);
}
void imx233_rtc_write_seconds(uint32_t seconds)
@ -35,7 +35,7 @@ void imx233_rtc_write_seconds(uint32_t seconds)
void imx233_rtc_write_persistent(int idx, uint32_t val)
{
imx233_rtc_write_reg(&HW_RTC_PERSISTENTx(idx), val);
imx233_rtc_write_reg(&HW_RTC_PERSISTENTn(idx), val);
}
struct imx233_rtc_info_t imx233_rtc_get_info(void)
@ -44,6 +44,6 @@ struct imx233_rtc_info_t imx233_rtc_get_info(void)
memset(&info, 0, sizeof(info));
info.seconds = HW_RTC_SECONDS;
for(int i = 0; i < 6; i++)
info.persistent[i] = HW_RTC_PERSISTENTx(i);
info.persistent[i] = HW_RTC_PERSISTENTn(i);
return info;
}