Skip to content

Commit 6e42454

Browse files
committed
Merge tag 'clk-imx-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx
Pull i.MX clock driver updates from Abel Vesa: - Add optional ENET reference pad clock inputs for i.MX6Q/UL - Fix debug output in PLL14xx driver to use unsigned format specifier - Add 333.333 MHz and 477.4 MHz support to fracn-gppll for display use cases - Fix device node reference leaks in i.MX6 driver - Fix device node reference leak in of_assigned_ldb_sels() - Fix ACM clock flags on i.MX8 to prevent SAI sysclk failures - Move VF610_CLK_END define into the driver - Add VF610 Ethernet switch clock support - Correct CSI PHY parent clock selection on i.MX8MQ * tag 'clk-imx-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: clk: imx8mq: Correct the CSI PHY sels clk: vf610: Add support for the Ethernet switch clocks dt-bindings: clock: vf610: Add definitions for MTIP L2 switch dt-bindings: clock: vf610: Drop VF610_CLK_END define clk: vf610: Move VF610_CLK_END define to clk-vf610 driver clk: imx: imx8-acm: fix flags for acm clocks clk: imx: imx6q: Fix device node reference leak in of_assigned_ldb_sels() clk: imx: imx6q: Fix device node reference leak in pll6_bypassed() clk: imx: fracn-gppll: Add 477.4MHz support clk: imx: fracn-gppll: Add 333.333333 MHz support clk: imx: pll14xx: Use unsigned format specifier dt-bindings: clock: imx6q[ul]-clock: add optional clock enet[1]_ref_pad
2 parents c369299 + d16f57c commit 6e42454

9 files changed

Lines changed: 45 additions & 8 deletions

File tree

Documentation/devicetree/bindings/clock/imx6q-clock.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,24 @@ properties:
2929
const: 1
3030

3131
clocks:
32+
minItems: 5
3233
items:
3334
- description: 24m osc
3435
- description: 32k osc
3536
- description: ckih1 clock input
3637
- description: anaclk1 clock input
3738
- description: anaclk2 clock input
39+
- description: clock input from enet ref pad
3840

3941
clock-names:
42+
minItems: 5
4043
items:
4144
- const: osc
4245
- const: ckil
4346
- const: ckih1
4447
- const: anaclk1
4548
- const: anaclk2
49+
- const: enet_ref_pad
4650

4751
fsl,pmic-stby-poweroff:
4852
$ref: /schemas/types.yaml#/definitions/flag

Documentation/devicetree/bindings/clock/imx6ul-clock.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,22 @@ properties:
2929
const: 1
3030

3131
clocks:
32+
minItems: 4
3233
items:
3334
- description: 32k osc
3435
- description: 24m osc
3536
- description: ipp_di0 clock input
3637
- description: ipp_di1 clock input
38+
- description: clock input from enet1 ref pad
3739

3840
clock-names:
41+
minItems: 4
3942
items:
4043
- const: ckil
4144
- const: osc
4245
- const: ipp_di0
4346
- const: ipp_di1
47+
- const: enet1_ref_pad
4448

4549
required:
4650
- compatible

drivers/clk/imx/clk-fracn-gppll.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@ static const struct imx_fracn_gppll_rate_table fracn_tbl[] = {
8585
PLL_FRACN_GP(519750000U, 173, 25, 100, 1, 8),
8686
PLL_FRACN_GP(498000000U, 166, 0, 1, 0, 8),
8787
PLL_FRACN_GP(484000000U, 121, 0, 1, 0, 6),
88+
PLL_FRACN_GP(477400000U, 119, 35, 100, 0, 6),
8889
PLL_FRACN_GP(445333333U, 167, 0, 1, 0, 9),
8990
PLL_FRACN_GP(400000000U, 200, 0, 1, 0, 12),
9091
PLL_FRACN_GP(393216000U, 163, 84, 100, 0, 10),
92+
PLL_FRACN_GP(333333333U, 125, 0, 1, 1, 9),
9193
PLL_FRACN_GP(332600000U, 138, 584, 1000, 0, 10),
9294
PLL_FRACN_GP(300000000U, 150, 0, 1, 0, 12),
9395
PLL_FRACN_GP(241900000U, 201, 584, 1000, 0, 20),

drivers/clk/imx/clk-imx6q.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,23 @@ static void of_assigned_ldb_sels(struct device_node *node,
188188
}
189189
if (clkspec.np != node || clkspec.args[0] >= IMX6QDL_CLK_END) {
190190
pr_err("ccm: parent clock %d not in ccm\n", index);
191+
of_node_put(clkspec.np);
191192
return;
192193
}
193194
parent = clkspec.args[0];
195+
of_node_put(clkspec.np);
194196

195197
rc = of_parse_phandle_with_args(node, "assigned-clocks",
196198
"#clock-cells", index, &clkspec);
197199
if (rc < 0)
198200
return;
199201
if (clkspec.np != node || clkspec.args[0] >= IMX6QDL_CLK_END) {
200202
pr_err("ccm: child clock %d not in ccm\n", index);
203+
of_node_put(clkspec.np);
201204
return;
202205
}
203206
child = clkspec.args[0];
207+
of_node_put(clkspec.np);
204208

205209
if (child != IMX6QDL_CLK_LDB_DI0_SEL &&
206210
child != IMX6QDL_CLK_LDB_DI1_SEL)
@@ -238,8 +242,11 @@ static bool pll6_bypassed(struct device_node *node)
238242
return false;
239243

240244
if (clkspec.np == node &&
241-
clkspec.args[0] == IMX6QDL_PLL6_BYPASS)
245+
clkspec.args[0] == IMX6QDL_PLL6_BYPASS) {
246+
of_node_put(clkspec.np);
242247
break;
248+
}
249+
of_node_put(clkspec.np);
243250
}
244251

