summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorGerald Van Baren <vanbaren@cideas.com>2008-03-29 18:08:02 -0400
committerGerald Van Baren <vanbaren@cideas.com>2008-03-29 18:08:02 -0400
commit3596d55eb22703d3f4f1b839fe4b000fabe081b3 (patch)
tree96d1ce693dc72c2fbc63da37928afd4761e82fd2 /drivers/rtc
parent493a2b1dc97367e904bf83869501f6290f3b374e (diff)
parent74d1e66d22dac91388bc538b2fe19f735edc5b82 (diff)
downloadu-boot-imx-3596d55eb22703d3f4f1b839fe4b000fabe081b3.zip
u-boot-imx-3596d55eb22703d3f4f1b839fe4b000fabe081b3.tar.gz
u-boot-imx-3596d55eb22703d3f4f1b839fe4b000fabe081b3.tar.bz2
Merge git://www.denx.de/git/u-boot into uboot
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/Makefile1
-rw-r--r--drivers/rtc/ds1337.c31
2 files changed, 19 insertions, 13 deletions
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 9be2130..800ab99 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -43,7 +43,6 @@ COBJS-$(CONFIG_RTC_ISL1208) += isl1208.o
COBJS-y += m41t11.o
COBJS-y += m41t60.o
COBJS-$(CONFIG_RTC_M41T62) += m41t62.o
-COBJS-y += max6900.o
COBJS-y += m48t35ax.o
COBJS-y += max6900.o
COBJS-y += mc146818.o
diff --git a/drivers/rtc/ds1337.c b/drivers/rtc/ds1337.c
index 50ab446..e908749 100644
--- a/drivers/rtc/ds1337.c
+++ b/drivers/rtc/ds1337.c
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2001, 2002
+ * (C) Copyright 2001-2008
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
* Keith Outwater, keith_outwater@mvis.com`
*
@@ -60,19 +60,19 @@
/*
* RTC control register bits
*/
-#define RTC_CTL_BIT_A1IE 0x1 /* Alarm 1 interrupt enable */
-#define RTC_CTL_BIT_A2IE 0x2 /* Alarm 2 interrupt enable */
-#define RTC_CTL_BIT_INTCN 0x4 /* Interrupt control */
-#define RTC_CTL_BIT_RS1 0x8 /* Rate select 1 */
-#define RTC_CTL_BIT_RS2 0x10 /* Rate select 2 */
-#define RTC_CTL_BIT_DOSC 0x80 /* Disable Oscillator */
+#define RTC_CTL_BIT_A1IE 0x1 /* Alarm 1 interrupt enable */
+#define RTC_CTL_BIT_A2IE 0x2 /* Alarm 2 interrupt enable */
+#define RTC_CTL_BIT_INTCN 0x4 /* Interrupt control */
+#define RTC_CTL_BIT_RS1 0x8 /* Rate select 1 */
+#define RTC_CTL_BIT_RS2 0x10 /* Rate select 2 */
+#define RTC_CTL_BIT_DOSC 0x80 /* Disable Oscillator */
/*
* RTC status register bits
*/
-#define RTC_STAT_BIT_A1F 0x1 /* Alarm 1 flag */
-#define RTC_STAT_BIT_A2F 0x2 /* Alarm 2 flag */
-#define RTC_STAT_BIT_OSF 0x80 /* Oscillator stop flag */
+#define RTC_STAT_BIT_A1F 0x1 /* Alarm 1 flag */
+#define RTC_STAT_BIT_A2F 0x2 /* Alarm 2 flag */
+#define RTC_STAT_BIT_OSF 0x80 /* Oscillator stop flag */
static uchar rtc_read (uchar reg);
@@ -158,11 +158,18 @@ void rtc_set (struct rtc_time *tmp)
* SQW/INTB* pin and program it for 32,768 Hz output. Note that
* according to the datasheet, turning on the square wave output
* increases the current drain on the backup battery from about
- * 600 nA to 2uA.
+ * 600 nA to 2uA. Define CFG_RTC_DS1337_NOOSC if you wish to turn
+ * off the OSC output.
*/
+#ifdef CFG_RTC_DS1337_NOOSC
+ #define RTC_DS1337_RESET_VAL \
+ (RTC_CTL_BIT_INTCN | RTC_CTL_BIT_RS1 | RTC_CTL_BIT_RS2)
+#else
+ #define RTC_DS1337_RESET_VAL (RTC_CTL_BIT_RS1 | RTC_CTL_BIT_RS2)
+#endif
void rtc_reset (void)
{
- rtc_write (RTC_CTL_REG_ADDR, RTC_CTL_BIT_RS1 | RTC_CTL_BIT_RS2);
+ rtc_write (RTC_CTL_REG_ADDR, RTC_DS1337_RESET_VAL);
}