diff options
author | Vikram Mulukutla <markivx@codeaurora.org> | 2015-09-30 16:51:23 -0700 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:21:24 -0700 |
commit | daf3c7ce2200ce9f0c3c73f1b03039382515d3e3 (patch) | |
tree | 27903095728ee59f51979089cd83ae884b391292 /drivers | |
parent | aec684ce74f917e7794b7c156fce7ca04b669fe8 (diff) |
clk: msm: clock-cpu-8996: Increase CBF PLL post-divider to 4 for 8996pro
To open up the frequency range from 150 to 300MHz, change
the fixed CBF PLL post divider from 2 to 4. That way, to
generate frequencies less than 300MHz, the VCO can be run
at 4x with the CBF mux set to use the main output.
While we're here, add the cbf_pll_main clock to the lookup
table.
CRs-Fixed: 980903
Change-Id: I9f70f18e01199c41e1940857afb7bdd477c1c04c
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/msm/clock-cpu-8996.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/clk/msm/clock-cpu-8996.c b/drivers/clk/msm/clock-cpu-8996.c index 8efef472a2fc..cf24c8134ab5 100644 --- a/drivers/clk/msm/clock-cpu-8996.c +++ b/drivers/clk/msm/clock-cpu-8996.c @@ -535,6 +535,7 @@ struct cpu_clk_8996 { struct pm_qos_request req; bool do_half_rate; bool has_acd; + int postdiv; }; static inline struct cpu_clk_8996 *to_cpu_clk_8996(struct clk *c) @@ -705,12 +706,12 @@ static int cpu_clk_8996_set_rate(struct clk *c, unsigned long rate) && c->rate > 600000000 && rate < 600000000) { if (!cpu_clocks_v3) mutex_lock(&scm_lmh_lock); - ret = clk_set_rate(c->parent, c->rate/2); + ret = clk_set_rate(c->parent, c->rate/cpuclk->postdiv); if (!cpu_clocks_v3) mutex_unlock(&scm_lmh_lock); if (ret) { pr_err("failed to set rate %lu on %s (%d)\n", - c->rate/2, c->dbg_name, ret); + c->rate/cpuclk->postdiv, c->dbg_name, ret); goto fail; } } @@ -781,6 +782,7 @@ static struct cpu_clk_8996 pwrcl_clk = { .cpu_reg_mask = 0x3, .pm_qos_latency = PWRCL_LATENCY_NO_L2_PC_US, .do_half_rate = true, + .postdiv = 2, .c = { .parent = &pwrcl_hf_mux.c, .dbg_name = "pwrcl_clk", @@ -800,6 +802,7 @@ static struct cpu_clk_8996 perfcl_clk = { .n_alt_pll_freqs = ARRAY_SIZE(alt_pll_perfcl_freqs), .pm_qos_latency = PERFCL_LATENCY_NO_L2_PC_US, .do_half_rate = true, + .postdiv = 2, .c = { .parent = &perfcl_hf_mux.c, .dbg_name = "perfcl_clk", @@ -945,7 +948,7 @@ static struct pll_clk cbf_pll = { }, .min_rate = 600000000, .max_rate = 3000000000, - .src_rate = 19200000, + .src_rate = 19200000, .base = &vbases[CBF_PLL_BASE], .c = { .parent = &xo_ao.c, @@ -984,6 +987,7 @@ static struct mux_clk cbf_hf_mux = { static struct cpu_clk_8996 cbf_clk = { .do_half_rate = true, + .postdiv = 2, .c = { .parent = &cbf_hf_mux.c, .dbg_name = "cbf_clk", @@ -1038,6 +1042,7 @@ static struct clk_lookup cpu_clocks_8996[] = { CLK_LIST(perfcl_lf_mux), CLK_LIST(cbf_pll), + CLK_LIST(cbf_pll_main), CLK_LIST(cbf_hf_mux), CLK_LIST(cbf_clk), @@ -1273,6 +1278,15 @@ static void populate_opp_table(struct platform_device *pdev) "Failed to add OPP levels for CBF\n"); } +static void cpu_clock_8996_pro_fixup(void) +{ + cbf_pll.vals.post_div_masked = 0x300; + cbf_pll_main.data.max_div = 4; + cbf_pll_main.data.min_div = 4; + cbf_pll_main.data.div = 4; + cbf_clk.postdiv = 4; +} + static int perfclspeedbin; unsigned long pwrcl_early_boot_rate = 883200000; @@ -1540,6 +1554,9 @@ int __init cpu_clock_8996_early_init(void) cbf_pll.vals.test_ctl_lo_val = 0x1C000000; } + if (cpu_clocks_pro) + cpu_clock_8996_pro_fixup(); + /* * We definitely don't want to parse DT here - this is too early and in * the critical path for boot timing. Just ioremap the bases. |