ARM: OMAP2+: Add support for initializing dm814x clocks
authorTony Lindgren <tony@atomide.com>
Thu, 16 Jul 2015 08:55:57 +0000 (01:55 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 16 Jul 2015 09:09:33 +0000 (02:09 -0700)
Let's add a minimal clocks for dm814x to get it booted. This is
mostly a placeholder and relies on the PLLs being on from the
bootloader.

Note that the divider clocks work the same way as on dm816x and
am335x.

Cc: Matthijs van Duin <matthijsvanduin@gmail.com>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Tero Kristo <t-kristo@ti.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/io.c
drivers/clk/ti/Makefile
drivers/clk/ti/clk-814x.c [new file with mode: 0644]
drivers/clk/ti/clk-816x.c
include/linux/clk/ti.h

index 6779a9ff0d10f05cb0e7eec40e659ff16f74cccd..596af73c7549a021f8761d5fcb9311c64febcc65 100644 (file)
@@ -558,7 +558,7 @@ void __init ti814x_init_early(void)
        ti81xx_hwmod_init();
        omap_hwmod_init_postsetup();
        if (of_have_populated_dt())
-               omap_clk_soc_init = ti81xx_dt_clk_init;
+               omap_clk_soc_init = dm814x_dt_clk_init;
 }
 
 void __init ti816x_init_early(void)
@@ -575,7 +575,7 @@ void __init ti816x_init_early(void)
        ti81xx_hwmod_init();
        omap_hwmod_init_postsetup();
        if (of_have_populated_dt())
-               omap_clk_soc_init = ti81xx_dt_clk_init;
+               omap_clk_soc_init = dm816x_dt_clk_init;
 }
 #endif
 
index 105ffd0f5e79da04e496b291e4eb3968b834ba64..80b42884a0e971042dd70d66dbab86e785eca91c 100644 (file)
@@ -2,7 +2,7 @@ obj-y                                   += clk.o autoidle.o clockdomain.o
 clk-common                             = dpll.o composite.o divider.o gate.o \
                                          fixed-factor.o mux.o apll.o
 obj-$(CONFIG_SOC_AM33XX)               += $(clk-common) clk-33xx.o
-obj-$(CONFIG_SOC_TI81XX)               += $(clk-common) fapll.o clk-816x.o
+obj-$(CONFIG_SOC_TI81XX)               += $(clk-common) fapll.o clk-814x.o clk-816x.o
 obj-$(CONFIG_ARCH_OMAP2)               += $(clk-common) interface.o clk-2xxx.o
 obj-$(CONFIG_ARCH_OMAP3)               += $(clk-common) interface.o \
                                           clk-3xxx.o
diff --git a/drivers/clk/ti/clk-814x.c b/drivers/clk/ti/clk-814x.c
new file mode 100644 (file)
index 0000000..d490d42
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ */
+
+#include <linux/kernel.h>
+#include <linux/clk-provider.h>
+#include <linux/clk/ti.h>
+
+static struct ti_dt_clk dm814_clks[] = {
+       DT_CLK(NULL, "devosc_ck", "devosc_ck"),
+       DT_CLK(NULL, "mpu_ck", "mpu_ck"),
+       DT_CLK(NULL, "sysclk4_ck", "sysclk4_ck"),
+       DT_CLK(NULL, "sysclk6_ck", "sysclk6_ck"),
+       DT_CLK(NULL, "sysclk10_ck", "sysclk10_ck"),
+       DT_CLK(NULL, "sysclk18_ck", "sysclk18_ck"),
+       DT_CLK(NULL, "timer_sys_ck", "devosc_ck"),
+       DT_CLK(NULL, "cpsw_125mhz_gclk", "cpsw_125mhz_gclk"),
+       DT_CLK(NULL, "cpsw_cpts_rft_clk", "cpsw_cpts_rft_clk"),
+       { .node_name = NULL },
+};
+
+int __init dm814x_dt_clk_init(void)
+{
+       ti_dt_clocks_register(dm814_clks);
+       omap2_clk_disable_autoidle_all();
+       omap2_clk_enable_init_clocks(NULL, 0);
+
+       return 0;
+}
index 9451e651a1ff748ee69b8ad5feb587a3c86769bb..43d07456e78d6e008b395fc20e3d0a6cb954f876 100644 (file)
@@ -42,7 +42,7 @@ static const char *enable_init_clks[] = {
        "ddr_pll_clk3",
 };
 
-int __init ti81xx_dt_clk_init(void)
+int __init dm816x_dt_clk_init(void)
 {
        ti_dt_clocks_register(dm816x_clks);
        omap2_clk_disable_autoidle_all();
index 79b76e13d90425db1ed1320b1bfe9f11aecfd767..1736e29cee1bd41ca894eaf2100061fd8917ba1d 100644 (file)
@@ -329,7 +329,8 @@ int ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type);
 int omap3430_dt_clk_init(void);
 int omap3630_dt_clk_init(void);
 int am35xx_dt_clk_init(void);
-int ti81xx_dt_clk_init(void);
+int dm814x_dt_clk_init(void);
+int dm816x_dt_clk_init(void);
 int omap4xxx_dt_clk_init(void);
 int omap5xxx_dt_clk_init(void);
 int dra7xx_dt_clk_init(void);