|
@@ -19,6 +19,7 @@
|
|
#include <linux/of_platform.h>
|
|
#include <linux/of_platform.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/pm_domain.h>
|
|
#include <linux/pm_domain.h>
|
|
|
|
+#include <linux/irqchip.h>
|
|
|
|
|
|
#include <asm/cacheflush.h>
|
|
#include <asm/cacheflush.h>
|
|
#include <asm/hardware/cache-l2x0.h>
|
|
#include <asm/hardware/cache-l2x0.h>
|
|
@@ -31,6 +32,8 @@
|
|
#include "regs-pmu.h"
|
|
#include "regs-pmu.h"
|
|
#include "regs-sys.h"
|
|
#include "regs-sys.h"
|
|
|
|
|
|
|
|
+void __iomem *pmu_base_addr;
|
|
|
|
+
|
|
static struct map_desc exynos4_iodesc[] __initdata = {
|
|
static struct map_desc exynos4_iodesc[] __initdata = {
|
|
{
|
|
{
|
|
.virtual = (unsigned long)S3C_VA_SYS,
|
|
.virtual = (unsigned long)S3C_VA_SYS,
|
|
@@ -264,6 +267,39 @@ static void __init exynos_init_io(void)
|
|
exynos_map_io();
|
|
exynos_map_io();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static const struct of_device_id exynos_dt_pmu_match[] = {
|
|
|
|
+ { .compatible = "samsung,exynos3250-pmu" },
|
|
|
|
+ { .compatible = "samsung,exynos4210-pmu" },
|
|
|
|
+ { .compatible = "samsung,exynos4212-pmu" },
|
|
|
|
+ { .compatible = "samsung,exynos4412-pmu" },
|
|
|
|
+ { .compatible = "samsung,exynos5250-pmu" },
|
|
|
|
+ { .compatible = "samsung,exynos5420-pmu" },
|
|
|
|
+ { /*sentinel*/ },
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static void exynos_map_pmu(void)
|
|
|
|
+{
|
|
|
|
+ struct device_node *np;
|
|
|
|
+
|
|
|
|
+ np = of_find_matching_node(NULL, exynos_dt_pmu_match);
|
|
|
|
+ if (np)
|
|
|
|
+ pmu_base_addr = of_iomap(np, 0);
|
|
|
|
+
|
|
|
|
+ if (!pmu_base_addr)
|
|
|
|
+ panic("failed to find exynos pmu register\n");
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void __init exynos_init_irq(void)
|
|
|
|
+{
|
|
|
|
+ irqchip_init();
|
|
|
|
+ /*
|
|
|
|
+ * Since platsmp.c needs pmu base address by the time
|
|
|
|
+ * DT is not unflatten so we can't use DT APIs before
|
|
|
|
+ * init_irq
|
|
|
|
+ */
|
|
|
|
+ exynos_map_pmu();
|
|
|
|
+}
|
|
|
|
+
|
|
static void __init exynos_dt_machine_init(void)
|
|
static void __init exynos_dt_machine_init(void)
|
|
{
|
|
{
|
|
struct device_node *i2c_np;
|
|
struct device_node *i2c_np;
|
|
@@ -344,6 +380,7 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)")
|
|
.smp = smp_ops(exynos_smp_ops),
|
|
.smp = smp_ops(exynos_smp_ops),
|
|
.map_io = exynos_init_io,
|
|
.map_io = exynos_init_io,
|
|
.init_early = exynos_firmware_init,
|
|
.init_early = exynos_firmware_init,
|
|
|
|
+ .init_irq = exynos_init_irq,
|
|
.init_machine = exynos_dt_machine_init,
|
|
.init_machine = exynos_dt_machine_init,
|
|
.init_late = exynos_init_late,
|
|
.init_late = exynos_init_late,
|
|
.dt_compat = exynos_dt_compat,
|
|
.dt_compat = exynos_dt_compat,
|