From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:25
This patches series switches the various local timers implementation
(TWD, MCT, MSM timer) to be registered at runtime instead of being
hardwired at compile time. In the process, TWD gets an OF binding that
is used by highbank and imx6q.
Tested on EB11MP, OMAP4, Tegra and Exynos4. Based on Linus' tree as of
some random point today.
Branch also available at:
git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git local_timers-v3.3-rc0
* From v2:
- Fix __initdata anotations that should have been __cpuinitdata
(reported by David Brown and Russell King)
- Fix interrupt trigger in DTS file for highbank and imx6q
(as requested by Rob Herring and Shawn Guo)
- Move warning to twd_local_timer_of_register()
(as requested by Rob Herring)
- Fix shmobile compilation fix (reported by Magnus Damm)
- Fold local_timer_{setup,stop}() into percpu_timer_{setup,stop}()
* From initial version:
- Moved away from late_time_init, making the code even simpler
- Added a DEFINE_TWD_LOCAL_TIMER() macro to reduce the init cluter
- Updated TWD DT support to have separate nodes for timer and watchdog
- Added support for the new r8a7779 shmobile that suddenly appeared
- Fixed a tiny dts bug on imx6q
Marc Zyngier (15):
ARM: smp_twd: make local_timer_stop a symbol instead of a #define
ARM: local timers: introduce a new registration interface
ARM: smp_twd: add runtime registration support
ARM: smp_twd: add device tree support
ARM: OMAP4: convert to twd_local_timer_register() interface
ARM: plat-versatile: convert to twd_local_timer_register() interface
ARM: tegra: convert to twd_local_timer_register() interface
ARM: shmobile: convert to twd_local_timer_register() interface
ARM: ux500: convert to twd_local_timer_register() interface
ARM: highbank: convert to twd_local_timer_register() interface
ARM: imx6q: convert to twd_local_timer_register() interface
ARM: smp_twd: remove old local timer interface
ARM: local timers: convert exynos to runtime registration interface
ARM: local timers: convert MSM to runtime registration interface
ARM: local timers: make the runtime registration interface mandatory
Documentation/devicetree/bindings/arm/twd.txt | 48 ++++++++++
arch/arm/boot/dts/highbank.dts | 8 +-
arch/arm/boot/dts/imx6q.dtsi | 6 +-
arch/arm/include/asm/localtimer.h | 37 ++------
arch/arm/include/asm/smp_twd.h | 25 ++++-
arch/arm/kernel/smp.c | 22 ++++-
arch/arm/kernel/smp_twd.c | 123 ++++++++++++++++++++-----
arch/arm/mach-exynos/mct.c | 18 ++--
arch/arm/mach-highbank/Makefile | 1 -
arch/arm/mach-highbank/highbank.c | 3 +
arch/arm/mach-highbank/localtimer.c | 40 --------
arch/arm/mach-imx/Makefile | 1 -
arch/arm/mach-imx/localtimer.c | 35 -------
arch/arm/mach-imx/mach-imx6q.c | 2 +
arch/arm/mach-msm/timer.c | 79 +++++++++-------
arch/arm/mach-omap2/Makefile | 1 -
arch/arm/mach-omap2/timer-mpu.c | 39 --------
arch/arm/mach-omap2/timer.c | 22 ++++-
arch/arm/mach-realview/realview_eb.c | 27 ++++-
arch/arm/mach-realview/realview_pb11mp.c | 21 ++++-
arch/arm/mach-realview/realview_pbx.c | 20 +++-
arch/arm/mach-shmobile/Makefile | 1 -
arch/arm/mach-shmobile/include/mach/common.h | 2 +
arch/arm/mach-shmobile/localtimer.c | 26 -----
arch/arm/mach-shmobile/platsmp.c | 1 -
arch/arm/mach-shmobile/smp-r8a7779.c | 8 +-
arch/arm/mach-shmobile/smp-sh73a0.c | 8 +-
arch/arm/mach-shmobile/timer.c | 10 ++
arch/arm/mach-tegra/Makefile | 2 +-
arch/arm/mach-tegra/localtimer.c | 26 -----
arch/arm/mach-tegra/timer.c | 22 ++++-
arch/arm/mach-ux500/Makefile | 1 -
arch/arm/mach-ux500/cpu.c | 1 -
arch/arm/mach-ux500/localtimer.c | 29 ------
arch/arm/mach-ux500/timer.c | 32 +++++--
arch/arm/mach-vexpress/ct-ca9x4.c | 17 +++-
arch/arm/plat-versatile/Makefile | 1 -
arch/arm/plat-versatile/localtimer.c | 27 ------
38 files changed, 407 insertions(+), 385 deletions(-)
create mode 100644 Documentation/devicetree/bindings/arm/twd.txt
delete mode 100644 arch/arm/mach-highbank/localtimer.c
delete mode 100644 arch/arm/mach-imx/localtimer.c
delete mode 100644 arch/arm/mach-omap2/timer-mpu.c
delete mode 100644 arch/arm/mach-shmobile/localtimer.c
delete mode 100644 arch/arm/mach-tegra/localtimer.c
delete mode 100644 arch/arm/mach-ux500/localtimer.c
delete mode 100644 arch/arm/plat-versatile/localtimer.c
--
1.7.7.1
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:26
When CONFIG_HAVE_ARM_TWD is selected, local_timer_stop is a #define,
while all other local timers are using a real function.
Convert it to an alias of twd_timer_stop, as it helps converting
all local timers to another internal API in a sane way.
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/include/asm/localtimer.h | 6 +-----
arch/arm/include/asm/smp_twd.h | 1 -
arch/arm/kernel/smp_twd.c | 7 ++++++-
3 files changed, 7 insertions(+), 7 deletions(-)
@@ -87,12 +87,17 @@ int twd_timer_ack(void)return0;}-voidtwd_timer_stop(structclock_event_device*clk)+staticvoidtwd_timer_stop(structclock_event_device*clk){twd_set_mode(CLOCK_EVT_MODE_UNUSED,clk);disable_percpu_irq(clk->irq);}+/* Temporary hack to be removed when all TWD users are converted to+thenewregistrationinterface*/+voidlocal_timer_stop(structclock_event_device*clk)+__attribute__((alias("twd_timer_stop")));+#ifdef CONFIG_CPU_FREQ/*
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:27
In order to switch to a runtime selectable local timer,
add a registration interface that timer drivers can use to
register to the core.
local_timer_setup() and local_timer_stop() are made weak symbols
in order not to break existing setups.
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/include/asm/localtimer.h | 15 +++++++++++++++
arch/arm/kernel/smp.c | 27 +++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 0 deletions(-)
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:28
Add support for the new registration interface to smp_twd.
Platforms can populate a struct twd_local_timer with MMIO
and IRQ resources, and then call twd_local_timer_register()
to have the timer registered with the core.
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/include/asm/smp_twd.h | 18 +++++++++++++-
arch/arm/kernel/smp_twd.c | 51 +++++++++++++++++++++++++++++++++++++--
2 files changed, 65 insertions(+), 4 deletions(-)
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:29
Add bindings to support DT discovery of the ARM Timer Watchdog
(aka TWD). Only the timer side is converted by this patch.
Cc: Rob Herring <redacted>
Signed-off-by: Marc Zyngier <redacted>
---
Documentation/devicetree/bindings/arm/twd.txt | 48 +++++++++++++++
arch/arm/include/asm/smp_twd.h | 8 +++
arch/arm/kernel/smp_twd.c | 77 ++++++++++++++++++++----
3 files changed, 120 insertions(+), 13 deletions(-)
create mode 100644 Documentation/devicetree/bindings/arm/twd.txt
@@ -0,0 +1,48 @@+* ARM Timer Watchdog++ARM 11MP, Cortex-A5 and Cortex-A9 are often associated with a per-core+Timer-Watchdog (aka TWD), which provides both a per-cpu local timer+and watchdog.++The TWD is usually attached to a GIC to deliver its two per-processor+interrupts.++** Timer node required properties:++- compatible : Should be one of:+ "arm,cortex-a9-twd-timer"+ "arm,cortex-a5-twd-timer"+ "arm,arm11mp-twd-timer"++- interrupts : One interrupt to each core++- reg : Specify the base address and the size of the TWD timer+ register window.++Example:++ twd-timer at 2c000600 {+ compatible = "arm,arm11mp-twd-timer"";+ reg = <0x2c000600 0x20>;+ interrupts = <1 13 0xf01>;+ };++** Watchdog node properties:++- compatible : Should be one of:+ "arm,cortex-a9-twd-wdt"+ "arm,cortex-a5-twd-wdt"+ "arm,arm11mp-twd-wdt"++- interrupts : One interrupt to each core++- reg : Specify the base address and the size of the TWD watchdog+ register window.++Example:++ twd-watchdog at 2c000620 {+ compatible = "arm,arm11mp-twd-wdt";+ reg = <0x2c000620 0x20>;+ interrupts = <1 14 0xf01>;+ };
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:30
Add support for the new smp_twd runtime registration interface
to the OMAP4 platforms, and remove the old compile-time support.
Tested on Panda.
Cc: Tony Lindgren <tony@atomide.com>
Acked-by: Santosh Shilimkar <redacted>
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/mach-omap2/Makefile | 1 -
arch/arm/mach-omap2/timer-mpu.c | 39 ---------------------------------------
arch/arm/mach-omap2/timer.c | 22 +++++++++++++++++-----
3 files changed, 17 insertions(+), 45 deletions(-)
delete mode 100644 arch/arm/mach-omap2/timer-mpu.c
@@ -23,7 +23,6 @@ obj-$(CONFIG_TWL4030_CORE) += omap_twl.o# SMP support ONLY available for OMAP4obj-$(CONFIG_SMP)+=omap-smp.oomap-headsmp.o-obj-$(CONFIG_LOCAL_TIMERS)+=timer-mpu.oobj-$(CONFIG_HOTPLUG_CPU)+=omap-hotplug.oobj-$(CONFIG_ARCH_OMAP4)+=omap4-common.oomap-wakeupgen.o\sleep44xx.o
@@ -1,39 +0,0 @@-/*- * The MPU local timer source file. In OMAP4, both cortex-a9 cores have- * own timer in it's MPU domain. These timers will be driving the- * linux kernel SMP tick framework when active. These timers are not- * part of the wake up domain.- *- * Copyright (C) 2009 Texas Instruments, Inc.- *- * Author:- * Santosh Shilimkar <santosh.shilimkar@ti.com>- *- * This file is based on arm realview smp platform file.- * Copyright (C) 2002 ARM Ltd.- *- * This program is free software; you can redistribute it and/or modify- * it under the terms of the GNU General Public License version 2 as- * published by the Free Software Foundation.- */-#include <linux/init.h>-#include <linux/smp.h>-#include <linux/clockchips.h>-#include <asm/irq.h>-#include <asm/smp_twd.h>-#include <asm/localtimer.h>--/*- * Setup the local clock events for a CPU.- */-int __cpuinit local_timer_setup(struct clock_event_device *evt)-{- /* Local timers are not supprted on OMAP4430 ES1.0 */- if (omap_rev() == OMAP4430_REV_ES1_0)- return -ENXIO;-- evt->irq = OMAP44XX_IRQ_LOCALTIMER;- twd_timer_setup(evt);- return 0;-}-
@@ -324,14 +324,26 @@ OMAP_SYS_TIMER(3_secure)#endif#ifdef CONFIG_ARCH_OMAP4-staticvoid__initomap4_timer_init(void)-{#ifdef CONFIG_LOCAL_TIMERS-twd_base=ioremap(OMAP44XX_LOCAL_TWD_BASE,SZ_256);-BUG_ON(!twd_base);+staticDEFINE_TWD_LOCAL_TIMER(twd_local_timer,+OMAP44XX_LOCAL_TWD_BASE,+OMAP44XX_IRQ_LOCALTIMER);#endif++staticvoid__initomap4_timer_init(void)+{omap2_gp_clockevent_init(1,OMAP4_CLKEV_SOURCE);omap2_gp_clocksource_init(2,OMAP4_MPU_SOURCE);+#ifdef CONFIG_LOCAL_TIMERS+/* Local timers are not supprted on OMAP4430 ES1.0 */+if(omap_rev()!=OMAP4430_REV_ES1_0){+interr;++err=twd_local_timer_register(&twd_local_timer);+if(err)+pr_err("twd_local_timer_register failed %d\n",err);+}+#endif}OMAP_SYS_TIMER(4)#endif
@@ -1,27 +0,0 @@-/*- * linux/arch/arm/plat-versatile/localtimer.c- *- * Copyright (C) 2002 ARM Ltd.- * All Rights Reserved- *- * This program is free software; you can redistribute it and/or modify- * it under the terms of the GNU General Public License version 2 as- * published by the Free Software Foundation.- */-#include <linux/init.h>-#include <linux/smp.h>-#include <linux/clockchips.h>--#include <asm/smp_twd.h>-#include <asm/localtimer.h>-#include <mach/irqs.h>--/*- * Setup the local clock events for a CPU.- */-int __cpuinit local_timer_setup(struct clock_event_device *evt)-{- evt->irq = IRQ_LOCALTIMER;- twd_timer_setup(evt);- return 0;-}
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:32
Add support for the new smp_twd runtime registration interface
to the tegra platforms, and remove the old compile-time support.
Tested on Harmony.
Cc: Stephen Warren <redacted>
Cc: Colin Cross <redacted>
Cc: Olof Johansson <redacted>
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/mach-tegra/Makefile | 2 +-
arch/arm/mach-tegra/localtimer.c | 26 --------------------------
arch/arm/mach-tegra/timer.c | 22 +++++++++++++++++-----
3 files changed, 18 insertions(+), 32 deletions(-)
delete mode 100644 arch/arm/mach-tegra/localtimer.c
@@ -1,26 +0,0 @@-/*- * arch/arm/mach-tegra/localtimer.c- *- * Copyright (C) 2002 ARM Ltd.- * All Rights Reserved- *- * This program is free software; you can redistribute it and/or modify- * it under the terms of the GNU General Public License version 2 as- * published by the Free Software Foundation.- */-#include <linux/init.h>-#include <linux/smp.h>-#include <linux/clockchips.h>-#include <asm/irq.h>-#include <asm/smp_twd.h>-#include <asm/localtimer.h>--/*- * Setup the local clock events for a CPU.- */-int __cpuinit local_timer_setup(struct clock_event_device *evt)-{- evt->irq = IRQ_LOCALTIMER;- twd_timer_setup(evt);- return 0;-}
@@ -1,26 +0,0 @@-/*- * SMP support for R-Mobile / SH-Mobile - local timer portion- *- * Copyright (C) 2010 Magnus Damm- *- * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved- *- * This program is free software; you can redistribute it and/or modify- * it under the terms of the GNU General Public License version 2 as- * published by the Free Software Foundation.- */-#include <linux/init.h>-#include <linux/smp.h>-#include <linux/clockchips.h>-#include <asm/smp_twd.h>-#include <asm/localtimer.h>--/*- * Setup the local clock events for a CPU.- */-int __cpuinit local_timer_setup(struct clock_event_device *evt)-{- evt->irq = 29;- twd_timer_setup(evt);- return 0;-}
@@ -81,11 +83,7 @@ unsigned int __init r8a7779_get_core_count(void){void__iomem*scu_base=scu_base_addr();-#ifdef CONFIG_HAVE_ARM_TWD-/* twd_base needs to be initialized before percpu_timer_setup() */-twd_base=(void__iomem*)0xf0000600;-#endif-+shmobile_twd_init(&twd_local_timer);returnscu_get_core_count(scu_base);}
@@ -59,11 +61,7 @@ unsigned int __init sh73a0_get_core_count(void){void__iomem*scu_base=scu_base_addr();-#ifdef CONFIG_HAVE_ARM_TWD-/* twd_base needs to be initialized before percpu_timer_setup() */-twd_base=(void__iomem*)0xf0000600;-#endif-+shmobile_twd_init(&twd_local_timer);returnscu_get_core_count(scu_base);}
@@ -1,29 +0,0 @@-/*- * Copyright (C) 2008-2009 ST-Ericsson- * Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>- *- * This file is heavily based on relaview platform, almost a copy.- *- * Copyright (C) 2002 ARM Ltd.- *- * This program is free software; you can redistribute it and/or modify- * it under the terms of the GNU General Public License version 2 as- * published by the Free Software Foundation.- */-#include <linux/init.h>-#include <linux/smp.h>-#include <linux/clockchips.h>--#include <asm/irq.h>-#include <asm/smp_twd.h>-#include <asm/localtimer.h>--/*- * Setup the local clock events for a CPU.- */-int __cpuinit local_timer_setup(struct clock_event_device *evt)-{- evt->irq = IRQ_LOCALTIMER;- twd_timer_setup(evt);- return 0;-}
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:35
Add support for the new smp_twd runtime registration interface
to the highbank platforms, and remove the old compile-time support.
The highbank DTS file is updated to match the TWD DT documentation
and fixes the timer trigger (rising edge).
Acked-by: Rob Herring <redacted>
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/boot/dts/highbank.dts | 8 +++---
arch/arm/mach-highbank/Makefile | 1 -
arch/arm/mach-highbank/highbank.c | 3 ++
arch/arm/mach-highbank/localtimer.c | 40 -----------------------------------
4 files changed, 7 insertions(+), 45 deletions(-)
delete mode 100644 arch/arm/mach-highbank/localtimer.c
@@ -1,40 +0,0 @@-/*- * Copyright 2010-2011 Calxeda, Inc.- * Based on localtimer.c, Copyright (C) 2002 ARM Ltd.- *- * This program is free software; you can redistribute it and/or modify it- * under the terms and conditions of the GNU General Public License,- * version 2, as published by the Free Software Foundation.- *- * This program is distributed in the hope it will be useful, but WITHOUT- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for- * more details.- *- * You should have received a copy of the GNU General Public License along with- * this program. If not, see <http://www.gnu.org/licenses/>.- */-#include <linux/init.h>-#include <linux/clockchips.h>-#include <linux/of.h>-#include <linux/of_address.h>-#include <linux/of_irq.h>--#include <asm/smp_twd.h>--/*- * Setup the local clock events for a CPU.- */-int __cpuinit local_timer_setup(struct clock_event_device *evt)-{- struct device_node *np;-- np = of_find_compatible_node(NULL, NULL, "arm,smp-twd");- if (!twd_base) {- twd_base = of_iomap(np, 0);- WARN_ON(!twd_base);- }- evt->irq = irq_of_parse_and_map(np, 0);- twd_timer_setup(evt);- return 0;-}
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:36
Add support for the new smp_twd runtime registration interface
to the imx6q platforms, and remove the old compile-time support.
The imx6q DTS file is updated to match the TWD DT documentation.
Also present in this patch a DTS fix to the timer interrupt routing
(the PPI connection uses bits [15:8]) and trigger (rising edge).
Cc: Shawn Guo <redacted>
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/boot/dts/imx6q.dtsi | 6 +++---
arch/arm/mach-imx/Makefile | 1 -
arch/arm/mach-imx/localtimer.c | 35 -----------------------------------
arch/arm/mach-imx/mach-imx6q.c | 2 ++
4 files changed, 5 insertions(+), 39 deletions(-)
delete mode 100644 arch/arm/mach-imx/localtimer.c
@@ -1,35 +0,0 @@-/*- * Copyright 2011 Freescale Semiconductor, Inc.- * Copyright 2011 Linaro Ltd.- *- * The code contained herein is licensed under the GNU General Public- * License. You may obtain a copy of the GNU General Public License- * Version 2 or later at the following locations:- *- * http://www.opensource.org/licenses/gpl-license.html- * http://www.gnu.org/copyleft/gpl.html- */--#include <linux/init.h>-#include <linux/clockchips.h>-#include <linux/of_address.h>-#include <linux/of_irq.h>-#include <asm/smp_twd.h>--/*- * Setup the local clock events for a CPU.- */-int __cpuinit local_timer_setup(struct clock_event_device *evt)-{- struct device_node *np;-- np = of_find_compatible_node(NULL, NULL, "arm,smp-twd");- if (!twd_base) {- twd_base = of_iomap(np, 0);- WARN_ON(!twd_base);- }- evt->irq = irq_of_parse_and_map(np, 0);- twd_timer_setup(evt);-- return 0;-}
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:37
Now that all users of the previous local timer interface
have been converted to the runtime registration API, make
this interface the only one supported for this driver.
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/include/asm/localtimer.h | 8 --------
arch/arm/include/asm/smp_twd.h | 6 ------
arch/arm/kernel/smp_twd.c | 34 +++++-----------------------------
3 files changed, 5 insertions(+), 43 deletions(-)
@@ -28,7 +28,7 @@#include<asm/hardware/gic.h>/* set up by the platform code */-void__iomem*twd_base;+staticvoid__iomem*twd_base;staticstructclk*twd_clk;staticunsignedlongtwd_timer_rate;
@@ -80,7 +80,7 @@ static int twd_set_next_event(unsigned long evt,*Ifalocaltimerinterrupthasoccurred,acknowledgeandreturn1.*Otherwise,return0.*/-inttwd_timer_ack(void)+staticinttwd_timer_ack(void){if(__raw_readl(twd_base+TWD_TIMER_INTSTAT)){__raw_writel(1,twd_base+TWD_TIMER_INTSTAT);
@@ -96,11 +96,6 @@ static void twd_timer_stop(struct clock_event_device *clk)disable_percpu_irq(clk->irq);}-/* Temporary hack to be removed when all TWD users are converted to-thenewregistrationinterface*/-voidlocal_timer_stop(structclock_event_device*clk)-__attribute__((alias("twd_timer_stop")));-#ifdef CONFIG_CPU_FREQ/*
@@ -417,17 +418,11 @@ static void exynos4_mct_tick_init(struct clock_event_device *evt)}else{enable_percpu_irq(IRQ_MCT_LOCALTIMER,0);}-}--/* Setup the local clock events for a CPU */-int__cpuinitlocal_timer_setup(structclock_event_device*evt)-{-exynos4_mct_tick_init(evt);return0;}-voidlocal_timer_stop(structclock_event_device*evt)+staticvoidexynos4_local_timer_stop(structclock_event_device*evt){unsignedintcpu=smp_processor_id();evt->set_mode(CLOCK_EVT_MODE_UNUSED,evt);
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:39
Convert the MSM timers to the runtime registration interface.
Cc: Stephen Boyd <redacted>
Tested-by: David Brown <redacted>
Acked-by: David Brown <redacted>
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/mach-msm/timer.c | 79 +++++++++++++++++++++++++--------------------
1 files changed, 44 insertions(+), 35 deletions(-)
From: Marc Zyngier <hidden> Date: 2012-01-16 13:52:40
Remove all traces of the compile-time local timer interface,
and make the runtime selection mandatory.
Signed-off-by: Marc Zyngier <redacted>
---
arch/arm/include/asm/localtimer.h | 26 --------------------------
arch/arm/kernel/smp.c | 23 ++++++-----------------
2 files changed, 6 insertions(+), 43 deletions(-)
From: Rob Herring <hidden> Date: 2012-01-16 15:59:44
On 01/16/2012 07:52 AM, Marc Zyngier wrote:
Add bindings to support DT discovery of the ARM Timer Watchdog
(aka TWD). Only the timer side is converted by this patch.
Cc: Rob Herring <redacted>
Signed-off-by: Marc Zyngier <redacted>
---
@@ -0,0 +1,48 @@+* ARM Timer Watchdog++ARM 11MP, Cortex-A5 and Cortex-A9 are often associated with a per-core+Timer-Watchdog (aka TWD), which provides both a per-cpu local timer+and watchdog.++The TWD is usually attached to a GIC to deliver its two per-processor+interrupts.++** Timer node required properties:++- compatible : Should be one of:+ "arm,cortex-a9-twd-timer"+ "arm,cortex-a5-twd-timer"+ "arm,arm11mp-twd-timer"++- interrupts : One interrupt to each core++- reg : Specify the base address and the size of the TWD timer+ register window.++Example:++ twd-timer at 2c000600 {+ compatible = "arm,arm11mp-twd-timer"";+ reg = <0x2c000600 0x20>;+ interrupts = <1 13 0xf01>;+ };++** Watchdog node properties:++- compatible : Should be one of:+ "arm,cortex-a9-twd-wdt"+ "arm,cortex-a5-twd-wdt"+ "arm,arm11mp-twd-wdt"++- interrupts : One interrupt to each core++- reg : Specify the base address and the size of the TWD watchdog+ register window.++Example:++ twd-watchdog at 2c000620 {+ compatible = "arm,arm11mp-twd-wdt";+ reg = <0x2c000620 0x20>;+ interrupts = <1 14 0xf01>;+ };
On Mon, Jan 16, 2012 at 01:52:36PM +0000, Marc Zyngier wrote:
Add support for the new smp_twd runtime registration interface
to the imx6q platforms, and remove the old compile-time support.
The imx6q DTS file is updated to match the TWD DT documentation.
Also present in this patch a DTS fix to the timer interrupt routing
(the PPI connection uses bits [15:8]) and trigger (rising edge).
Cc: Shawn Guo <redacted>
Signed-off-by: Marc Zyngier <redacted>
Acked-by: Shawn Guo <redacted>
(Tested on imx6q)
Regards,
Shawn
@@ -1,35 +0,0 @@-/*- * Copyright 2011 Freescale Semiconductor, Inc.- * Copyright 2011 Linaro Ltd.- *- * The code contained herein is licensed under the GNU General Public- * License. You may obtain a copy of the GNU General Public License- * Version 2 or later at the following locations:- *- * http://www.opensource.org/licenses/gpl-license.html- * http://www.gnu.org/copyleft/gpl.html- */--#include <linux/init.h>-#include <linux/clockchips.h>-#include <linux/of_address.h>-#include <linux/of_irq.h>-#include <asm/smp_twd.h>--/*- * Setup the local clock events for a CPU.- */-int __cpuinit local_timer_setup(struct clock_event_device *evt)-{- struct device_node *np;-- np = of_find_compatible_node(NULL, NULL, "arm,smp-twd");- if (!twd_base) {- twd_base = of_iomap(np, 0);- WARN_ON(!twd_base);- }- evt->irq = irq_of_parse_and_map(np, 0);- twd_timer_setup(evt);-- return 0;-}