diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-01-10 14:44:19 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2012-03-13 09:30:31 -0400 |
commit | 4200b16d58cd34ff8e1616d8ed77417f8fc44864 (patch) | |
tree | 63fa9b988e46a741006f12874615241cd2aa9fe5 | |
parent | 1fcf3a6edde7aeef7a207f8209231dd340a4ea89 (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/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/localtimer.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/platsmp.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/smp-r8a7779.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/smp-sh73a0.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/timer.c | 10 |
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 |
17 | smp-y := platsmp.o headsmp.o | 17 | smp-y := platsmp.o headsmp.o |
18 | smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 18 | smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
19 | smp-$(CONFIG_LOCAL_TIMERS) += localtimer.o | ||
20 | smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o | 19 | smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o |
21 | smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o | 20 | smp-$(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 | ||
4 | extern struct sys_timer shmobile_timer; | 4 | extern struct sys_timer shmobile_timer; |
5 | struct twd_local_timer; | ||
6 | void shmobile_twd_init(struct twd_local_timer *twd_local_timer); | ||
5 | extern void shmobile_setup_console(void); | 7 | extern void shmobile_setup_console(void); |
6 | extern void shmobile_secondary_vector(void); | 8 | extern void shmobile_secondary_vector(void); |
7 | extern int shmobile_platform_cpu_kill(unsigned int cpu); | 9 | extern 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 | */ | ||
21 | int __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) | |||
64 | static DEFINE_SPINLOCK(scu_lock); | 64 | static DEFINE_SPINLOCK(scu_lock); |
65 | static unsigned long tmp; | 65 | static unsigned long tmp; |
66 | 66 | ||
67 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); | ||
68 | |||
67 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) | 69 | static 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) | |||
42 | static DEFINE_SPINLOCK(scu_lock); | 42 | static DEFINE_SPINLOCK(scu_lock); |
43 | static unsigned long tmp; | 43 | static unsigned long tmp; |
44 | 44 | ||
45 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); | ||
46 | |||
45 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) | 47 | static 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 | ||
24 | static void __init shmobile_late_time_init(void) | 25 | static 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 | ||
45 | void __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 | |||
44 | struct sys_timer shmobile_timer = { | 54 | struct sys_timer shmobile_timer = { |
45 | .init = shmobile_timer_init, | 55 | .init = shmobile_timer_init, |
46 | }; | 56 | }; |