Skip to content

Commit 9395f3d

Browse files
committed
Merge tag 'clk-imx-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx2
Pull i.MX clk driver updates from Abel Vesa: - Use clk_hw pointer instead of fw_name for acm_aud_clk[0-1]_sel clocks on i.MX8Q as parents in ACM provider - Add i.MX95 NETCMIX support to the block control provider - Fix parents for ENETx_REF_SEL clocks on i.MX6UL * tag 'clk-imx-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: clk: imx6ul: fix clock parent for IMX6UL_CLK_ENETx_REF_SEL clk: imx95: enable the clock of NETCMIX block control dt-bindings: clock: add RMII clock selection dt-bindings: clock: add i.MX95 NETCMIX block control clk: imx: imx8: Use clk_hw pointer for self registered clock in clk_parent_data
2 parents 8400291 + 32c055e commit 9395f3d

File tree

5 files changed

+65
-11
lines changed

5 files changed

+65
-11
lines changed

Documentation/devicetree/bindings/clock/nxp,imx95-blk-ctl.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ properties:
1616
- nxp,imx95-lvds-csr
1717
- nxp,imx95-display-csr
1818
- nxp,imx95-camera-csr
19+
- nxp,imx95-netcmix-blk-ctrl
1920
- nxp,imx95-vpu-csr
2021
- const: syscon
2122

drivers/clk/imx/clk-imx6ul.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node)
542542

543543
clk_set_parent(hws[IMX6UL_CLK_ENFC_SEL]->clk, hws[IMX6UL_CLK_PLL2_PFD2]->clk);
544544

545-
clk_set_parent(hws[IMX6UL_CLK_ENET1_REF_SEL]->clk, hws[IMX6UL_CLK_ENET_REF]->clk);
546-
clk_set_parent(hws[IMX6UL_CLK_ENET2_REF_SEL]->clk, hws[IMX6UL_CLK_ENET2_REF]->clk);
545+
clk_set_parent(hws[IMX6UL_CLK_ENET1_REF_SEL]->clk, hws[IMX6UL_CLK_ENET1_REF_125M]->clk);
546+
clk_set_parent(hws[IMX6UL_CLK_ENET2_REF_SEL]->clk, hws[IMX6UL_CLK_ENET2_REF_125M]->clk);
547547

548548
imx_register_uart_clocks();
549549
}

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

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ struct clk_imx8_acm_sel {
5454
* struct imx8_acm_soc_data - soc specific data
5555
* @sels: pointer to struct clk_imx8_acm_sel
5656
* @num_sels: numbers of items
57+
* @mclk_sels: pointer to imx8qm/qxp/dxl_mclk_sels
5758
*/
5859
struct imx8_acm_soc_data {
5960
struct clk_imx8_acm_sel *sels;
6061
unsigned int num_sels;
62+
struct clk_parent_data *mclk_sels;
6163
};
6264

6365
/**
@@ -111,11 +113,14 @@ static const struct clk_parent_data imx8qm_mclk_out_sels[] = {
111113
{ .fw_name = "sai6_rx_bclk" },
112114
};
113115

114-
static const struct clk_parent_data imx8qm_mclk_sels[] = {
116+
#define ACM_AUD_CLK0_SEL_INDEX 2
117+
#define ACM_AUD_CLK1_SEL_INDEX 3
118+
119+
static struct clk_parent_data imx8qm_mclk_sels[] = {
115120
{ .fw_name = "aud_pll_div_clk0_lpcg_clk" },
116121
{ .fw_name = "aud_pll_div_clk1_lpcg_clk" },
117-
{ .fw_name = "acm_aud_clk0_sel" },
118-
{ .fw_name = "acm_aud_clk1_sel" },
122+
{ }, /* clk_hw pointer of "acm_aud_clk0_sel" */
123+
{ }, /* clk_hw pointer of "acm_aud_clk1_sel" */
119124
};
120125

