ARM: imx6q: skip ethernet refclock reconfiguration if enet_clk_ref is present
[linux-2.6-microblaze.git] / arch / arm / mach-imx / mach-imx6q.c
index c9d7c29..7f62009 100644 (file)
@@ -79,7 +79,7 @@ static void __init imx6q_enet_phy_init(void)
 static void __init imx6q_1588_init(void)
 {
        struct device_node *np;
-       struct clk *ptp_clk;
+       struct clk *ptp_clk, *fec_enet_ref;
        struct clk *enet_ref;
        struct regmap *gpr;
        u32 clksel;
@@ -90,6 +90,14 @@ static void __init imx6q_1588_init(void)
                return;
        }
 
+       /*
+        * If enet_clk_ref configured, we assume DT did it properly and .
+        * clk-imx6q.c will do needed configuration.
+        */
+       fec_enet_ref = of_clk_get_by_name(np, "enet_clk_ref");
+       if (!IS_ERR(fec_enet_ref))
+               goto put_node;
+
        ptp_clk = of_clk_get(np, 2);
        if (IS_ERR(ptp_clk)) {
                pr_warn("%s: failed to get ptp clock\n", __func__);