aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-01-10 14:44:19 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2012-03-13 09:30:31 -0400
commit4200b16d58cd34ff8e1616d8ed77417f8fc44864 (patch)
tree63fa9b988e46a741006f12874615241cd2aa9fe5
parent1fcf3a6edde7aeef7a207f8209231dd340a4ea89 (diff)
ARM: shmobile: convert to twd_local_timer_register() interface
Add support for the new smp_twd runtime registration interface to the shmobile platforms, and remove the old compile-time support. Cc: Magnus Damm <magnus.damm@gmail.com> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h2
-rw-r--r--arch/arm/mach-shmobile/localtimer.c26
-rw-r--r--arch/arm/mach-shmobile/platsmp.c1
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7779.c8
-rw-r--r--arch/arm/mach-shmobile/smp-sh73a0.c8
-rw-r--r--arch/arm/mach-shmobile/timer.c10
7 files changed, 18 insertions, 38 deletions
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 7ad6954c46cd..e7c2590b75d9 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -16,7 +16,6 @@ obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o
16# SMP objects 16# SMP objects
17smp-y := platsmp.o headsmp.o 17smp-y := platsmp.o headsmp.o
18smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o 18smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o
19smp-$(CONFIG_LOCAL_TIMERS) += localtimer.o
20smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o 19smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o
21smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o 20smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o
22 21
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index e4b945e271e7..9fde3eb686a6 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -2,6 +2,8 @@
2#define __ARCH_MACH_COMMON_H 2#define __ARCH_MACH_COMMON_H
3 3
4extern struct sys_timer shmobile_timer; 4extern struct sys_timer shmobile_timer;
5struct twd_local_timer;
6void shmobile_twd_init(struct twd_local_timer *twd_local_timer);
5extern void shmobile_setup_console(void); 7extern void shmobile_setup_console(void);
6extern void shmobile_secondary_vector(void); 8extern void shmobile_secondary_vector(void);
7extern int shmobile_platform_cpu_kill(unsigned int cpu); 9extern int shmobile_platform_cpu_kill(unsigned int cpu);
diff --git a/arch/arm/mach-shmobile/localtimer.c b/arch/arm/mach-shmobile/localtimer.c
deleted file mode 100644
index ad9ccc9900c8..000000000000
--- a/arch/arm/mach-shmobile/localtimer.c
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * SMP support for R-Mobile / SH-Mobile - local timer portion
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/init.h>
13#include <linux/smp.h>
14#include <linux/clockchips.h>
15#include <asm/smp_twd.h>
16#include <asm/localtimer.h>
17
18/*
19 * Setup the local clock events for a CPU.
20 */
21int __cpuinit local_timer_setup(struct clock_event_device *evt)
22{
23 evt->irq = 29;
24 twd_timer_setup(evt);
25 return 0;
26}
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
index 993381257f69..45fa3924c6a1 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -17,7 +17,6 @@
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <asm/hardware/gic.h> 19#include <asm/hardware/gic.h>
20#include <asm/localtimer.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22#include <mach/common.h> 21#include <mach/common.h>
23 22
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index 4fe2e9eaf501..9bb7b8575a1f 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -64,6 +64,8 @@ static void __iomem *scu_base_addr(void)
64static DEFINE_SPINLOCK(scu_lock); 64static DEFINE_SPINLOCK(scu_lock);
65static unsigned long tmp; 65static unsigned long tmp;
66 66
67static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);
68
67static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) 69static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
68{ 70{
69 void __iomem *scu_base = scu_base_addr(); 71 void __iomem *scu_base = scu_base_addr();
@@ -82,11 +84,7 @@ unsigned int __init r8a7779_get_core_count(void)
82{ 84{
83 void __iomem *scu_base = scu_base_addr(); 85 void __iomem *scu_base = scu_base_addr();
84 86
85#ifdef CONFIG_HAVE_ARM_TWD 87 shmobile_twd_init(&twd_local_timer);
86 /* twd_base needs to be initialized before percpu_timer_setup() */
87 twd_base = (void __iomem *)0xf0000600;
88#endif
89
90 return scu_get_core_count(scu_base); 88 return scu_get_core_count(scu_base);
91} 89}
92 90
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
index 0d159d64a345..2e687932f83c 100644
--- a/arch/arm/mach-shmobile/smp-sh73a0.c
+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
@@ -42,6 +42,8 @@ static void __iomem *scu_base_addr(void)
42static DEFINE_SPINLOCK(scu_lock); 42static DEFINE_SPINLOCK(scu_lock);
43static unsigned long tmp; 43static unsigned long tmp;
44 44
45static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);
46
45static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) 47static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
46{ 48{
47 void __iomem *scu_base = scu_base_addr(); 49 void __iomem *scu_base = scu_base_addr();
@@ -60,11 +62,7 @@ unsigned int __init sh73a0_get_core_count(void)
60{ 62{
61 void __iomem *scu_base = scu_base_addr(); 63 void __iomem *scu_base = scu_base_addr();
62 64
63#ifdef CONFIG_HAVE_ARM_TWD 65 shmobile_twd_init(&twd_local_timer);
64 /* twd_base needs to be initialized before percpu_timer_setup() */
65 twd_base = (void __iomem *)0xf0000600;
66#endif
67
68 return scu_get_core_count(scu_base); 66 return scu_get_core_count(scu_base);
69} 67}
70 68
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
index 895794b543cd..be16231e86fc 100644
--- a/arch/arm/mach-shmobile/timer.c
+++ b/arch/arm/mach-shmobile/timer.c
@@ -20,6 +20,7 @@
20 */ 20 */
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <asm/mach/time.h> 22#include <asm/mach/time.h>
23#include <asm/smp_twd.h>
23 24
24static void __init shmobile_late_time_init(void) 25static void __init shmobile_late_time_init(void)
25{ 26{
@@ -41,6 +42,15 @@ static void __init shmobile_timer_init(void)
41 late_time_init = shmobile_late_time_init; 42 late_time_init = shmobile_late_time_init;
42} 43}
43 44
45void __init shmobile_twd_init(struct twd_local_timer *twd_local_timer)
46{
47#ifdef CONFIG_HAVE_ARM_TWD
48 int err = twd_local_timer_register(twd_local_timer);
49 if (err)
50 pr_err("twd_local_timer_register failed %d\n", err);
51#endif
52}
53
44struct sys_timer shmobile_timer = { 54struct sys_timer shmobile_timer = {
45 .init = shmobile_timer_init, 55 .init = shmobile_timer_init,
46}; 56};