devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pawel Moll <pawel.moll@arm.com>
To: devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
Cc: Pawel Moll <pawel.moll@arm.com>
Subject: [PATCH v5 5/9] ARM: versatile: Map local timers using Device Tree when possible
Date: Fri,  9 Dec 2011 19:03:48 +0000	[thread overview]
Message-ID: <1323457432-4800-6-git-send-email-pawel.moll@arm.com> (raw)
In-Reply-To: <1323457432-4800-1-git-send-email-pawel.moll@arm.com>

If twd_base is not set, try to map the TWD registers from
"arm,smp-twd" Device Tree node (compatible value as used in
Highbank's DT).

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
 arch/arm/plat-versatile/localtimer.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-versatile/localtimer.c b/arch/arm/plat-versatile/localtimer.c
index 0fb3961..e3da322 100644
--- a/arch/arm/plat-versatile/localtimer.c
+++ b/arch/arm/plat-versatile/localtimer.c
@@ -11,6 +11,8 @@
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/clockchips.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
 
 #include <asm/smp_twd.h>
 #include <asm/localtimer.h>
@@ -21,6 +23,16 @@
  */
 int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
+#if defined(CONFIG_OF)
+	if (!twd_base) {
+		struct device_node *np = of_find_compatible_node(NULL,
+				NULL, "arm,smp-twd");
+
+		twd_base = of_iomap(np, 0);
+		if (!twd_base)
+			return -ENXIO;
+	}
+#endif
 	evt->irq = IRQ_LOCALTIMER;
 	twd_timer_setup(evt);
 	return 0;
-- 
1.7.5.4

  parent reply	other threads:[~2011-12-09 19:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 19:03 [PATCH v5 0/9] Versatile Express DT support Pawel Moll
2011-12-09 19:03 ` [PATCH v5 1/9] ARM: versatile: Add missing ENDPROC to headsmp.S Pawel Moll
2011-12-09 19:03 ` [PATCH v5 2/9] ARM: vexpress: Get rid of MMIO_P2V Pawel Moll
2011-12-09 19:03 ` [PATCH v5 3/9] ARM: vexpress: Add Device Tree support Pawel Moll
2011-12-09 19:03 ` [PATCH v5 4/9] ARM: vexpress: Motherboard RS1 memory map support Pawel Moll
2011-12-09 19:03 ` Pawel Moll [this message]
2011-12-10 15:27   ` [PATCH v5 5/9] ARM: versatile: Map local timers using Device Tree when possible Sergei Shtylyov
2011-12-12 11:03     ` Pawel Moll
     [not found]       ` <1323687811.2391.3.camel-okZbbLrgpR/YkXV2EHHjLW3o5bpOHsLO@public.gmane.org>
2011-12-12 11:18         ` Sergei Shtylyov
2011-12-12 11:29           ` Pawel Moll
     [not found]   ` <1323457432-4800-6-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2011-12-12 14:04     ` Russell King - ARM Linux
2011-12-12 14:06       ` Pawel Moll
2011-12-09 19:03 ` [PATCH v5 6/9] ARM: vexpress: Use FDT data in platform SMP calls Pawel Moll
2011-12-09 19:03 ` [PATCH v5 7/9] ARM: vexpress: Add Device Tree for V2P-CA5s core tile Pawel Moll
2011-12-09 19:03 ` [PATCH v5 8/9] ARM: vexpress: Add Device Tree for V2P-CA9 " Pawel Moll
2011-12-09 19:03 ` [PATCH v5 9/9] ARM: vexpress: Add Device Tree for V2P-CA15 core tile (TC1 variant) Pawel Moll

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=1323457432-4800-6-git-send-email-pawel.moll@arm.com \
    --to=pawel.moll@arm.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).