<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I set the ENET_REF_CLK rate in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637153#M97059</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;seems this could be done with PHY_INTERFACE_MODE_RMII as in mach-imx6ul.c&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/mach-imx/mach-imx6ul.c?id=rel_imx_4.1.15_1.2.0_ga" title="http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/mach-imx/mach-imx6ul.c?id=rel_imx_4.1.15_1.2.0_ga"&gt;linux-2.6-imx.git - Freescale i.MX Linux Tree&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Oct 2016 00:55:37 GMT</pubDate>
    <dc:creator>igorpadykov</dc:creator>
    <dc:date>2016-10-15T00:55:37Z</dc:date>
    <item>
      <title>How do I set the ENET_REF_CLK rate</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637150#M97056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a design which uses an i.MX6DL processor, my base design makes use of the Ethernet in RMII mode and uses the GPIO_16 to provide the ENET_REF_CLK. Here is the setup from my device tree:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;fec {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;pinctrl-names = "default";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;pinctrl-0 = &amp;lt;&amp;amp;pinctrl_enet&amp;gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;phy-mode = "rmii";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;phy-reset-gpios = &amp;lt;&amp;amp;gpio5 14 0&amp;gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;fsl,magic-packet;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;status = "okay";&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm seeing is the Ethernet clock is running at 125MHz and I need it running at 50MHz, I was assuming there would be a max-frequency option in the device tree, but I couldn't find any such entry in the fsl-fec.txt file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to limit the clock rate in the device tree?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, how should this be handled?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 14:37:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637150#M97056</guid>
      <dc:creator>michaelworster</dc:creator>
      <dc:date>2016-10-14T14:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the ENET_REF_CLK rate</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637151#M97057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;device tree entries are parsed in&amp;nbsp; linux/drivers/net/ethernet/freescale/fec_main.c&lt;/P&gt;&lt;P&gt;(function of_property_read_u32()), please also check attached Linux Manual&lt;/P&gt;&lt;P&gt;Chapter 43 Fast Ethernet Controller (FEC) Driver. Seems RMII mode is defined&lt;/P&gt;&lt;P&gt;in uboot, for example one can look at include/configs/mx6slevk.h&lt;/P&gt;&lt;P&gt;#define CONFIG_FEC_XCV_TYPE&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;RMII&lt;/P&gt;&lt;P&gt;and board file in /board/freescale/mx6sxsabresd/mx6sxsabresd.c&lt;/P&gt;&lt;P&gt;setup_fec(). Reference clock produced by CCM_ANALOG_PLL_ENETn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2016 23:35:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637151#M97057</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2016-10-14T23:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the ENET_REF_CLK rate</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637152#M97058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your notes Igor. I've been through fec_main.c and I noticed only the following properties:&lt;/P&gt;&lt;P&gt;num-tx-queues&lt;/P&gt;&lt;P&gt;num-rx-queues&lt;/P&gt;&lt;P&gt;stop-mode&lt;/P&gt;&lt;P&gt;wakeup_irq&lt;/P&gt;&lt;P&gt;phy-reset-duration&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I take it by that, you're saying there is no Device Tree property which can be used to set the clock rate?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our Ethernet is setup correctly in u-boot, that is we read the ENET_REF_CLK at 50MHz there, but once the kernel initializes it jumps to 125MHz, which is why I was looking in the kernel for notes on how this is selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also did find the information about the CCM_ANALOG_PLL_ENETn register, but I couldn't find in the code where this was done.&lt;/P&gt;&lt;P&gt;I thought perhaps it had to do with the clk_enet_ref_table from arch/arm/mach-imx/clk-imx6q.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static struct clk_div_table clk_enet_ref_table[] = {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{ .val = 0, .div = 20, },&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{ .val = 1, .div = 10, },&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{ .val = 2, .div = 5, },&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{ .val = 3, .div = 4, },&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{ /* sentinel */ }&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But making adjustments here seemed to have no effect. Do you have another suggestion where I might look for the setting of this register?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Oct 2016 00:36:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637152#M97058</guid>
      <dc:creator>michaelworster</dc:creator>
      <dc:date>2016-10-15T00:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the ENET_REF_CLK rate</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637153#M97059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;seems this could be done with PHY_INTERFACE_MODE_RMII as in mach-imx6ul.c&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/mach-imx/mach-imx6ul.c?id=rel_imx_4.1.15_1.2.0_ga" title="http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/mach-imx/mach-imx6ul.c?id=rel_imx_4.1.15_1.2.0_ga"&gt;linux-2.6-imx.git - Freescale i.MX Linux Tree&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Oct 2016 00:55:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637153#M97059</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2016-10-15T00:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the ENET_REF_CLK rate</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637154#M97060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on feedback from Igor it sounds like there's no way, currently, in the code base/device tree to adjust the ENET_REF clock. As such I've developed a patch file (attached) which checks the device tree and, based on phy-mode, will update the clock rate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Oct 2016 18:26:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-set-the-ENET-REF-CLK-rate/m-p/637154#M97060</guid>
      <dc:creator>michaelworster</dc:creator>
      <dc:date>2016-10-15T18:26:12Z</dc:date>
    </item>
  </channel>
</rss>

