aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 14:22:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 14:22:14 -0400
commit1bf25e78af317e6d5d9b5594dfeb0036e0d589d6 (patch)
tree49dbd2d7bd6856b8ae1864c2dd0c0eb5e36d5398 /drivers/clocksource
parent38f56f33ca381751f9b8910f67e7a805ec0b68cb (diff)
parent0592c2189ece16f3e0c5a56245634aba93d0c9dd (diff)
Merge tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC late cleanups from Arnd Bergmann: "These are cleanups and smaller changes that either depend on earlier feature branches or came in late during the development cycle. We normally try to get all cleanups early, so these are the exceptions: - A follow-up on the clocksource reworks, hopefully the last time we need to merge clocksource subsystem changes through arm-soc. A first set of patches was part of the original 3.10 arm-soc cleanup series because of interdependencies with timer drivers now moved out of arch/arm. - Migrating the SPEAr13xx platform away from using auxdata for DMA channel descriptions towards using information in device tree, based on the earlier SPEAr multiplatform series - A few follow-ups on the Atmel SAMA5 support and other changes for Atmel at91 based on the larger at91 reworks. - Moving the armada irqchip implementation to drivers/irqchip - Several OMAP cleanups following up on the larger series already merged in 3.10." * tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (50 commits) ARM: OMAP4: change the device names in usb_bind_phy ARM: OMAP2+: Fix mismerge for timer.c between ff931c82 and da4a686a ARM: SPEAr: conditionalize SMP code ARM: arch_timer: Silence debug preempt warnings ARM: OMAP: remove unused variable serial: amba-pl011: fix !CONFIG_DMA_ENGINE case ata: arasan: remove the need for platform_data ARM: at91/sama5d34ek.dts: remove not needed compatibility string ARM: at91: dts: add MCI DMA support ARM: at91: dts: add i2c dma support ARM: at91: dts: set #dma-cells to the correct value ARM: at91: suspend both memory controllers on at91sam9263 irqchip: armada-370-xp: slightly cleanup irq controller driver irqchip: armada-370-xp: move IRQ handler to avoid forward declaration irqchip: move IRQ driver for Armada 370/XP ARM: mvebu: move L2 cache initialization in init_early() devtree: add binding documentation for sp804 ARM: integrator-cp: convert use CLKSRC_OF for timer init ARM: versatile: use OF init for sp804 timer ARM: versatile: add versatile dtbs to dtbs target ...
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/Kconfig1
-rw-r--r--drivers/clocksource/arm_arch_timer.c33
-rw-r--r--drivers/clocksource/exynos_mct.c1
3 files changed, 16 insertions, 19 deletions
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 7bc6e51757ee..c20de4a85cbd 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -65,6 +65,7 @@ config CLKSRC_DBX500_PRCMU_SCHED_CLOCK
65 65
66config ARM_ARCH_TIMER 66config ARM_ARCH_TIMER
67 bool 67 bool
68 select CLKSRC_OF if OF
68 69
69config CLKSRC_METAG_GENERIC 70config CLKSRC_METAG_GENERIC
70 def_bool y if METAG 71 def_bool y if METAG
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index d7ad425ab9b3..a2b254189782 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -248,14 +248,16 @@ static void __cpuinit arch_timer_stop(struct clock_event_device *clk)
248static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, 248static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self,
249 unsigned long action, void *hcpu) 249 unsigned long action, void *hcpu)
250{ 250{
251 struct clock_event_device *evt = this_cpu_ptr(arch_timer_evt); 251 /*
252 252 * Grab cpu pointer in each case to avoid spurious
253 * preemptible warnings
254 */
253 switch (action & ~CPU_TASKS_FROZEN) { 255 switch (action & ~CPU_TASKS_FROZEN) {
254 case CPU_STARTING: 256 case CPU_STARTING:
255 arch_timer_setup(evt); 257 arch_timer_setup(this_cpu_ptr(arch_timer_evt));
256 break; 258 break;
257 case CPU_DYING: 259 case CPU_DYING:
258 arch_timer_stop(evt); 260 arch_timer_stop(this_cpu_ptr(arch_timer_evt));
259 break; 261 break;
260 } 262 }
261 263
@@ -337,22 +339,14 @@ out:
337 return err; 339 return err;
338} 340}
339 341
340static const struct of_device_id arch_timer_of_match[] __initconst = { 342static void __init arch_timer_init(struct device_node *np)
341 { .compatible = "arm,armv7-timer", },
342 { .compatible = "arm,armv8-timer", },
343 {},
344};
345
346int __init arch_timer_init(void)
347{ 343{
348 struct device_node *np;
349 u32 freq; 344 u32 freq;
350 int i; 345 int i;
351 346
352 np = of_find_matching_node(NULL, arch_timer_of_match); 347 if (arch_timer_get_rate()) {
353 if (!np) { 348 pr_warn("arch_timer: multiple nodes in dt, skipping\n");
354 pr_err("arch_timer: can't find DT node\n"); 349 return;
355 return -ENODEV;
356 } 350 }
357 351
358 /* Try to determine the frequency from the device tree or CNTFRQ */ 352 /* Try to determine the frequency from the device tree or CNTFRQ */
@@ -378,7 +372,7 @@ int __init arch_timer_init(void)
378 if (!arch_timer_ppi[PHYS_SECURE_PPI] || 372 if (!arch_timer_ppi[PHYS_SECURE_PPI] ||
379 !arch_timer_ppi[PHYS_NONSECURE_PPI]) { 373 !arch_timer_ppi[PHYS_NONSECURE_PPI]) {
380 pr_warn("arch_timer: No interrupt available, giving up\n"); 374 pr_warn("arch_timer: No interrupt available, giving up\n");
381 return -EINVAL; 375 return;
382 } 376 }
383 } 377 }
384 378
@@ -387,5 +381,8 @@ int __init arch_timer_init(void)
387 else 381 else
388 arch_timer_read_counter = arch_counter_get_cntpct; 382 arch_timer_read_counter = arch_counter_get_cntpct;
389 383
390 return arch_timer_register(); 384 arch_timer_register();
385 arch_timer_arch_init();
391} 386}
387CLOCKSOURCE_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_init);
388CLOCKSOURCE_OF_DECLARE(armv8_arch_timer, "arm,armv8-timer", arch_timer_init);
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 661026834b23..13a9e4923a03 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -24,7 +24,6 @@
24#include <linux/of_address.h> 24#include <linux/of_address.h>
25#include <linux/clocksource.h> 25#include <linux/clocksource.h>
26 26
27#include <asm/arch_timer.h>
28#include <asm/localtimer.h> 27#include <asm/localtimer.h>
29 28
30#include <plat/cpu.h> 29#include <plat/cpu.h>