mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 06/19] ARM omap: Make timer base runtime configurable
Date: Tue, 18 Dec 2012 15:22:28 +0100	[thread overview]
Message-ID: <1355840561-11552-7-git-send-email-jlu@pengutronix.de> (raw)
In-Reply-To: <1355840561-11552-1-git-send-email-jlu@pengutronix.de>

From: Sascha Hauer <s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-omap/include/mach/timers.h |    4 ----
 arch/arm/mach-omap/omap3_clock.c         |    3 +++
 arch/arm/mach-omap/omap4_clock.c         |    1 +
 arch/arm/mach-omap/omap4_generic.c       |    2 +-
 arch/arm/mach-omap/s32k_clksource.c      |   10 +++++++++-
 5 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap/include/mach/timers.h b/arch/arm/mach-omap/include/mach/timers.h
index 2df507d..8e4cb92 100644
--- a/arch/arm/mach-omap/include/mach/timers.h
+++ b/arch/arm/mach-omap/include/mach/timers.h
@@ -47,8 +47,4 @@
 /* Enable sys_clk NO-prescale /1 */
 #define GPT_EN			((0 << 2) | (0x1 << 1) | (0x1 << 0))
 
-/** Sync 32Khz Timer registers */
-#define S32K_CR			(OMAP_32KTIMER_BASE + 0x10)
-#define S32K_FREQUENCY		32768
-
 #endif /*__ASM_ARCH_GPT_H */
diff --git a/arch/arm/mach-omap/omap3_clock.c b/arch/arm/mach-omap/omap3_clock.c
index 975bf45..2a5e6f2 100644
--- a/arch/arm/mach-omap/omap3_clock.c
+++ b/arch/arm/mach-omap/omap3_clock.c
@@ -34,10 +34,13 @@
 #include <io.h>
 #include <mach/silicon.h>
 #include <mach/clocks.h>
+#include <mach/omap3-clock.h>
 #include <mach/timers.h>
 #include <mach/sys_info.h>
 #include <mach/syslib.h>
 
+#define S32K_CR			(OMAP_32KTIMER_BASE + 0x10)
+
 /* Following functions are exported from omap3_clock_core.S */
 /* Helper functions */
 static u32 get_osc_clk_speed(void);
diff --git a/arch/arm/mach-omap/omap4_clock.c b/arch/arm/mach-omap/omap4_clock.c
index b489d59..c86e4e5 100644
--- a/arch/arm/mach-omap/omap4_clock.c
+++ b/arch/arm/mach-omap/omap4_clock.c
@@ -3,6 +3,7 @@
 #include <mach/syslib.h>
 #include <mach/silicon.h>
 #include <mach/clocks.h>
+#include <mach/omap4-clock.h>
 
 #define LDELAY	12000000
 
diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c
index dc1dbae..4653b17 100644
--- a/arch/arm/mach-omap/omap4_generic.c
+++ b/arch/arm/mach-omap/omap4_generic.c
@@ -1,7 +1,7 @@
 #include <common.h>
 #include <init.h>
 #include <io.h>
-#include <mach/clocks.h>
+#include <mach/omap4-clock.h>
 #include <mach/silicon.h>
 #include <mach/omap4-mux.h>
 #include <mach/syslib.h>
diff --git a/arch/arm/mach-omap/s32k_clksource.c b/arch/arm/mach-omap/s32k_clksource.c
index 2cfcfa9..ca73753 100644
--- a/arch/arm/mach-omap/s32k_clksource.c
+++ b/arch/arm/mach-omap/s32k_clksource.c
@@ -31,6 +31,12 @@
 #include <mach/sys_info.h>
 #include <mach/syslib.h>
 
+/** Sync 32Khz Timer registers */
+#define S32K_CR			0x10
+#define S32K_FREQUENCY		32768
+
+static void __iomem *timerbase;
+
 /**
  * @brief Provide a simple clock read
  *
@@ -41,7 +47,7 @@
  */
 static uint64_t s32k_clocksource_read(void)
 {
-	return readl(S32K_CR);
+	return readl(timerbase + S32K_CR);
 }
 
 /* A bit obvious isn't it? */
@@ -62,6 +68,8 @@ static struct clocksource s32k_cs = {
  */
 static int s32k_clocksource_init(void)
 {
+	timerbase = (void *)OMAP_32KTIMER_BASE;
+
 	s32k_cs.mult = clocksource_hz2mult(S32K_FREQUENCY, s32k_cs.shift);
 
 	return init_clock(&s32k_cs);
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-12-18 14:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 14:22 AM33xx and BeagleBone support Jan Luebbe
2012-12-18 14:22 ` [PATCH 01/19] ARM omap: remove unused function Jan Luebbe
2012-12-18 14:22 ` [PATCH 02/19] ARM omap4: remove unused struct Jan Luebbe
2012-12-18 14:22 ` [PATCH 03/19] ARM omap4: Add missing assembly protection in header file Jan Luebbe
2012-12-18 14:22 ` [PATCH 04/19] ARM omap4: Add missing double include protection Jan Luebbe
2012-12-18 14:22 ` [PATCH 05/19] ARM omap: Make gpmc base runtime configurable Jan Luebbe
2012-12-18 14:22 ` Jan Luebbe [this message]
2012-12-18 14:22 ` [PATCH 07/19] ARM omap4: make PRM defines SoC specific Jan Luebbe
2012-12-18 14:22 ` [PATCH 08/19] ARM omap3: " Jan Luebbe
2012-12-18 14:22 ` [PATCH 09/19] ARM omap: Use SoC specific defines for gpmc and timer base Jan Luebbe
2012-12-18 14:22 ` [PATCH 10/19] ARM omap: include individual SoC files Jan Luebbe
2012-12-18 14:22 ` [PATCH 11/19] ARM omap: Add device register convenience functions Jan Luebbe
2012-12-18 14:22 ` [PATCH 12/19] ARM omap3: Use device register functions in boards Jan Luebbe
2012-12-18 14:22 ` [PATCH 13/19] ARM omap4: " Jan Luebbe
2012-12-18 14:22 ` [PATCH 14/19] ARM omap hsmmc: Fix register offset Jan Luebbe
2012-12-18 14:22 ` [PATCH 15/19] ARM omap3: Add change OMAP_ prefix to OMAP3_ for registers Jan Luebbe
2012-12-18 14:22 ` [PATCH 16/19] ARM OMAP AM33XX: create new ARCH for AM33xx Jan Luebbe
2012-12-18 14:22 ` [PATCH 17/19] arm: omap: am33xx: add support for low level debug Jan Luebbe
2012-12-18 14:22 ` [PATCH 18/19] arm: beaglebone: add first-stage support for AM335x and board Jan Luebbe
2012-12-19 12:07   ` Teresa Gámez
2012-12-18 14:22 ` [PATCH 19/19] drivers: net: add driver for TI CPSW Jan Luebbe
2012-12-19 21:11   ` Sascha Hauer

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=1355840561-11552-7-git-send-email-jlu@pengutronix.de \
    --to=jlu@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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