aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2014-02-24 11:49:35 -0500
committerTero Kristo <t-kristo@ti.com>2014-05-28 06:05:57 -0400
commit61f25ca76ccc7b63371a7a6b0b8b9a8a46745b79 (patch)
treec54408b732cc17f9306d247fb56746f464006d84
parentbe67c3bf382c591d8267e0ef12d80041854731d9 (diff)
ARM: OMAP2: clock: add DT boot support for cpufreq_ck
The clock and clkdev for this are added manually. Signed-off-by: Tero Kristo <t-kristo@ti.com>
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c53
-rw-r--r--drivers/clk/ti/clk-2xxx.c2
-rw-r--r--include/linux/clk/ti.h1
3 files changed, 56 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index b935ed2922d8..85e0b0c06718 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -208,3 +208,56 @@ void omap2xxx_clkt_vps_late_init(void)
208 clk_put(c); 208 clk_put(c);
209 } 209 }
210} 210}
211
212#ifdef CONFIG_OF
213#include <linux/clk-provider.h>
214#include <linux/clkdev.h>
215
216static const struct clk_ops virt_prcm_set_ops = {
217 .recalc_rate = &omap2_table_mpu_recalc,
218 .set_rate = &omap2_select_table_rate,
219 .round_rate = &omap2_round_to_table_rate,
220};
221
222/**
223 * omap2xxx_clkt_vps_init - initialize virt_prcm_set clock
224 *
225 * Does a manual init for the virtual prcm DVFS clock for OMAP2. This
226 * function is called only from omap2 DT clock init, as the virtual
227 * node is not modelled in the DT clock data.
228 */
229void omap2xxx_clkt_vps_init(void)
230{
231 struct clk_init_data init = { NULL };
232 struct clk_hw_omap *hw = NULL;
233 struct clk *clk;
234 const char *parent_name = "mpu_ck";
235 struct clk_lookup *lookup = NULL;
236
237 omap2xxx_clkt_vps_late_init();
238 omap2xxx_clkt_vps_check_bootloader_rates();
239
240 hw = kzalloc(sizeof(*hw), GFP_KERNEL);
241 lookup = kzalloc(sizeof(*lookup), GFP_KERNEL);
242 if (!hw || !lookup)
243 goto cleanup;
244 init.name = "virt_prcm_set";
245 init.ops = &virt_prcm_set_ops;
246 init.parent_names = &parent_name;
247 init.num_parents = 1;
248
249 hw->hw.init = &init;
250
251 clk = clk_register(NULL, &hw->hw);
252
253 lookup->dev_id = NULL;
254 lookup->con_id = "cpufreq_ck";
255 lookup->clk = clk;
256
257 clkdev_add(lookup);
258 return;
259cleanup:
260 kfree(hw);
261 kfree(lookup);
262}
263#endif
diff --git a/drivers/clk/ti/clk-2xxx.c b/drivers/clk/ti/clk-2xxx.c
index f6400fb5ee3e..c808ab3d2bb2 100644
--- a/drivers/clk/ti/clk-2xxx.c
+++ b/drivers/clk/ti/clk-2xxx.c
@@ -229,6 +229,8 @@ static int __init omap2xxx_dt_clk_init(int soc_type)
229 else 229 else
230 ti_dt_clocks_register(omap2430_clks); 230 ti_dt_clocks_register(omap2430_clks);
231 231
232 omap2xxx_clkt_vps_init();
233
232 omap2_clk_disable_autoidle_all(); 234 omap2_clk_disable_autoidle_all();
233 235
234 omap2_clk_enable_init_clocks(enable_init_clks, 236 omap2_clk_enable_init_clocks(enable_init_clks,
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 188f0cbb26c2..4231c41bed51 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -283,6 +283,7 @@ unsigned long omap2_dpllcore_recalc(struct clk_hw *hw,
283int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate, 283int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate,
284 unsigned long parent_rate); 284 unsigned long parent_rate);
285void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw); 285void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw);
286void omap2xxx_clkt_vps_init(void);
286 287
287void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index); 288void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index);
288void ti_dt_clocks_register(struct ti_dt_clk *oclks); 289void ti_dt_clocks_register(struct ti_dt_clk *oclks);