ARM: EXYNOS: Initialize the clocks prior to timer initialization
authorThomas Abraham <thomas.abraham@linaro.org>
Sat, 9 Mar 2013 08:03:29 +0000 (17:03 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Mon, 25 Mar 2013 09:17:12 +0000 (18:17 +0900)
Since the clock initialization should be completed prior to the mct
timer initialization, create a new function 'exynos_init_time' that
first sets up the clock and then invokes the timer initialization
function. The 'init_time' callback in the board files are updated to
invoke this new wrapper function.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-exynos/common.c
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

index f4e8222bc3c457a8ad883b6b166021d3efa9d370..50331790abc8dce638d3fec7543bea748339814d 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/irqdomain.h>
 #include <linux/irqchip.h>
 #include <linux/of_address.h>
+#include <linux/clocksource.h>
+#include <linux/clk-provider.h>
 #include <linux/irqchip/arm-gic.h>
 
 #include <asm/proc-fns.h>
@@ -395,6 +397,20 @@ static void __init exynos5440_map_io(void)
        iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0));
 }
 
+void __init exynos_init_time(void)
+{
+       if (of_have_populated_dt()) {
+#ifdef CONFIG_OF
+               of_clk_init(NULL);
+               clocksource_of_init();
+#endif
+       } else {
+               /* todo: remove after migrating legacy E4 platforms to dt */
+               exynos4_clk_init(NULL);
+               mct_init();
+       }
+}
+
 void __init exynos4_init_irq(void)
 {
        unsigned int gic_bank_offset;
index 376d6964e4aad50d115fe0fa088d059d024b2b18..2c23b659ae3e84bcc645592318d7248d93949d64 100644 (file)
@@ -201,6 +201,6 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
        .map_io         = armlex4210_map_io,
        .init_machine   = armlex4210_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .restart        = exynos4_restart,
 MACHINE_END
index e1f714647e5092870c306332f3ae0513eb804a71..47a2190cc453867cc986e9692b8abd07c93e3375 100644 (file)
@@ -158,7 +158,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      = clocksource_of_init,
+       .init_time      = exynos_init_time,
        .dt_compat      = exynos4_dt_compat,
        .restart        = exynos4_restart,
        .reserve        = exynos4_reserve,
index 06b2e9596cdf1a4106b91854e06555d446811a79..9bae9aa8d548567d5df4b88017082fce40a2928b 100644 (file)
@@ -213,7 +213,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      = clocksource_of_init,
+       .init_time      = exynos_init_time,
        .dt_compat      = exynos5_dt_compat,
        .restart        = exynos5_restart,
        .reserve        = exynos5_reserve,
index 8ddbceb5ccc39000c6207bc271d13f531289063c..0555e6d42d5d9d6febfee7f30519f4a8f5692a2f 100644 (file)
@@ -1379,7 +1379,7 @@ MACHINE_START(NURI, "NURI")
        .map_io         = nuri_map_io,
        .init_machine   = nuri_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .reserve        = &nuri_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
index 620d60c8fbb50cb3f0037bb3e2204570ecdb4834..e42e61ae1e1c325bed98cf3a0be3f42cbe3a9a46 100644 (file)
@@ -814,7 +814,7 @@ MACHINE_START(ORIGEN, "ORIGEN")
        .map_io         = origen_map_io,
        .init_machine   = origen_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .reserve        = &origen_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
index 63ee1b1a826365172c558f737951d2afc34a9f81..184faa3bd93aae1e47efc3d2d809127a3f414c09 100644 (file)
@@ -375,7 +375,7 @@ MACHINE_START(SMDK4212, "SMDK4212")
        .init_irq       = exynos4_init_irq,
        .map_io         = smdk4x12_map_io,
        .init_machine   = smdk4x12_machine_init,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .restart        = exynos4_restart,
        .reserve        = &smdk4x12_reserve,
 MACHINE_END
@@ -389,7 +389,7 @@ MACHINE_START(SMDK4412, "SMDK4412")
        .map_io         = smdk4x12_map_io,
        .init_machine   = smdk4x12_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .restart        = exynos4_restart,
        .reserve        = &smdk4x12_reserve,
 MACHINE_END
index 51fa235b4dc990c444563501ebd1ecb8e5d82d3c..4bf21988d7b33684fa09eefb1c5acc4afd4397ef 100644 (file)
@@ -422,7 +422,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
        .init_irq       = exynos4_init_irq,
        .map_io         = smdkv310_map_io,
        .init_machine   = smdkv310_machine_init,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
@@ -435,7 +435,7 @@ MACHINE_START(SMDKC210, "SMDKC210")
        .map_io         = smdkv310_map_io,
        .init_machine   = smdkv310_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
 MACHINE_END