Merge branch 'clk-fixes' into clk-next

* clk-fixes:
  clk: qcom: qcs404: Fix gpll0_out_main parent
  clk: zynqmp: Off by one in zynqmp_is_valid_clock()
  clk: mmp: Off by one in mmp_clk_add()
  clk: mvebu: Off by one bugs in cp110_of_clk_get()
  arm64: dts: qcom: sdm845-mtp: Mark protected gcc clocks
  clk: zynqmp: handle fixed factor param query error
  clk: qcom: gcc: Fix board clock node name
  clk: meson: axg: mark fdiv2 and fdiv3 as critical
  clk: meson-gxbb: set fclk_div3 as CLK_IS_CRITICAL
  clk: fixed-factor: fix of_node_get-put imbalance
This commit is contained in:
Stephen Boyd 2018-12-14 13:42:08 -08:00
commit 9dc3204247
8 changed files with 41 additions and 6 deletions

View File

@ -343,6 +343,12 @@
}; };
}; };
&gcc {
protected-clocks = <GCC_QSPI_CORE_CLK>,
<GCC_QSPI_CORE_CLK_SRC>,
<GCC_QSPI_CNOC_PERIPH_AHB_CLK>;
};
&i2c10 { &i2c10 {
status = "okay"; status = "okay";
clock-frequency = <400000>; clock-frequency = <400000>;

View File

@ -205,6 +205,7 @@ static int of_fixed_factor_clk_remove(struct platform_device *pdev)
{ {
struct clk *clk = platform_get_drvdata(pdev); struct clk *clk = platform_get_drvdata(pdev);
of_clk_del_provider(pdev->dev.of_node);
clk_unregister_fixed_factor(clk); clk_unregister_fixed_factor(clk);
return 0; return 0;

View File

@ -325,6 +325,7 @@ static struct clk_regmap axg_fclk_div2 = {
.ops = &clk_regmap_gate_ops, .ops = &clk_regmap_gate_ops,
.parent_names = (const char *[]){ "fclk_div2_div" }, .parent_names = (const char *[]){ "fclk_div2_div" },
.num_parents = 1, .num_parents = 1,
.flags = CLK_IS_CRITICAL,
}, },
}; };
@ -349,6 +350,18 @@ static struct clk_regmap axg_fclk_div3 = {
.ops = &clk_regmap_gate_ops, .ops = &clk_regmap_gate_ops,
.parent_names = (const char *[]){ "fclk_div3_div" }, .parent_names = (const char *[]){ "fclk_div3_div" },
.num_parents = 1, .num_parents = 1,
/*
* FIXME:
* This clock, as fdiv2, is used by the SCPI FW and is required
* by the platform to operate correctly.
* Until the following condition are met, we need this clock to
* be marked as critical:
* a) The SCPI generic driver claims and enable all the clocks
* it needs
* b) CCF has a clock hand-off mechanism to make the sure the
* clock stays on until the proper driver comes along
*/
.flags = CLK_IS_CRITICAL,
}, },
}; };

View File

@ -558,6 +558,18 @@ static struct clk_regmap gxbb_fclk_div3 = {
.ops = &clk_regmap_gate_ops, .ops = &clk_regmap_gate_ops,
.parent_names = (const char *[]){ "fclk_div3_div" }, .parent_names = (const char *[]){ "fclk_div3_div" },
.num_parents = 1, .num_parents = 1,
/*
* FIXME:
* This clock, as fdiv2, is used by the SCPI FW and is required
* by the platform to operate correctly.
* Until the following condition are met, we need this clock to
* be marked as critical:
* a) The SCPI generic driver claims and enable all the clocks
* it needs
* b) CCF has a clock hand-off mechanism to make the sure the
* clock stays on until the proper driver comes along
*/
.flags = CLK_IS_CRITICAL,
}, },
}; };

View File

@ -183,7 +183,7 @@ void mmp_clk_add(struct mmp_clk_unit *unit, unsigned int id,
pr_err("CLK %d has invalid pointer %p\n", id, clk); pr_err("CLK %d has invalid pointer %p\n", id, clk);
return; return;
} }
if (id > unit->nr_clks) { if (id >= unit->nr_clks) {
pr_err("CLK %d is invalid\n", id); pr_err("CLK %d is invalid\n", id);
return; return;
} }

View File

@ -200,11 +200,11 @@ static struct clk_hw *cp110_of_clk_get(struct of_phandle_args *clkspec,
unsigned int idx = clkspec->args[1]; unsigned int idx = clkspec->args[1];
if (type == CP110_CLK_TYPE_CORE) { if (type == CP110_CLK_TYPE_CORE) {
if (idx > CP110_MAX_CORE_CLOCKS) if (idx >= CP110_MAX_CORE_CLOCKS)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
return clk_data->hws[idx]; return clk_data->hws[idx];
} else if (type == CP110_CLK_TYPE_GATABLE) { } else if (type == CP110_CLK_TYPE_GATABLE) {
if (idx > CP110_MAX_GATABLE_CLOCKS) if (idx >= CP110_MAX_GATABLE_CLOCKS)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
return clk_data->hws[CP110_MAX_CORE_CLOCKS + idx]; return clk_data->hws[CP110_MAX_CORE_CLOCKS + idx];
} }

View File

@ -265,7 +265,7 @@ static struct clk_fixed_factor cxo = {
.div = 1, .div = 1,
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "cxo", .name = "cxo",
.parent_names = (const char *[]){ "xo_board" }, .parent_names = (const char *[]){ "xo-board" },
.num_parents = 1, .num_parents = 1,
.ops = &clk_fixed_factor_ops, .ops = &clk_fixed_factor_ops,
}, },
@ -297,7 +297,7 @@ static struct clk_alpha_pll gpll0_out_main = {
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "gpll0_out_main", .name = "gpll0_out_main",
.parent_names = (const char *[]) .parent_names = (const char *[])
{ "gpll0_sleep_clk_src" }, { "cxo" },
.num_parents = 1, .num_parents = 1,
.ops = &clk_alpha_pll_ops, .ops = &clk_alpha_pll_ops,
}, },

View File

@ -128,7 +128,7 @@ static const struct zynqmp_eemi_ops *eemi_ops;
*/ */
static inline int zynqmp_is_valid_clock(u32 clk_id) static inline int zynqmp_is_valid_clock(u32 clk_id)
{ {
if (clk_id > clock_max_idx) if (clk_id >= clock_max_idx)
return -ENODEV; return -ENODEV;
return clock[clk_id].valid; return clock[clk_id].valid;
@ -279,6 +279,9 @@ struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name, u32 clk_id,
qdata.arg1 = clk_id; qdata.arg1 = clk_id;
ret = eemi_ops->query_data(qdata, ret_payload); ret = eemi_ops->query_data(qdata, ret_payload);
if (ret)
return ERR_PTR(ret);
mult = ret_payload[1]; mult = ret_payload[1];
div = ret_payload[2]; div = ret_payload[2];