ARM: EXYNOS: allow dt based discovery of mct controller using clocksource_of_init
authorThomas Abraham <thomas.abraham@linaro.org>
Sat, 9 Mar 2013 07:10:03 +0000 (16:10 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Sat, 9 Mar 2013 07:18:08 +0000 (16:18 +0900)
Add entries to __clksrc_of_table so that Exynos MCT controller is
discoverable using call to clocksource_of_init. With this change,
it would be appropriate to rename the function 'exynos4_timer_init'
as 'mct_init' since it aptly describes this function. Additionally,
the 'init_time' callback of all machine descriptors for exynos
platforms that were previously set to 'exynos4_timer_init' are now
set to either 'mct_init' or 'clocksource_of_init'.

Cc: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-exynos/Kconfig
arch/arm/mach-exynos/common.h
arch/arm/mach-exynos/mach-armlex4210.c
arch/arm/mach-exynos/mach-exynos4-dt.c
arch/arm/mach-exynos/mach-exynos5-dt.c
arch/arm/mach-exynos/mach-nuri.c
arch/arm/mach-exynos/mach-origen.c
arch/arm/mach-exynos/mach-smdk4x12.c
arch/arm/mach-exynos/mach-smdkv310.c
arch/arm/mach-exynos/mct.c

index 70f94c87479df7d4dc2ab8aa25356461a3066b14..52f51e7b4a0c4444ac0e481402673c3c8439946a 100644 (file)
@@ -406,6 +406,7 @@ config MACH_EXYNOS4_DT
        bool "Samsung Exynos4 Machine using device tree"
        depends on ARCH_EXYNOS4
        select ARM_AMBA
+       select CLKSRC_OF
        select CPU_EXYNOS4210
        select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
        select PINCTRL
@@ -422,6 +423,7 @@ config MACH_EXYNOS5_DT
        default y
        depends on ARCH_EXYNOS5
        select ARM_AMBA
+       select CLKSRC_OF
        select USE_OF
        help
          Machine support for Samsung EXYNOS5 machine with device tree enabled.
index 9339bb8954be9e8bc3f8787dbdfd630eaf7c7909..3b186eaaaa7b906cd61156d33c27207fb0302dc1 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H
 #define __ARCH_ARM_MACH_EXYNOS_COMMON_H
 
-extern void exynos4_timer_init(void);
+extern void mct_init(void);
 
 struct map_desc;
 void exynos_init_io(struct map_desc *mach_desc, int size);
index 685f29173afa8295313ab2e6320a2d029fb90ff2..3b1a34742679ac06c66846ddacec51303b16f514 100644 (file)
@@ -202,6 +202,6 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
        .map_io         = armlex4210_map_io,
        .init_machine   = armlex4210_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = mct_init,
        .restart        = exynos4_restart,
 MACHINE_END
index 3358088c822a3015721b206f1671363df3db67c6..c4ae108e192d643da003981874f40fa6789d7f25 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/of_platform.h>
 #include <linux/serial_core.h>
+#include <linux/clocksource.h>
 
 #include <asm/mach/arch.h>
 #include <mach/map.h>
@@ -142,7 +143,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
        .map_io         = exynos4_dt_map_io,
        .init_machine   = exynos4_dt_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = clocksource_of_init,
        .dt_compat      = exynos4_dt_compat,
        .restart        = exynos4_restart,
 MACHINE_END
index acaeb14db54b933f0c658a0ded6fdb7608abe011..7da4791bfb8b31de8614332842c807770b7b4b9b 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/serial_core.h>
 #include <linux/memblock.h>
 #include <linux/io.h>
+#include <linux/clocksource.h>
 
 #include <asm/mach/arch.h>
 #include <mach/map.h>
@@ -216,7 +217,7 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
        .map_io         = exynos5_dt_map_io,
        .init_machine   = exynos5_dt_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = clocksource_of_init,
        .dt_compat      = exynos5_dt_compat,
        .restart        = exynos5_restart,
        .reserve        = exynos5_reserve,
index 1ea79730187f9e3e1297a717a5a4a66650bf9d6a..da3605d151106ec2fb7f88571c4c372f0330265a 100644 (file)
@@ -1380,7 +1380,7 @@ MACHINE_START(NURI, "NURI")
        .map_io         = nuri_map_io,
        .init_machine   = nuri_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = mct_init,
        .reserve        = &nuri_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
index 579d2d171daa6e4ea21f56611dda80f536d41133..1772cd284f4c48e0e885402ce7ca4d786da98d0c 100644 (file)
@@ -815,7 +815,7 @@ MACHINE_START(ORIGEN, "ORIGEN")
        .map_io         = origen_map_io,
        .init_machine   = origen_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = mct_init,
        .reserve        = &origen_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
index fe6149624b849aa2dd624115711e1eb1e9fcbee6..34a6356364ebd2736006367d5bce31b8091a4a48 100644 (file)
@@ -376,7 +376,7 @@ MACHINE_START(SMDK4212, "SMDK4212")
        .init_irq       = exynos4_init_irq,
        .map_io         = smdk4x12_map_io,
        .init_machine   = smdk4x12_machine_init,
-       .init_time      = exynos4_timer_init,
+       .init_time      = mct_init,
        .restart        = exynos4_restart,
        .reserve        = &smdk4x12_reserve,
 MACHINE_END
@@ -390,7 +390,7 @@ MACHINE_START(SMDK4412, "SMDK4412")
        .map_io         = smdk4x12_map_io,
        .init_machine   = smdk4x12_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = mct_init,
        .restart        = exynos4_restart,
        .reserve        = &smdk4x12_reserve,
 MACHINE_END
index d71672922b191c7270a1dfa3fcdb28718e1bbf66..893b14e8c62a282aa36e8e7f06ee148b120571c8 100644 (file)
@@ -423,7 +423,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
        .init_irq       = exynos4_init_irq,
        .map_io         = smdkv310_map_io,
        .init_machine   = smdkv310_machine_init,
-       .init_time      = exynos4_timer_init,
+       .init_time      = mct_init,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
@@ -436,7 +436,7 @@ MACHINE_START(SMDKC210, "SMDKC210")
        .map_io         = smdkv310_map_io,
        .init_machine   = smdkv310_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = exynos4_timer_init,
+       .init_time      = mct_init,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
index f34c933314f3d67704456c54628ee32651a8beb5..545c98976e93d1b2a6a73c204ffd01dcfd3b084a 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/of.h>
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
+#include <linux/clocksource.h>
 
 #include <asm/arch_timer.h>
 #include <asm/localtimer.h>
@@ -507,17 +508,12 @@ static const struct of_device_id exynos_mct_ids[] = {
        { .compatible = "samsung,exynos4412-mct", .data = (void *)MCT_INT_PPI },
 };
 
-void __init exynos4_timer_init(void)
+void __init mct_init(void)
 {
        struct device_node *np = NULL;
        const struct of_device_id *match;
        u32 nr_irqs, i;
 
-       if (soc_is_exynos5440()) {
-               arch_timer_of_register();
-               return;
-       }
-
 #ifdef CONFIG_OF
        np = of_find_matching_node_and_match(NULL, exynos_mct_ids, &match);
 #endif
@@ -550,3 +546,5 @@ void __init exynos4_timer_init(void)
        exynos4_clocksource_init();
        exynos4_clockevent_init();
 }
+CLOCKSOURCE_OF_DECLARE(exynos4210, "samsung,exynos4210-mct", mct_init)
+CLOCKSOURCE_OF_DECLARE(exynos4412, "samsung,exynos4412-mct", mct_init)