public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/3] arm, davinci: move davinci_rtc struct to hardware.h
Date: Mon, 28 Nov 2011 11:44:47 +0100	[thread overview]
Message-ID: <1322477089-32368-2-git-send-email-hs@denx.de> (raw)
In-Reply-To: <1322477089-32368-1-git-send-email-hs@denx.de>

move struct davinci_rtc to arch/arm/include/asm/arch-davinci/hardware.h
and add RTC_KICK0R_WE, RTC_KICK1R_WE defines,
so they are global useable.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
 arch/arm/include/asm/arch-davinci/hardware.h |   39 ++++++++++++++++++++++++++
 drivers/rtc/davinci.c                        |   26 -----------------
 2 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/arch/arm/include/asm/arch-davinci/hardware.h b/arch/arm/include/asm/arch-davinci/hardware.h
index 06819a6..dd89e84 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -588,4 +588,43 @@ static inline int get_async3_src(void)
 #include <asm/arch/syscfg_defs.h>
 #include <asm/arch/timer_defs.h>
 #endif
+
+struct davinci_rtc {
+	dv_reg	second;
+	dv_reg	minutes;
+	dv_reg	hours;
+	dv_reg	day;
+	dv_reg	month; /* 0x10 */
+	dv_reg	year;
+	dv_reg	dotw;
+	dv_reg	resv1;
+	dv_reg	alarmsecond; /* 0x20 */
+	dv_reg	alarmminute;
+	dv_reg	alarmhour;
+	dv_reg	alarmday;
+	dv_reg	alarmmonth; /* 0x30 */
+	dv_reg	alarmyear;
+	dv_reg	resv2[2];
+	dv_reg	ctrl; /* 0x40 */
+	dv_reg	status;
+	dv_reg	irq;
+	dv_reg	complsb;
+	dv_reg	compmsb; /* 0x50 */
+	dv_reg	osc;
+	dv_reg	resv3[2];
+	dv_reg	scratch0; /* 0x60 */
+	dv_reg	scratch1;
+	dv_reg	scratch2;
+	dv_reg	kick0r;
+	dv_reg	kick1r; /* 0x70 */
+};
+
+#define RTC_STATE_BUSY	0x01
+#define RTC_STATE_RUN	0x02
+
+#define RTC_KICK0R_WE	0x130be783
+#define RTC_KICK1R_WE	0xe0f1a495
+
+#define davinci_rtc_base ((struct davinci_rtc *)DAVINCI_RTC_BASE)
+
 #endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/drivers/rtc/davinci.c b/drivers/rtc/davinci.c
index 8436cbf..5cafff4 100644
--- a/drivers/rtc/davinci.c
+++ b/drivers/rtc/davinci.c
@@ -27,32 +27,6 @@
 #include <asm/arch/hardware.h>
 
 #if defined(CONFIG_CMD_DATE)
-struct davinci_rtc {
-	u_int32_t	second;
-	u_int32_t	minutes;
-	u_int32_t	hours;
-	u_int32_t	day;
-	u_int32_t	month; /* 0x10 */
-	u_int32_t	year;
-	u_int32_t	dotw;
-	u_int32_t	resv1;
-	u_int32_t	alarmsecond; /* 0x20 */
-	u_int32_t	alarmminute;
-	u_int32_t	alarmhour;
-	u_int32_t	alarmday;
-	u_int32_t	alarmmonth; /* 0x30 */
-	u_int32_t	alarmyear;
-	u_int32_t	resv2[2];
-	u_int32_t	ctrl; /* 0x40 */
-	u_int32_t	status;
-	u_int32_t	irq;
-};
-
-#define RTC_STATE_BUSY	0x01
-#define RTC_STATE_RUN	0x02
-
-#define davinci_rtc_base ((struct davinci_rtc *)DAVINCI_RTC_BASE)
-
 int rtc_get(struct rtc_time *tmp)
 {
 	struct davinci_rtc *rtc = davinci_rtc_base;
-- 
1.7.6.4

  reply	other threads:[~2011-11-28 10:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28 10:44 [U-Boot] [PATCH v3 0/3] arm, davinci: add am1808 based enbw_cmc board Heiko Schocher
2011-11-28 10:44 ` Heiko Schocher [this message]
2011-11-28 10:44 ` [U-Boot] [PATCH v3 2/3] arm, davinci, da850: add uart1 tx rx pinmux config Heiko Schocher
2011-11-28 14:57   ` Tom Rini
2011-11-28 10:44 ` [U-Boot] [PATCH v3 3/3] arm, davinci: add support for am1808 based enbw_cmc board Heiko Schocher
2011-11-28 11:43   ` Igor Grinberg
2011-11-28 15:20     ` Heiko Schocher
2011-11-28 15:42       ` Wolfgang Denk
2011-11-29  6:56         ` Heiko Schocher
2011-11-28 15:28     ` Wolfgang Denk
2011-11-29  7:41       ` Igor Grinberg
2011-11-28 11:02 ` [U-Boot] [PATCH v3 0/3] arm, davinci: add " Igor Grinberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322477089-32368-2-git-send-email-hs@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox