diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2016-06-20 20:01:45 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-06-20 20:01:45 -0400 |
commit | 086347705be7530feabb6274a3ad81dd545e7914 (patch) | |
tree | b678824dd4f7aecf7ab696f675f7d3c2ef1c2cff | |
parent | a5e9b85a6540df6c4074d3a56674f6fb6c5fc830 (diff) | |
parent | 62d0e71df063101e4551327bd9fa9aaa3535c86b (diff) |
Merge tag 'v4.7-rockchip-clk-fixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-fixes
A bunch of fixes. Some for the newly added rk3399 clock tree, some
concerning error handling and initialization and a revert of the
mmc-phase clock initialization, as this could conflict with the
bootloader setting of this clock and a real solution to initing
the phase correctly from dw_mmc went in as fix for 4.7 through
the mmc tree.
* tag 'v4.7-rockchip-clk-fixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
clk: rockchip: release io resource when failing to init clk on rk3399
clk: rockchip: fix cpuclk registration error handling
clk: rockchip: Revert "clk: rockchip: reset init state before mmc card initialization"
clk: rockchip: fix incorrect parent for rk3399's {c,g}pll_aclk_perihp_src
clk: rockchip: mark rk3399 GIC clocks as critical
clk: rockchip: initialize flags of clk_init_data in mmc-phase clock
-rw-r--r-- | drivers/clk/rockchip/clk-cpu.c | 4 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk-mmc-phase.c | 12 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk-rk3399.c | 8 |
3 files changed, 9 insertions, 15 deletions
diff --git a/drivers/clk/rockchip/clk-cpu.c b/drivers/clk/rockchip/clk-cpu.c index 4bb130cd0062..05b3d73bfefa 100644 --- a/drivers/clk/rockchip/clk-cpu.c +++ b/drivers/clk/rockchip/clk-cpu.c | |||
@@ -321,9 +321,9 @@ struct clk *rockchip_clk_register_cpuclk(const char *name, | |||
321 | } | 321 | } |
322 | 322 | ||
323 | cclk = clk_register(NULL, &cpuclk->hw); | 323 | cclk = clk_register(NULL, &cpuclk->hw); |
324 | if (IS_ERR(clk)) { | 324 | if (IS_ERR(cclk)) { |
325 | pr_err("%s: could not register cpuclk %s\n", __func__, name); | 325 | pr_err("%s: could not register cpuclk %s\n", __func__, name); |
326 | ret = PTR_ERR(clk); | 326 | ret = PTR_ERR(cclk); |
327 | goto free_rate_table; | 327 | goto free_rate_table; |
328 | } | 328 | } |
329 | 329 | ||
diff --git a/drivers/clk/rockchip/clk-mmc-phase.c b/drivers/clk/rockchip/clk-mmc-phase.c index bc856f21f6b2..077fcdc7908b 100644 --- a/drivers/clk/rockchip/clk-mmc-phase.c +++ b/drivers/clk/rockchip/clk-mmc-phase.c | |||
@@ -41,8 +41,6 @@ static unsigned long rockchip_mmc_recalc(struct clk_hw *hw, | |||
41 | #define ROCKCHIP_MMC_DEGREE_MASK 0x3 | 41 | #define ROCKCHIP_MMC_DEGREE_MASK 0x3 |
42 | #define ROCKCHIP_MMC_DELAYNUM_OFFSET 2 | 42 | #define ROCKCHIP_MMC_DELAYNUM_OFFSET 2 |
43 | #define ROCKCHIP_MMC_DELAYNUM_MASK (0xff << ROCKCHIP_MMC_DELAYNUM_OFFSET) | 43 | #define ROCKCHIP_MMC_DELAYNUM_MASK (0xff << ROCKCHIP_MMC_DELAYNUM_OFFSET) |
44 | #define ROCKCHIP_MMC_INIT_STATE_RESET 0x1 | ||
45 | #define ROCKCHIP_MMC_INIT_STATE_SHIFT 1 | ||
46 | 44 | ||
47 | #define PSECS_PER_SEC 1000000000000LL | 45 | #define PSECS_PER_SEC 1000000000000LL |
48 | 46 | ||
@@ -154,6 +152,7 @@ struct clk *rockchip_clk_register_mmc(const char *name, | |||
154 | return ERR_PTR(-ENOMEM); | 152 | return ERR_PTR(-ENOMEM); |
155 | 153 | ||
156 | init.name = name; | 154 | init.name = name; |
155 | init.flags = 0; | ||
157 | init.num_parents = num_parents; | 156 | init.num_parents = num_parents; |
158 | init.parent_names = parent_names; | 157 | init.parent_names = parent_names; |
159 | init.ops = &rockchip_mmc_clk_ops; | 158 | init.ops = &rockchip_mmc_clk_ops; |
@@ -162,15 +161,6 @@ struct clk *rockchip_clk_register_mmc(const char *name, | |||
162 | mmc_clock->reg = reg; | 161 | mmc_clock->reg = reg; |
163 | mmc_clock->shift = shift; | 162 | mmc_clock->shift = shift; |
164 | 163 | ||
165 | /* | ||
166 | * Assert init_state to soft reset the CLKGEN | ||
167 | * for mmc tuning phase and degree | ||
168 | */ | ||
169 | if (mmc_clock->shift == ROCKCHIP_MMC_INIT_STATE_SHIFT) | ||
170 | writel(HIWORD_UPDATE(ROCKCHIP_MMC_INIT_STATE_RESET, | ||
171 | ROCKCHIP_MMC_INIT_STATE_RESET, | ||
172 | mmc_clock->shift), mmc_clock->reg); | ||
173 | |||
174 | clk = clk_register(NULL, &mmc_clock->hw); | 164 | clk = clk_register(NULL, &mmc_clock->hw); |
175 | if (IS_ERR(clk)) | 165 | if (IS_ERR(clk)) |
176 | kfree(mmc_clock); | 166 | kfree(mmc_clock); |
diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c index 291543f52caa..8059a8d3ea36 100644 --- a/drivers/clk/rockchip/clk-rk3399.c +++ b/drivers/clk/rockchip/clk-rk3399.c | |||
@@ -832,9 +832,9 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = { | |||
832 | RK3399_CLKGATE_CON(13), 1, GFLAGS), | 832 | RK3399_CLKGATE_CON(13), 1, GFLAGS), |
833 | 833 | ||
834 | /* perihp */ | 834 | /* perihp */ |
835 | GATE(0, "cpll_aclk_perihp_src", "gpll", CLK_IGNORE_UNUSED, | 835 | GATE(0, "cpll_aclk_perihp_src", "cpll", CLK_IGNORE_UNUSED, |
836 | RK3399_CLKGATE_CON(5), 0, GFLAGS), | 836 | RK3399_CLKGATE_CON(5), 0, GFLAGS), |
837 | GATE(0, "gpll_aclk_perihp_src", "cpll", CLK_IGNORE_UNUSED, | 837 | GATE(0, "gpll_aclk_perihp_src", "gpll", CLK_IGNORE_UNUSED, |
838 | RK3399_CLKGATE_CON(5), 1, GFLAGS), | 838 | RK3399_CLKGATE_CON(5), 1, GFLAGS), |
839 | COMPOSITE(ACLK_PERIHP, "aclk_perihp", mux_aclk_perihp_p, CLK_IGNORE_UNUSED, | 839 | COMPOSITE(ACLK_PERIHP, "aclk_perihp", mux_aclk_perihp_p, CLK_IGNORE_UNUSED, |
840 | RK3399_CLKSEL_CON(14), 7, 1, MFLAGS, 0, 5, DFLAGS, | 840 | RK3399_CLKSEL_CON(14), 7, 1, MFLAGS, 0, 5, DFLAGS, |
@@ -1466,6 +1466,8 @@ static struct rockchip_clk_branch rk3399_clk_pmu_branches[] __initdata = { | |||
1466 | 1466 | ||
1467 | static const char *const rk3399_cru_critical_clocks[] __initconst = { | 1467 | static const char *const rk3399_cru_critical_clocks[] __initconst = { |
1468 | "aclk_cci_pre", | 1468 | "aclk_cci_pre", |
1469 | "aclk_gic", | ||
1470 | "aclk_gic_noc", | ||
1469 | "pclk_perilp0", | 1471 | "pclk_perilp0", |
1470 | "pclk_perilp0", | 1472 | "pclk_perilp0", |
1471 | "hclk_perilp0", | 1473 | "hclk_perilp0", |
@@ -1508,6 +1510,7 @@ static void __init rk3399_clk_init(struct device_node *np) | |||
1508 | ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); | 1510 | ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); |
1509 | if (IS_ERR(ctx)) { | 1511 | if (IS_ERR(ctx)) { |
1510 | pr_err("%s: rockchip clk init failed\n", __func__); | 1512 | pr_err("%s: rockchip clk init failed\n", __func__); |
1513 | iounmap(reg_base); | ||
1511 | return; | 1514 | return; |
1512 | } | 1515 | } |
1513 | 1516 | ||
@@ -1553,6 +1556,7 @@ static void __init rk3399_pmu_clk_init(struct device_node *np) | |||
1553 | ctx = rockchip_clk_init(np, reg_base, CLKPMU_NR_CLKS); | 1556 | ctx = rockchip_clk_init(np, reg_base, CLKPMU_NR_CLKS); |
1554 | if (IS_ERR(ctx)) { | 1557 | if (IS_ERR(ctx)) { |
1555 | pr_err("%s: rockchip pmu clk init failed\n", __func__); | 1558 | pr_err("%s: rockchip pmu clk init failed\n", __func__); |
1559 | iounmap(reg_base); | ||
1556 | return; | 1560 | return; |
1557 | } | 1561 | } |
1558 | 1562 | ||