245252
/* PLL6 bypass is not part of the assigned clock list */
@@ -249,6 +256,9 @@ static bool pll6_bypassed(struct device_node *node)
249256
ret = of_parse_phandle_with_args(node, "assigned-clock-parents",
250257
"#clock-cells", index, &clkspec);
251258

259+
if (!ret)
260+
of_node_put(clkspec.np);
261+
252262
if (clkspec.args[0] != IMX6QDL_CLK_PLL6)
253263
return true;
254264

drivers/clk/imx/clk-imx8-acm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ static int imx8_acm_clk_probe(struct platform_device *pdev)
371371
for (i = 0; i < priv->soc_data->num_sels; i++) {
372372
hws[sels[i].clkid] = devm_clk_hw_register_mux_parent_data_table(dev,
373373
sels[i].name, sels[i].parents,
374-
sels[i].num_parents, 0,
374+
sels[i].num_parents,
375+
CLK_SET_RATE_NO_REPARENT,
375376
base + sels[i].reg,
376377
sels[i].shift, sels[i].width,
377378
0, NULL, NULL);

drivers/clk/imx/clk-imx8mq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static const char * const imx8mq_dsi_esc_sels[] = {"osc_25m", "sys2_pll_100m", "
237237
static const char * const imx8mq_csi1_core_sels[] = {"osc_25m", "sys1_pll_266m", "sys2_pll_250m", "sys1_pll_800m",
238238
"sys2_pll_1000m", "sys3_pll_out", "audio_pll2_out", "video_pll1_out", };
239239

240-
static const char * const imx8mq_csi1_phy_sels[] = {"osc_25m", "sys2_pll_125m", "sys2_pll_100m", "sys1_pll_800m",
240+
static const char * const imx8mq_csi1_phy_sels[] = {"osc_25m", "sys2_pll_333m", "sys2_pll_100m", "sys1_pll_800m",
241241
"sys2_pll_1000m", "clk_ext2", "audio_pll2_out", "video_pll1_out", };
242242

243243
static const char * const imx8mq_csi1_esc_sels[] = {"osc_25m", "sys2_pll_100m", "sys1_pll_80m", "sys1_pll_800m",
@@ -246,7 +246,7 @@ static const char * const imx8mq_csi1_esc_sels[] = {"osc_25m", "sys2_pll_100m",
246246
static const char * const imx8mq_csi2_core_sels[] = {"osc_25m", "sys1_pll_266m", "sys2_pll_250m", "sys1_pll_800m",
247247
"sys2_pll_1000m", "sys3_pll_out", "audio_pll2_out", "video_pll1_out", };
248248

249-
static const char * const imx8mq_csi2_phy_sels[] = {"osc_25m", "sys2_pll_125m", "sys2_pll_100m", "sys1_pll_800m",
249+
static const char * const imx8mq_csi2_phy_sels[] = {"osc_25m", "sys2_pll_333m", "sys2_pll_100m", "sys1_pll_800m",
250250
"sys2_pll_1000m", "clk_ext2", "audio_pll2_out", "video_pll1_out", };
251251

252252
static const char * const imx8mq_csi2_esc_sels[] = {"osc_25m", "sys2_pll_100m", "sys1_pll_80m", "sys1_pll_800m",

drivers/clk/imx/clk-pll14xx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static void imx_pll14xx_calc_settings(struct clk_pll14xx *pll, unsigned long rat
151151
/* First try if we can get the desired rate from one of the static entries */
152152
tt = imx_get_pll_settings(pll, rate);
153153
if (tt) {
154-
pr_debug("%s: in=%ld, want=%ld, Using PLL setting from table\n",
154+
pr_debug("%s: in=%lu, want=%lu, Using PLL setting from table\n",
155155
clk_hw_get_name(&pll->hw), prate, rate);
156156
t->rate = tt->rate;
157157
t->mdiv = tt->mdiv;
@@ -173,7 +173,7 @@ static void imx_pll14xx_calc_settings(struct clk_pll14xx *pll, unsigned long rat
173173

174174
if (rate >= rate_min && rate <= rate_max) {
175175
kdiv = pll1443x_calc_kdiv(mdiv, pdiv, sdiv, rate, prate);
176-
pr_debug("%s: in=%ld, want=%ld Only adjust kdiv %ld -> %d\n",
176+
pr_debug("%s: in=%lu, want=%lu Only adjust kdiv %ld -> %d\n",
177177
clk_hw_get_name(&pll->hw), prate, rate,
178178
FIELD_GET(KDIV_MASK, pll_div_ctl1), kdiv);
179179
fout = pll14xx_calc_rate(pll, mdiv, pdiv, sdiv, kdiv, prate);
@@ -211,7 +211,7 @@ static void imx_pll14xx_calc_settings(struct clk_pll14xx *pll, unsigned long rat
211211
}
212212
}
213213
found:
214-
pr_debug("%s: in=%ld, want=%ld got=%d (pdiv=%d sdiv=%d mdiv=%d kdiv=%d)\n",
214+
pr_debug("%s: in=%lu, want=%lu got=%u (pdiv=%d sdiv=%d mdiv=%d kdiv=%d)\n",
215215
clk_hw_get_name(&pll->hw), prate, rate, t->rate, t->pdiv, t->sdiv,
216216
t->mdiv, t->kdiv);
217217
}

drivers/clk/imx/clk-vf610.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111

1212
#include "clk.h"
1313

14+
/*
15+
* The VF610_CLK_END corresponds to ones defined in
16+
* include/dt-bindings/clock/vf610-clock.h
17+
* It shall be the value of the last defined clock +1
18+
*/
19+
#define VF610_CLK_END 196
20+
1421
#define CCM_CCR (ccm_base + 0x00)
1522
#define CCM_CSR (ccm_base + 0x04)
1623
#define CCM_CCSR (ccm_base + 0x08)
@@ -313,6 +320,11 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
313320
clk[VF610_CLK_ENET_TS] = imx_clk_gate("enet_ts", "enet_ts_sel", CCM_CSCDR1, 23);
314321
clk[VF610_CLK_ENET0] = imx_clk_gate2("enet0", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(0));
315322
clk[VF610_CLK_ENET1] = imx_clk_gate2("enet1", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(1));
323+
clk[VF610_CLK_ESW] = imx_clk_gate2("esw", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(8));
324+
clk[VF610_CLK_ESW_MAC_TAB0] = imx_clk_gate2("esw_tab0", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(12));
325+
clk[VF610_CLK_ESW_MAC_TAB1] = imx_clk_gate2("esw_tab1", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(13));
326+
clk[VF610_CLK_ESW_MAC_TAB2] = imx_clk_gate2("esw_tab2", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(14));
327+
clk[VF610_CLK_ESW_MAC_TAB3] = imx_clk_gate2("esw_tab3", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(15));
316328

317329
clk[VF610_CLK_PIT] = imx_clk_gate2("pit", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(7));
318330

include/dt-bindings/clock/vf610-clock.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@
197197
#define VF610_CLK_TCON1 188
198198
#define VF610_CLK_CAAM 189
199199
#define VF610_CLK_CRC 190
200-
#define VF610_CLK_END 191
200+
#define VF610_CLK_ESW 191
201+
#define VF610_CLK_ESW_MAC_TAB0 192
202+
#define VF610_CLK_ESW_MAC_TAB1 193
203+
#define VF610_CLK_ESW_MAC_TAB2 194
204+
#define VF610_CLK_ESW_MAC_TAB3 195
201205

202206
#endif /* __DT_BINDINGS_CLOCK_VF610_H */

0 commit comments

Comments
 (0)