121126
static const struct clk_parent_data imx8qm_asrc_mux_clk_sels[] = {
@@ -176,11 +181,11 @@ static const struct clk_parent_data imx8qxp_mclk_out_sels[] = {
176181
{ .fw_name = "sai4_rx_bclk" },
177182
};
178183

179-
static const struct clk_parent_data imx8qxp_mclk_sels[] = {
184+
static struct clk_parent_data imx8qxp_mclk_sels[] = {
180185
{ .fw_name = "aud_pll_div_clk0_lpcg_clk" },
181186
{ .fw_name = "aud_pll_div_clk1_lpcg_clk" },
182-
{ .fw_name = "acm_aud_clk0_sel" },
183-
{ .fw_name = "acm_aud_clk1_sel" },
187+
{ }, /* clk_hw pointer of "acm_aud_clk0_sel" */
188+
{ }, /* clk_hw pointer of "acm_aud_clk1_sel" */
184189
};
185190

186191
static struct clk_imx8_acm_sel imx8qxp_sels[] = {
@@ -228,11 +233,11 @@ static const struct clk_parent_data imx8dxl_mclk_out_sels[] = {
228233
{ .index = -1 },
229234
};
230235

231-
static const struct clk_parent_data imx8dxl_mclk_sels[] = {
236+
static struct clk_parent_data imx8dxl_mclk_sels[] = {
232237
{ .fw_name = "aud_pll_div_clk0_lpcg_clk" },
233238
{ .fw_name = "aud_pll_div_clk1_lpcg_clk" },
234-
{ .fw_name = "acm_aud_clk0_sel" },
235-
{ .fw_name = "acm_aud_clk1_sel" },
239+
{ }, /* clk_hw pointer of "acm_aud_clk0_sel" */
240+
{ }, /* clk_hw pointer of "acm_aud_clk1_sel" */
236241
};
237242

238243
static struct clk_imx8_acm_sel imx8dxl_sels[] = {
@@ -375,6 +380,18 @@ static int imx8_acm_clk_probe(struct platform_device *pdev)
375380
imx_check_clk_hws(hws, IMX_ADMA_ACM_CLK_END);
376381
goto err_clk_register;
377382
}
383+
384+
/*
385+
* The IMX_ADMA_ACM_AUD_CLK0_SEL and IMX_ADMA_ACM_AUD_CLK1_SEL are
386+
* registered first. After registration, update the clk_hw pointer
387+
* to imx8qm/qxp/dxl_mclk_sels structures.
388+
*/
389+
if (sels[i].clkid == IMX_ADMA_ACM_AUD_CLK0_SEL)
390+
priv->soc_data->mclk_sels[ACM_AUD_CLK0_SEL_INDEX].hw =
391+
hws[IMX_ADMA_ACM_AUD_CLK0_SEL];
392+
if (sels[i].clkid == IMX_ADMA_ACM_AUD_CLK1_SEL)
393+
priv->soc_data->mclk_sels[ACM_AUD_CLK1_SEL_INDEX].hw =
394+
hws[IMX_ADMA_ACM_AUD_CLK1_SEL];
378395
}
379396

380397
ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data);
@@ -406,16 +423,19 @@ static void imx8_acm_clk_remove(struct platform_device *pdev)
406423
static const struct imx8_acm_soc_data imx8qm_acm_data = {
407424
.sels = imx8qm_sels,
408425
.num_sels = ARRAY_SIZE(imx8qm_sels),
426+
.mclk_sels = imx8qm_mclk_sels,
409427
};
410428

411429
static const struct imx8_acm_soc_data imx8qxp_acm_data = {
412430
.sels = imx8qxp_sels,
413431
.num_sels = ARRAY_SIZE(imx8qxp_sels),
432+
.mclk_sels = imx8qxp_mclk_sels,
414433
};
415434

416435
static const struct imx8_acm_soc_data imx8dxl_acm_data = {
417436
.sels = imx8dxl_sels,
418437
.num_sels = ARRAY_SIZE(imx8dxl_sels),
438+
.mclk_sels = imx8dxl_mclk_sels,
419439
};
420440

421441
static const struct of_device_id imx8_acm_match[] = {

drivers/clk/imx/clk-imx95-blk-ctl.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,35 @@ static const struct imx95_blk_ctl_dev_data dispmix_csr_dev_data = {
248248
.clk_reg_offset = 0,
249249
};
250250

251+
static const struct imx95_blk_ctl_clk_dev_data netxmix_clk_dev_data[] = {
252+
[IMX95_CLK_NETCMIX_ENETC0_RMII] = {
253+
.name = "enetc0_rmii_sel",
254+
.parent_names = (const char *[]){"ext_enetref", "enetref"},
255+
.num_parents = 2,
256+
.reg = 4,
257+
.bit_idx = 5,
258+
.bit_width = 1,
259+
.type = CLK_MUX,
260+
.flags = CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT,
261+
},
262+
[IMX95_CLK_NETCMIX_ENETC1_RMII] = {
263+
.name = "enetc1_rmii_sel",
264+
.parent_names = (const char *[]){"ext_enetref", "enetref"},
265+
.num_parents = 2,
266+
.reg = 4,
267+
.bit_idx = 10,
268+
.bit_width = 1,
269+
.type = CLK_MUX,
270+
.flags = CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT,
271+
},
272+
};
273+
274+
static const struct imx95_blk_ctl_dev_data netcmix_dev_data = {
275+
.num_clks = ARRAY_SIZE(netxmix_clk_dev_data),
276+
.clk_dev_data = netxmix_clk_dev_data,
277+
.clk_reg_offset = 0,
278+
};
279+
251280
static int imx95_bc_probe(struct platform_device *pdev)
252281
{
253282
struct device *dev = &pdev->dev;
@@ -419,6 +448,7 @@ static const struct of_device_id imx95_bc_of_match[] = {
419448
{ .compatible = "nxp,imx95-lvds-csr", .data = &lvds_csr_dev_data },
420449
{ .compatible = "nxp,imx95-display-csr", .data = &dispmix_csr_dev_data },
421450
{ .compatible = "nxp,imx95-vpu-csr", .data = &vpublk_dev_data },
451+
{ .compatible = "nxp,imx95-netcmix-blk-ctrl", .data = &netcmix_dev_data},
422452
{ /* Sentinel */ },
423453
};
424454
MODULE_DEVICE_TABLE(of, imx95_bc_of_match);

include/dt-bindings/clock/nxp,imx95-clock.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@
2525
#define IMX95_CLK_DISPMIX_ENG0_SEL 0
2626
#define IMX95_CLK_DISPMIX_ENG1_SEL 1
2727

28+
#define IMX95_CLK_NETCMIX_ENETC0_RMII 0
29+
#define IMX95_CLK_NETCMIX_ENETC1_RMII 1
30+
2831
#endif /* __DT_BINDINGS_CLOCK_IMX95_H */

0 commit comments

Comments
 (0)