ARM: smp_twd: convert to use CLKSRC_OF init
Subsystems (9)
PATCH 1/1 ARM: smp_twd: convert to use CLKSRC_OF init
From: Rob Herring <[email protected]>
Now that we have OF based init with CLKSRC_OF, convert smp_twd init function to use it and covert all callers of twd_local_timer_of_register.
---
This is dependent on my previous series:
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-February/148313.html
arch/arm/Kconfig | 1 + arch/arm/include/asm/smp_twd.h | 8 -------- arch/arm/kernel/smp_twd.c | 17 ++++------------- arch/arm/mach-highbank/highbank.c | 5 ++--- arch/arm/mach-imx/mach-imx6q.c | 3 +-- arch/arm/mach-omap2/timer.c | 2 +- arch/arm/mach-spear13xx/spear13xx.c | 3 +-- arch/arm/mach-ux500/timer.c | 2 +- arch/arm/mach-vexpress/v2m.c | 4 ++-- drivers/clocksource/tegra20_timer.c | 3 --- 10 files changed, 13 insertions(+), 35 deletions(-)
arch/arm/Kconfig +1 -0
@@ -1570,6 +1570,7 @@ config ARM_ARCH_TIMER config HAVE_ARM_TWD bool depends on SMP + select CLKSRC_OF if OF help This options enables support for the ARM timer and watchdog unit
arch/arm/include/asm/smp_twd.h +0 -8
@@ -34,12 +34,4 @@ struct twd_local_timer name __initdata = { \int twd_local_timer_register (struct twd_local_timer *); -#ifdef CONFIG_HAVE_ARM_TWD -void twd_local_timer_of_register (void ); -#else -static inline void twd_local_timer_of_register (void ) -{ -} -#endif -#endif
arch/arm/kernel/smp_twd.c +4 -13
@@ -376,22 +376,10 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt) }#ifdef CONFIG_OF -const static struct of_device_id twd_of_match[]__initconst = { - { .compatible ="arm,cortex-a9-twd-timer" , }, - { .compatible ="arm,cortex-a5-twd-timer" , }, - { .compatible ="arm,arm11mp-twd-timer" , }, - { }, -}; - -void __init twd_local_timer_of_register (void ) +static void __init twd_local_timer_of_register (struct device_node *np) { -struct device_node *np;int err; - np =of_find_matching_node (NULL , twd_of_match); -if (!np) -return ; - twd_ppi =irq_of_parse_and_map (np,0 );if (!twd_ppi) { err = -EINVAL ;
@@ -409,4 +397,7 @@ void __init twd_local_timer_of_register(void) out: WARN(err, "twd_local_timer_of_register failed (%d)\n", err); } +CLOCKSOURCE_OF_DECLARE (arm_twd_a9,"arm,cortex-a9-twd-timer" , twd_local_timer_of_register); +CLOCKSOURCE_OF_DECLARE (arm_twd_a5,"arm,cortex-a5-twd-timer" , twd_local_timer_of_register); +CLOCKSOURCE_OF_DECLARE (arm_twd_11mp,"arm,arm11mp-twd-timer" , twd_local_timer_of_register);#endif
arch/arm/mach-highbank/highbank.c +2 -3
@@ -31,7 +31,6 @@#include <asm/cacheflush.h> #include <asm/cputype.h> #include <asm/smp_plat.h> -#include <asm/smp_twd.h> #include <asm/hardware/arm_timer.h> #include <asm/hardware/timer-sp.h> #include <asm/hardware/cache-l2x0.h>
@@ -118,10 +117,10 @@ static void __init highbank_timer_init(void)sp804_clocksource_and_sched_clock_init (timer_base +0x20 ,"timer1" );sp804_clockevents_init (timer_base, irq,"timer0" ); -twd_local_timer_of_register (); -arch_timer_of_register ();arch_timer_sched_clock_init (); + +clocksource_of_init (); }static void highbank_power_off (void )
arch/arm/mach-imx/mach-imx6q.c +1 -2
@@ -26,7 +26,6 @@#include <linux/regmap.h> #include <linux/micrel_phy.h> #include <linux/mfd/syscon.h> -#include <asm/smp_twd.h> #include <asm/hardware/cache-l2x0.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -227,7 +226,7 @@ static void __init imx6q_init_irq(void)static void __init imx6q_timer_init (void ) {mx6q_clocks_init (); -twd_local_timer_of_register (); +clocksource_of_init ();imx_print_silicon_rev ("i.MX6Q" ,imx6q_revision ()); }
arch/arm/mach-omap2/timer.c +1 -1
@@ -597,7 +597,7 @@ void __init omap4_local_timer_init(void)int err;if (of_have_populated_dt ()) { -twd_local_timer_of_register (); +clocksource_of_init ();return ; }
arch/arm/mach-spear13xx/spear13xx.c +1 -2
@@ -20,7 +20,6 @@#include <linux/of.h> #include <asm/hardware/cache-l2x0.h> #include <asm/mach/map.h> -#include <asm/smp_twd.h> #include <mach/dma.h> #include <mach/generic.h> #include <mach/spear.h>
@@ -179,5 +178,5 @@ void __init spear13xx_timer_init(void)clk_put (pclk);spear_setup_of_timer (); -twd_local_timer_of_register (); +clocksource_of_init (); }
arch/arm/mach-ux500/timer.c +1 -1
@@ -32,7 +32,7 @@ static void __init ux500_twd_init(void) twd_local_timer = &u8500_twd_local_timer;if (of_have_populated_dt ()) -twd_local_timer_of_register (); +clocksource_of_init ();else { err =twd_local_timer_register (twd_local_timer);if (err)
arch/arm/mach-vexpress/v2m.c +2 -2
@@ -435,6 +435,7 @@ static void __init v2m_dt_timer_init(void)vexpress_clk_of_init (); +clocksource_of_init ();do { node =of_find_compatible_node (node,NULL ,"arm,sp804" ); }while (node &&vexpress_get_site_by_node (node) !=VEXPRESS_SITE_MB );
@@ -445,8 +446,7 @@ static void __init v2m_dt_timer_init(void) irq_of_parse_and_map(node, 0)); } -if (arch_timer_of_register () !=0 ) -twd_local_timer_of_register (); +arch_timer_of_register ();if (arch_timer_sched_clock_init () !=0 ) versatile_sched_clock_init(vexpress_get_24mhz_clock_base(),
drivers/clocksource/tegra20_timer.c +0 -3
@@ -218,9 +218,6 @@ static void __init tegra20_init_timer(struct device_node *np) tegra_clockevent.irq = tegra_timer_irq.irq;clockevents_config_and_register (&tegra_clockevent,1000000 ,0x1 ,0x1fffffff ); -#ifdef CONFIG_HAVE_ARM_TWD -twd_local_timer_of_register (); -#endif }CLOCKSOURCE_OF_DECLARE (tegra20_timer,"nvidia,tegra20-timer" , tegra20_init_timer);
Signature · 1 line
1.7.10.4
PATCH 1/1 ARM: smp_twd: convert to use CLKSRC_OF init
Quoted 5 lines · Rob Herring
From: Rob Herring <[email protected]>
Now that we have OF based init with
CLKSRC_OF, convertsmp_twdinit function to use it and covert all callers oftwd_local_timer_of_register.
Thanks for cleaning these up. I really should have gone through all the timer objects and converted them when I implemented the CLKSRC_OF feature in the first place.
PATCH 1/1 ARM: smp_twd: convert to use CLKSRC_OF init
In reply to Rob HerringQuoted 7 lines · Rob Herring
From: Rob Herring <[email protected]>
Now that we have OF based init with
CLKSRC_OF, convertsmp_twdinit function to use it and covert all callers oftwd_local_timer_of_register.Signed-off-by Rob Herring <[email protected]>
[..]
Quoted 1 line
arch/arm/mach-omap2/timer.c | 2 +-
For OMAP,
Tony Lindgren
maintainerPATCH 1/1 ARM: smp_twd: convert to use CLKSRC_OF init
Quoted 7 lines · Santosh Shilimkar
Quoted 6 lines · Rob Herring
From: Rob Herring <[email protected]>
Now that we have OF based init with
CLKSRC_OF, convertsmp_twdinit function to use it and covert all callers oftwd_local_timer_of_register.
Quoted 8 lines
Quoted 1 line
Signed-off-by Rob Herring <[email protected]>[..]
Quoted 1 line
arch/arm/mach-omap2/timer.c | 2 +-For OMAP,
PATCH 1/1 ARM: smp_twd: convert to use CLKSRC_OF init
In reply to Rob HerringQuoted 5 lines · Rob Herring
From: Rob Herring <[email protected]>
Now that we have OF based init with
CLKSRC_OF, convertsmp_twdinit function to use it and covert all callers oftwd_local_timer_of_register.
This is one good looking patch.
Yours,
Linus Walleij