Skip to contentSkip to conversation

Add support for DS1340 RTC

PATCH New Darwin Dingel 3 participants 3 messages Jun 8, 2014 – Jun 11, 2014 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add support for DS1340 RTC

Implementation is the same as with a DS1337 but with different register addresses.

---
 drivers/rtc/ds1337.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/rtc/ds1337.c +12 -1
index dae1b3c..0c1ba8c 100644
@@ -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
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 Add support for DS1340 RTC

Quoted 4 lines · Darwin Dingel

Implementation is the same as with a DS1337 but with different register addresses.

Are you going to post patches for a board which sets CONFIG_RTC_DS1340 ?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140611/5c610a68/attachment.pgp>
#2 lore raw

PATCH 1/1 Add support for DS1340 RTC

Hi Tom,

Tom Rini wrote

Quoted 5 lines · Darwin Dingel
Quoted 4 lines

Implementation is the same as with a DS1337 but with different register addresses.

Quoted 7 lines
Quoted 1 line
Signed-off-by Darwin Dingel &lt;

darwin.dingel at .co

&gt;

Are you going to post patches for a board which sets CONFIG_RTC_DS1340 ?

No. Just the RTC support.

---

Darwin

--
View this message in context: http://u-boot.10912.n7.nabble.com/PATCH-Add-support-for-DS1340-RTC-tp181823p182071.html
Sent from the U-Boot mailing list archive at Nabble.com.