]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/arm/mach-exynos/common.c
ARM: EXYNOS: Enable PMUs for exynos4
[mirror_ubuntu-bionic-kernel.git] / arch / arm / mach-exynos / common.c
index 02e35abd136b4ae39aba1c70a7068715cfdab0c8..603fedb80b0c4924a9ca958e69e027df27cdd5d6 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>
@@ -850,3 +851,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);