summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/rtc-imx233.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-02-02 04:22:00 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2014-02-10 23:14:24 +0100
commit55877f442a6b2fd29af8f35c64ea59c42442927e (patch)
tree2b64fb8a64383826699f4812ca61fe4b136b128c /firmware/target/arm/imx233/rtc-imx233.h
parent0ba4c3b0787eb349458b0187623bc260d3789ebc (diff)
downloadrockbox-55877f442a6b2fd29af8f35c64ea59c42442927e.tar.gz
rockbox-55877f442a6b2fd29af8f35c64ea59c42442927e.tar.bz2
rockbox-55877f442a6b2fd29af8f35c64ea59c42442927e.zip
imx233: always disable watchdog on boot
Change-Id: I2e81b038b783968aa18ef3398d6e2aa66a2fee7c
Diffstat (limited to 'firmware/target/arm/imx233/rtc-imx233.h')
-rw-r--r--firmware/target/arm/imx233/rtc-imx233.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/firmware/target/arm/imx233/rtc-imx233.h b/firmware/target/arm/imx233/rtc-imx233.h
index 8a5f4d035c..35304df080 100644
--- a/firmware/target/arm/imx233/rtc-imx233.h
+++ b/firmware/target/arm/imx233/rtc-imx233.h
@@ -37,11 +37,6 @@ struct imx233_rtc_info_t
bool alarm_en, alarm_wake_en, alarm_wake, alarm_irq;
};
-static inline void imx233_rtc_init(void)
-{
- BF_CLR(RTC_CTRL, CLKGATE);
-}
-
static inline uint32_t imx233_rtc_read_seconds(void)
{
return HW_RTC_SECONDS;
@@ -71,6 +66,25 @@ static inline uint32_t imx233_rtc_read_alarm(void)
return HW_RTC_ALARM;
}
+static inline void imx233_rtc_enable_watchdog(bool en)
+{
+ if(en)
+ BF_SET(RTC_CTRL, WATCHDOGEN);
+ else
+ BF_CLR(RTC_CTRL, WATCHDOGEN);
+}
+
+static inline void imx233_rtc_reset_watchdog(uint32_t ms)
+{
+ HW_RTC_WATCHDOG = ms;
+}
+
+static inline void imx233_rtc_init(void)
+{
+ BF_CLR(RTC_CTRL, CLKGATE);
+ imx233_rtc_enable_watchdog(false);
+}
+
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);