[U-Boot] [PATCH] Add support for DS1340 RTC
Darwin Dingel
darwin.dingel at alliedtelesis.co.nz
Sun Jun 8 23:59:39 CEST 2014
Implementation is the same as with a DS1337 but with different register
addresses.
Signed-off-by: Darwin Dingel <darwin.dingel at alliedtelesis.co.nz>
---
drivers/rtc/ds1337.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/ds1337.c b/drivers/rtc/ds1337.c
index dae1b3c..0c1ba8c 100644
--- a/drivers/rtc/ds1337.c
+++ b/drivers/rtc/ds1337.c
@@ -43,6 +43,17 @@
#define RTC_CTL_REG_ADDR 0x0c
#define RTC_STAT_REG_ADDR 0x0b
#define RTC_TC_REG_ADDR 0x0a
+#elif defined CONFIG_RTC_DS1340
+#define RTC_SEC_REG_ADDR 0x0
+#define RTC_MIN_REG_ADDR 0x1
+#define RTC_HR_REG_ADDR 0x2
+#define RTC_DAY_REG_ADDR 0x3
+#define RTC_DATE_REG_ADDR 0x4
+#define RTC_MON_REG_ADDR 0x5
+#define RTC_YR_REG_ADDR 0x6
+#define RTC_CTL_REG_ADDR 0x7
+#define RTC_TC_REG_ADDR 0x8
+#define RTC_STAT_REG_ADDR 0x9
#endif
/*
@@ -164,7 +175,7 @@ void rtc_reset (void)
{
#ifdef CONFIG_SYS_RTC_DS1337
rtc_write (RTC_CTL_REG_ADDR, RTC_DS1337_RESET_VAL);
-#elif defined CONFIG_SYS_RTC_DS1388
+#elif defined CONFIG_SYS_RTC_DS1388 || defined (CONFIG_RTC_DS1340)
rtc_write(RTC_CTL_REG_ADDR, 0x0); /* hw default */
#endif
#ifdef CONFIG_SYS_DS1339_TCR_VAL
--
1.7.9.5
More information about the U-Boot
mailing list