fix machine definition substitution
[meta-kc-bsp.git] / recipes-kernel / linux / linux-karo-4.9.11 / set-enet_ref_clk-to-50-mhz.patch
1 diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
2 index f45de65..3845ab3 100644
3 --- a/drivers/clk/imx/clk-imx6q.c
4 +++ b/drivers/clk/imx/clk-imx6q.c
5 @@ -882,6 +882,20 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
6         /*Set enet_ref clock to 125M to supply for RGMII tx_clk */
7         clk_set_rate(clk[IMX6QDL_CLK_ENET_REF], 125000000);
8  
9 +       np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-fec");
10 +       if (np) {
11 +               u32 clock_frequency;
12 +               int ret;
13 +
14 +               ret = of_property_read_u32(np, "ref-clock", &clock_frequency);
15 +               if (ret == 0) {
16 +                       printk("fec ref-clock: %d\n", clock_frequency);
17 +                       imx_clk_set_rate(clk[IMX6QDL_CLK_ENET_REF], clock_frequency);
18 +               }
19 +       }
20 +       // This clock may be needed very early on
21 +       imx_clk_prepare_enable(clk[IMX6QDL_CLK_ENET_REF]);
22 +
23  #ifdef CONFIG_MX6_VPU_352M
24         /*
25          * If VPU 352M is enabled, then PLL2_PDF2 need to be