All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Dimitrov <picmaster@mail.bg>
To: "meta-freescale@yoctoproject.org" <meta-freescale@yoctoproject.org>
Cc: Gary Thomas <gary@mlbassoc.com>
Subject: Kernel 3.14.28 can't set ENET_REF_CLK to 50 MHz
Date: Mon, 15 Jun 2015 17:50:51 +0300	[thread overview]
Message-ID: <557EE64B.8050501@mail.bg> (raw)

Hi gang,

FYI - some time ago I've had such issue, described in this ML thread:

https://lists.yoctoproject.org/pipermail/meta-freescale/2015-May/013786.html

The issue happens again on FSL kernel 3.14.28, under same HW conditions
(imx6q-based board, 100 MBit/s RMII PHY using 50 MHZ refclk from SoC
pin GPIO_16).

Last time Gary Thomas posted a solution for this issue, which works
with slight changes works on 3.14.28:


diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index f0d8000..1cab088 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -568,8 +568,20 @@ static void __init imx6q_clocks_init(struct 
device_node *ccm_node)
                 imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY2_GATE]);
         }

-       /*Set enet_ref clock to 125M to supply for RGMII tx_clk */
-       clk_set_rate(clk[IMX6QDL_CLK_ENET_REF], 125000000);
+       /* Set enet_ref clock to 125M to supply for RGMII tx_clk */
+       imx_clk_set_rate(clk[IMX6QDL_CLK_ENET_REF], 125000000);
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-fec");
+       if (np) {
+               u32 clock_frequency;
+               int ret;
+               ret = of_property_read_u32(np, "ref-clock", 
&clock_frequency);
+               if (ret == 0) {
+                       printk("ref-clock: %d\n", clock_frequency);
+                       imx_clk_set_rate(clk[IMX6QDL_CLK_ENET_REF], 
clock_frequency);
+               }
+       }
+       // This clock may be needed very early on
+       imx_clk_prepare_enable(clk[IMX6QDL_CLK_ENET_REF]);

  #ifdef CONFIG_MX6_VPU_352M
         /*

Hope this helps.

Have a great week everyone,
Nikolay


                 reply	other threads:[~2015-06-15 14:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=557EE64B.8050501@mail.bg \
    --to=picmaster@mail.bg \
    --cc=gary@mlbassoc.com \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.