Merge tag 'renesas-soc2-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / arch / arm / mach-shmobile / board-marzen-reference.c
index f642819..21b3e1c 100644 (file)
 #include <linux/clk/shmobile.h>
 #include <linux/clocksource.h>
 #include <linux/of_platform.h>
-#include <mach/r8a7779.h>
+
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
+
+#include "clock.h"
 #include "common.h"
 #include "irqs.h"
+#include "r8a7779.h"
 
 static void __init marzen_init_timer(void)
 {
-#ifdef CONFIG_COMMON_CLK
        r8a7779_clocks_init(r8a7779_read_mode_pins());
-#endif
        clocksource_of_init();
 }
 
+/*
+ * This is a really crude hack to provide clkdev support to platform
+ * devices until they get moved to DT.
+ */
+static const struct clk_name clk_names[] __initconst = {
+       { "tmu0", "fck", "sh-tmu.0" },
+};
+
 static void __init marzen_init(void)
 {
-#ifndef CONFIG_COMMON_CLK
-       r8a7779_clock_init();
-#endif
+       shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
        r8a7779_add_standard_devices_dt();
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
        r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */
 }
 
 static const char *marzen_boards_compat_dt[] __initdata = {
+       "renesas,marzen",
        "renesas,marzen-reference",
        NULL,
 };
@@ -54,7 +62,7 @@ static const char *marzen_boards_compat_dt[] __initdata = {
 DT_MACHINE_START(MARZEN, "marzen")
        .smp            = smp_ops(r8a7779_smp_ops),
        .map_io         = r8a7779_map_io,
-       .init_early     = r8a7779_init_delay,
+       .init_early     = shmobile_init_delay,
        .init_time      = marzen_init_timer,
        .nr_irqs        = NR_IRQS_LEGACY,
        .init_irq       = r8a7779_init_irq_dt,