|
10 | 10 | #include <linux/err.h>
|
11 | 11 | #include <linux/init.h>
|
12 | 12 | #include <linux/io.h>
|
| 13 | +#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> |
13 | 14 | #include <linux/of.h>
|
14 | 15 | #include <linux/of_address.h>
|
15 | 16 | #include <linux/of_irq.h>
|
@@ -94,6 +95,17 @@ static const struct clk_div_table video_div_table[] = {
|
94 | 95 | { }
|
95 | 96 | };
|
96 | 97 |
|
| 98 | +static const char * enet1_ref_sels[] = { "enet1_ref_125m", "enet1_ref_pad", }; |
| 99 | +static const u32 enet1_ref_sels_table[] = { IMX6UL_GPR1_ENET1_TX_CLK_DIR, |
| 100 | + IMX6UL_GPR1_ENET1_CLK_SEL }; |
| 101 | +static const u32 enet1_ref_sels_table_mask = IMX6UL_GPR1_ENET1_TX_CLK_DIR | |
| 102 | + IMX6UL_GPR1_ENET1_CLK_SEL; |
| 103 | +static const char * enet2_ref_sels[] = { "enet2_ref_125m", "enet2_ref_pad", }; |
| 104 | +static const u32 enet2_ref_sels_table[] = { IMX6UL_GPR1_ENET2_TX_CLK_DIR, |
| 105 | + IMX6UL_GPR1_ENET2_CLK_SEL }; |
| 106 | +static const u32 enet2_ref_sels_table_mask = IMX6UL_GPR1_ENET2_TX_CLK_DIR | |
| 107 | + IMX6UL_GPR1_ENET2_CLK_SEL; |
| 108 | + |
97 | 109 | static u32 share_count_asrc;
|
98 | 110 | static u32 share_count_audio;
|
99 | 111 | static u32 share_count_sai1;
|
@@ -472,6 +484,17 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node)
|
472 | 484 | /* mask handshake of mmdc */
|
473 | 485 | imx_mmdc_mask_handshake(base, 0);
|
474 | 486 |
|
| 487 | + hws[IMX6UL_CLK_ENET1_REF_PAD] = imx_obtain_fixed_of_clock(ccm_node, "enet1_ref_pad", 0); |
| 488 | + |
| 489 | + hws[IMX6UL_CLK_ENET1_REF_SEL] = imx_clk_gpr_mux("enet1_ref_sel", "fsl,imx6ul-iomuxc-gpr", |
| 490 | + IOMUXC_GPR1, enet1_ref_sels, ARRAY_SIZE(enet1_ref_sels), |
| 491 | + enet1_ref_sels_table, enet1_ref_sels_table_mask); |
| 492 | + hws[IMX6UL_CLK_ENET2_REF_PAD] = imx_obtain_fixed_of_clock(ccm_node, "enet2_ref_pad", 0); |
| 493 | + |
| 494 | + hws[IMX6UL_CLK_ENET2_REF_SEL] = imx_clk_gpr_mux("enet2_ref_sel", "fsl,imx6ul-iomuxc-gpr", |
| 495 | + IOMUXC_GPR1, enet2_ref_sels, ARRAY_SIZE(enet2_ref_sels), |
| 496 | + enet2_ref_sels_table, enet2_ref_sels_table_mask); |
| 497 | + |
475 | 498 | imx_check_clk_hws(hws, IMX6UL_CLK_END);
|
476 | 499 |
|
477 | 500 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_hw_data);
|
@@ -516,6 +539,9 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node)
|
516 | 539 | clk_set_parent(hws[IMX6ULL_CLK_EPDC_PRE_SEL]->clk, hws[IMX6UL_CLK_PLL3_PFD2]->clk);
|
517 | 540 |
|
518 | 541 | clk_set_parent(hws[IMX6UL_CLK_ENFC_SEL]->clk, hws[IMX6UL_CLK_PLL2_PFD2]->clk);
|
| 542 | + |
| 543 | + clk_set_parent(hws[IMX6UL_CLK_ENET1_REF_SEL]->clk, hws[IMX6UL_CLK_ENET_REF]->clk); |
| 544 | + clk_set_parent(hws[IMX6UL_CLK_ENET2_REF_SEL]->clk, hws[IMX6UL_CLK_ENET2_REF]->clk); |
519 | 545 | }
|
520 | 546 |
|
521 | 547 | CLK_OF_DECLARE(imx6ul, "fsl,imx6ul-ccm", imx6ul_clocks_init);
|
0 commit comments