Merge tag 'multiplatform-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-exynos / common.c
index d126f26dbbf1e6d7a22f18e1d993154045fb2be5..745e304ad0ded17ab6b2f9d9253592739afbc1df 100644 (file)
@@ -452,13 +452,26 @@ void __init exynos_init_time(void)
        } else {
                /* todo: remove after migrating legacy E4 platforms to dt */
 #ifdef CONFIG_ARCH_EXYNOS4
-               exynos4_clk_init(NULL);
+               exynos4_clk_init(NULL, !soc_is_exynos4210(), S5P_VA_CMU, readl(S5P_VA_CHIPID + 8) & 1);
                exynos4_clk_register_fixed_ext(xxti_f, xusbxti_f);
 #endif
-               mct_init();
+               mct_init(S5P_VA_SYSTIMER, EXYNOS4_IRQ_MCT_G0, EXYNOS4_IRQ_MCT_L0, EXYNOS4_IRQ_MCT_L1);
        }
 }
 
+static unsigned int max_combiner_nr(void)
+{
+       if (soc_is_exynos5250())
+               return EXYNOS5_MAX_COMBINER_NR;
+       else if (soc_is_exynos4412())
+               return EXYNOS4412_MAX_COMBINER_NR;
+       else if (soc_is_exynos4212())
+               return EXYNOS4212_MAX_COMBINER_NR;
+       else
+               return EXYNOS4210_MAX_COMBINER_NR;
+}
+
+
 void __init exynos4_init_irq(void)
 {
        unsigned int gic_bank_offset;
@@ -473,14 +486,8 @@ void __init exynos4_init_irq(void)
 #endif
 
        if (!of_have_populated_dt())
-               combiner_init(S5P_VA_COMBINER_BASE, NULL);
-
-       /*
-        * The parameters of s5p_init_irq() are for VIC init.
-        * Theses parameters should be NULL and 0 because EXYNOS4
-        * uses GIC instead of VIC.
-        */
-       s5p_init_irq(NULL, 0);
+               combiner_init(S5P_VA_COMBINER_BASE, NULL,
+                             max_combiner_nr(), COMBINER_IRQ(0, 0));
 
        gic_arch_extn.irq_set_wake = s3c_irq_wake;
 }
@@ -490,14 +497,6 @@ void __init exynos5_init_irq(void)
 #ifdef CONFIG_OF
        irqchip_init();
 #endif
-       /*
-        * The parameters of s5p_init_irq() are for VIC init.
-        * Theses parameters should be NULL and 0 because EXYNOS4
-        * uses GIC instead of VIC.
-        */
-       if (!of_machine_is_compatible("samsung,exynos5440"))
-               s5p_init_irq(NULL, 0);
-
        gic_arch_extn.irq_set_wake = s3c_irq_wake;
 }