ARM/clocksource: use automatic DT probing for ux500 PRCMU
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 1 Dec 2015 14:00:24 +0000 (15:00 +0100)
committerArnd Bergmann <arnd@arndb.de>
Tue, 1 Dec 2015 21:37:02 +0000 (22:37 +0100)
The ARM core kernel already calls clocksource_of_init() so why
go to all the trouble of locating and probing this node in the
machine. CLOCKSOURCE_OF_DECLARE() will take care of it in the
clocksource driver, and thus we can also get rid of the
dangling header file <linux/clksrc-dbx500-prcmu.h>

Suggested-by: Arnd Bergmann <arndb@linaro.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-ux500/Makefile
arch/arm/mach-ux500/cpu-db8500.c
arch/arm/mach-ux500/cpu.c
arch/arm/mach-ux500/setup.h
arch/arm/mach-ux500/timer.c [deleted file]
drivers/clocksource/clksrc-dbx500-prcmu.c
include/linux/clksrc-dbx500-prcmu.h [deleted file]

index c8643ac5db712b17847b7f429312b147c7d6ad52..edfff1ae1f8d888d9c12a21b30f24af4281e4ab0 100644 (file)
@@ -2,7 +2,7 @@
 # Makefile for the linux kernel, U8500 machine.
 #
 
-obj-y                          := cpu.o id.o timer.o pm.o
+obj-y                          := cpu.o id.o pm.o
 obj-$(CONFIG_CACHE_L2X0)       += cache-l2x0.o
 obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o
 obj-$(CONFIG_MACH_MOP500)      += board-mop500-regulators.o \
index f80560318c58ca2b53458afb0e71127c14fb52e3..a0ffaad1fb612fe42b059c2e99313d0d30a0d9f6 100644 (file)
@@ -156,8 +156,6 @@ static const char * stericsson_dt_platform_compat[] = {
 DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)")
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
-       /* we re-use nomadik timer here */
-       .init_time      = ux500_timer_init,
        .init_machine   = u8500_init_machine,
        .init_late      = NULL,
        .dt_compat      = stericsson_dt_platform_compat,
index 41b81c4fbe636593ef26f1dc2de110b435ff61cf..82156cbc22cec46499d187bc45517b60d62fb01e 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/mfd/dbx500-prcmu.h>
-#include <linux/clksrc-dbx500-prcmu.h>
 #include <linux/sys_soc.h>
 #include <linux/err.h>
 #include <linux/slab.h>
index 65876eac0761a232ab570b52040590abb488028c..c704254ab67c68b833b1a919072ed6fc56463078 100644 (file)
@@ -12,7 +12,6 @@
 #define __ASM_ARCH_SETUP_H
 
 #include <asm/mach/arch.h>
-#include <asm/mach/time.h>
 #include <linux/init.h>
 #include <linux/mfd/abx500/ab8500.h>
 
@@ -24,8 +23,6 @@ extern void __init ux500_init_irq(void);
 
 extern struct device *ux500_soc_device_init(const char *soc_id);
 
-extern void ux500_timer_init(void);
-
 extern void ux500_cpu_die(unsigned int cpu);
 
 #endif /*  __ASM_ARCH_SETUP_H */
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c
deleted file mode 100644 (file)
index 8d2d233..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) ST-Ericsson SA 2011
- *
- * License Terms: GNU General Public License v2
- * Author: Mattias Wallin <mattias.wallin@stericsson.com> for ST-Ericsson
- */
-#include <linux/io.h>
-#include <linux/errno.h>
-#include <linux/clksrc-dbx500-prcmu.h>
-#include <linux/clocksource.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-
-#include "setup.h"
-
-#include "db8500-regs.h"
-#include "id.h"
-
-static const struct of_device_id prcmu_timer_of_match[] __initconst = {
-       { .compatible = "stericsson,db8500-prcmu-timer-4", },
-       { },
-};
-
-void __init ux500_timer_init(void)
-{
-       void __iomem *prcmu_timer_base;
-       void __iomem *tmp_base;
-       struct device_node *np;
-
-       if (cpu_is_u8500_family() || cpu_is_ux540_family())
-               prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE);
-       else
-               ux500_unknown_soc();
-
-       np = of_find_matching_node(NULL, prcmu_timer_of_match);
-       if (!np)
-               goto dt_fail;
-
-       tmp_base = of_iomap(np, 0);
-       if (!tmp_base)
-               goto dt_fail;
-
-       prcmu_timer_base = tmp_base;
-
-dt_fail:
-       clksrc_dbx500_prcmu_init(prcmu_timer_base);
-       clocksource_probe();
-}
index b375106844d83e6bb2321e8768b02b92e2031efa..dfad6eb9966289831330e5cd13979a74d5eec9ea 100644 (file)
@@ -12,8 +12,9 @@
  * power domain.  We use the Timer 4 for our always-on clock
  * source on DB8500.
  */
+#include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/clockchips.h>
-#include <linux/clksrc-dbx500-prcmu.h>
 #include <linux/sched_clock.h>
 
 #define RATE_32K               32768
@@ -63,9 +64,9 @@ static u64 notrace dbx500_prcmu_sched_clock_read(void)
 
 #endif
 
-void __init clksrc_dbx500_prcmu_init(void __iomem *base)
+static void __init clksrc_dbx500_prcmu_init(struct device_node *node)
 {
-       clksrc_dbx500_timer_base = base;
+       clksrc_dbx500_timer_base = of_iomap(node, 0);
 
        /*
         * The A9 sub system expects the timer to be configured as
@@ -85,3 +86,5 @@ void __init clksrc_dbx500_prcmu_init(void __iomem *base)
 #endif
        clocksource_register_hz(&clocksource_dbx500_prcmu, RATE_32K);
 }
+CLOCKSOURCE_OF_DECLARE(dbx500_prcmu, "stericsson,db8500-prcmu-timer-4",
+                      clksrc_dbx500_prcmu_init);
diff --git a/include/linux/clksrc-dbx500-prcmu.h b/include/linux/clksrc-dbx500-prcmu.h
deleted file mode 100644 (file)
index 4fb8119..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) ST-Ericsson SA 2011
- *
- * License Terms: GNU General Public License v2
- * Author: Mattias Wallin <mattias.wallin@stericsson.com>
- *
- */
-#ifndef __CLKSRC_DBX500_PRCMU_H
-#define __CLKSRC_DBX500_PRCMU_H
-
-#include <linux/init.h>
-#include <linux/io.h>
-
-#ifdef CONFIG_CLKSRC_DBX500_PRCMU
-void __init clksrc_dbx500_prcmu_init(void __iomem *base);
-#else
-static inline void __init clksrc_dbx500_prcmu_init(void __iomem *base) {}
-#endif
-
-#endif