Merge branch 'samsung/exynos-multiplatform' into next/drivers
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-exynos / common.c
index 50331790abc8dce638d3fec7543bea748339814d..939bda77defa0b06e25acabed748f676329f4096 100644 (file)
@@ -39,6 +39,7 @@
 #include <mach/regs-irq.h>
 #include <mach/regs-pmu.h>
 #include <mach/regs-gpio.h>
+#include <mach/irqs.h>
 
 #include <plat/cpu.h>
 #include <plat/devs.h>
@@ -69,6 +70,8 @@ static void exynos5440_map_io(void);
 static void exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 static int exynos_init(void);
 
+unsigned long xxti_f = 0, xusbxti_f = 0;
+
 static struct cpu_table cpu_ids[] __initdata = {
        {
                .idcode         = EXYNOS4210_CPU_ID,
@@ -406,7 +409,10 @@ void __init exynos_init_time(void)
 #endif
        } else {
                /* todo: remove after migrating legacy E4 platforms to dt */
+#ifdef CONFIG_ARCH_EXYNOS4
                exynos4_clk_init(NULL);
+               exynos4_clk_register_fixed_ext(xxti_f, xusbxti_f);
+#endif
                mct_init();
        }
 }
@@ -792,6 +798,7 @@ static int __init exynos_init_irq_eint(void)
        static const struct of_device_id exynos_pinctrl_ids[] = {
                { .compatible = "samsung,exynos4210-pinctrl", },
                { .compatible = "samsung,exynos4x12-pinctrl", },
+               { .compatible = "samsung,exynos5250-pinctrl", },
        };
        struct device_node *pctrl_np, *wkup_np;
        const char *wkup_compat = "samsung,exynos4210-wakeup-eint";
@@ -845,3 +852,30 @@ static int __init exynos_init_irq_eint(void)
        return 0;
 }
 arch_initcall(exynos_init_irq_eint);
+
+static struct resource exynos4_pmu_resource[] = {
+       DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU),
+       DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU1),
+#if defined(CONFIG_SOC_EXYNOS4412)
+       DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU2),
+       DEFINE_RES_IRQ(EXYNOS4_IRQ_PMU_CPU3),
+#endif
+};
+
+static struct platform_device exynos4_device_pmu = {
+       .name           = "arm-pmu",
+       .num_resources  = ARRAY_SIZE(exynos4_pmu_resource),
+       .resource       = exynos4_pmu_resource,
+};
+
+static int __init exynos_armpmu_init(void)
+{
+       if (!of_have_populated_dt()) {
+               if (soc_is_exynos4210() || soc_is_exynos4212())
+                       exynos4_device_pmu.num_resources = 2;
+               platform_device_register(&exynos4_device_pmu);
+       }
+
+       return 0;
+}
+arch_initcall(exynos_armpmu_init);