linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1 10/18] ARM: versatile/vexpress: dynamically register local timer setup function
Date: Fri,  3 Jun 2011 15:57:25 +0100	[thread overview]
Message-ID: <1307113053-30209-11-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1307113053-30209-1-git-send-email-marc.zyngier@arm.com>

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-realview/realview_eb.c              |    4 +++-
 arch/arm/mach-realview/realview_pb11mp.c          |    4 +++-
 arch/arm/mach-realview/realview_pbx.c             |    5 +++--
 arch/arm/mach-vexpress/v2m.c                      |    4 ++++
 arch/arm/plat-versatile/include/plat/localtimer.h |    6 ++++++
 arch/arm/plat-versatile/localtimer.c              |   10 +++++++++-
 6 files changed, 28 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/plat-versatile/include/plat/localtimer.h

diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 10e75fa..e17e985 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -45,6 +45,8 @@
 #include <mach/board-eb.h>
 #include <mach/irqs.h>
 
+#include <plat/localtimer.h>
+
 #include "core.h"
 
 static struct map_desc realview_eb_io_desc[] __initdata = {
@@ -402,7 +404,7 @@ static void __init realview_eb_timer_init(void)
 
 	if (core_tile_eb11mp() || core_tile_a9mp()) {
 #ifdef CONFIG_LOCAL_TIMERS
-		twd_base = __io_address(REALVIEW_EB11MP_TWD_BASE);
+		versatile_local_timer_init(__io_address(REALVIEW_EB11MP_TWD_BASE));
 #endif
 		timer_irq = IRQ_EB11MP_TIMER0_1;
 	} else
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index b2985fc..76da67d 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -46,6 +46,8 @@
 #include <mach/board-pb11mp.h>
 #include <mach/irqs.h>
 
+#include <plat/localtimer.h>
+
 #include "core.h"
 
 static struct map_desc realview_pb11mp_io_desc[] __initdata = {
@@ -306,7 +308,7 @@ static void __init realview_pb11mp_timer_init(void)
 	timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20;
 
 #ifdef CONFIG_LOCAL_TIMERS
-	twd_base = __io_address(REALVIEW_TC11MP_TWD_BASE);
+	versatile_local_timer_init(__io_address(REALVIEW_TC11MP_TWD_BASE));
 #endif
 	realview_timer_init(IRQ_TC11MP_TIMER0_1);
 }
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 92ace2c..280befd 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -31,7 +31,6 @@
 #include <asm/leds.h>
 #include <asm/mach-types.h>
 #include <asm/pmu.h>
-#include <asm/smp_twd.h>
 #include <asm/pgtable.h>
 #include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -44,6 +43,8 @@
 #include <mach/board-pbx.h>
 #include <mach/irqs.h>
 
+#include <plat/localtimer.h>
+
 #include "core.h"
 
 static struct map_desc realview_pbx_io_desc[] __initdata = {
@@ -310,7 +311,7 @@ static void __init realview_pbx_timer_init(void)
 
 #ifdef CONFIG_LOCAL_TIMERS
 	if (core_tile_pbx11mp() || core_tile_pbxa9mp())
-		twd_base = __io_address(REALVIEW_PBX_TILE_TWD_BASE);
+		versatile_local_timer_init(__io_address(REALVIEW_PBX_TILE_TWD_BASE));
 #endif
 	realview_timer_init(IRQ_PBX_TIMER0_1);
 }
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 9e6b93b..3a1497e 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -28,6 +28,7 @@
 #include <mach/motherboard.h>
 
 #include <plat/sched_clock.h>
+#include <plat/localtimer.h>
 
 #include "core.h"
 
@@ -50,6 +51,9 @@ static void __init v2m_timer_init(void)
 {
 	u32 scctrl;
 
+	/* twd_base is assigned in the tile code */
+	versatile_local_timer_init(NULL);
+
 	/* Select 1MHz TIMCLK as the reference clock for SP804 timers */
 	scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL));
 	scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK;
diff --git a/arch/arm/plat-versatile/include/plat/localtimer.h b/arch/arm/plat-versatile/include/plat/localtimer.h
new file mode 100644
index 0000000..1246fc2
--- /dev/null
+++ b/arch/arm/plat-versatile/include/plat/localtimer.h
@@ -0,0 +1,6 @@
+#ifndef ARM_PLAT_LOCALTIMER_H
+#define ARM_PLAT_LOCALTIMER_H
+
+void versatile_local_timer_init(void __iomem *base);
+
+#endif
diff --git a/arch/arm/plat-versatile/localtimer.c b/arch/arm/plat-versatile/localtimer.c
index a8e8b85..22603a5 100644
--- a/arch/arm/plat-versatile/localtimer.c
+++ b/arch/arm/plat-versatile/localtimer.c
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 #include <linux/clockchips.h>
 
+#include <asm/smp_twd.h>
 #include <asm/localtimer.h>
 #include <asm/hardware/gic.h>
 #include <mach/irqs.h>
@@ -18,8 +19,15 @@
 /*
  * Setup the local clock events for a CPU.
  */
-int __cpuinit local_timer_setup(struct clock_event_device *evt)
+static int __cpuinit versatile_local_timer_setup(struct clock_event_device *evt)
 {
 	evt->irq = gic_ppi_to_vppi(IRQ_LOCALTIMER);
 	return 0;
 }
+
+void __init versatile_local_timer_init(void __iomem *base)
+{
+	if (base)
+		twd_base = base;
+	twd_timer_register_setup(versatile_local_timer_setup);
+}
-- 
1.7.0.4

  parent reply	other threads:[~2011-06-03 14:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-03 14:57 [PATCH v1 00/18] Allow local timers to be registered at runtime Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 01/18] ARM: Move local timer support out of smp.c Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 02/18] ARM: local timers: Add runtime registration interface Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 03/18] ARM: omap2: remove stubbed twd_timer_setup call Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 04/18] ARM: exynos4: " Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 05/18] ARM: shmobile: " Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 06/18] ARM: tegra: " Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 07/18] ARM: ux500: " Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 08/18] ARM: versatile: " Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 09/18] ARM: remove unused twd_timer_setup stub Marc Zyngier
2011-06-03 14:57 ` Marc Zyngier [this message]
2011-06-03 14:57 ` [PATCH v1 11/18] ARM: msm: dynamically register local timer Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 12/18] ARM: omap4: dynamically register local timer setup function Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 13/18] ARM: exynos4: " Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 14/18] ARM: shmobile: " Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 15/18] ARM: tegra: " Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 16/18] ARM: ux500: " Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 17/18] ARM: simplify percpu_timer_setup Marc Zyngier
2011-06-03 14:57 ` [PATCH v1 18/18] ARM: simplify percpu_timer_ack Marc Zyngier

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=1307113053-30209-11-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --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).