imx233: implement alarm wake up

This adds the application part of alarm wake up. On some targets
like the Fuze+, it will also require a bootloader change to make
sure that the device doesn't power down on alarm wake up (for
example on the Fuze+ the bootloader requires the power button to
be hold sufficiently long, thus preventing alarm wake up to work)

Change-Id: I5d01957852355fddbd48110d3d75a5533f07879e
This commit is contained in:
Amaury Pouly 2013-07-02 00:36:21 +02:00
parent 2773673733
commit d8024df105
3 changed files with 67 additions and 12 deletions

View file

@ -33,6 +33,8 @@ struct imx233_rtc_info_t
{
uint32_t seconds;
uint32_t persistent[6];
uint32_t alarm;
bool alarm_en, alarm_wake_en, alarm_wake, alarm_irq;
};
static inline void imx233_rtc_init(void)
@ -64,8 +66,14 @@ static inline void imx233_rtc_enable_msec_irq(bool enable)
BF_CLR(RTC_CTRL, ONEMSEC_IRQ_EN);
}
static inline uint32_t imx233_rtc_read_alarm(void)
{
return HW_RTC_ALARM;
}
void imx233_rtc_write_seconds(uint32_t seconds);
void imx233_rtc_write_persistent(int idx, uint32_t val);
void imx233_rtc_write_alarm(uint32_t seconds);
struct imx233_rtc_info_t imx233_rtc_get_info(void);