<?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: RMII PHY on i.MX8MP with external reference clock in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/RMII-PHY-on-i-MX8MP-with-external-reference-clock/m-p/1700170#M210398</link>
    <description>&lt;P&gt;Thank you for confirming that the configuration should behave as expected - it turned out to be a hardware issue: CRS_DV / RXCTL and REF_CLK were not connected correctly. (We had it on TXCK instead of TD2)&lt;/P&gt;&lt;P&gt;With the PHY wired up properly things are working fine now.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2023 10:22:49 GMT</pubDate>
    <dc:creator>benpicco</dc:creator>
    <dc:date>2023-08-07T10:22:49Z</dc:date>
    <item>
      <title>RMII PHY on i.MX8MP with external reference clock</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RMII-PHY-on-i-MX8MP-with-external-reference-clock/m-p/1698591#M210216</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;we are connecting a KSZ8091RNA PHY to the i.MX8MP processor found on the&amp;nbsp;phyCORE-i.MX8MP module using the RMII interface.&lt;/P&gt;&lt;P&gt;The PHY is generating the reference clock, but when I configure the&amp;nbsp;i.MX8MP to &lt;EM&gt;not&lt;/EM&gt; generate the reference clock by adding &lt;FONT face="andale mono,times"&gt;snps,rmii_refclk_ext&lt;/FONT&gt; to the&amp;nbsp;&lt;FONT face="andale mono,times"&gt;eqos&lt;/FONT&gt; device tree node, the MAC does not receive the input clock:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[    5.052963] imx-dwmac 30bf0000.ethernet eth1: PHY [stmmac-1:00] driver [Micrel KSZ8081 or KSZ8091] (irq=POLL)
[    6.069309] imx-dwmac 30bf0000.ethernet: Failed to reset the dma
[    6.075355] imx-dwmac 30bf0000.ethernet eth1: stmmac_hw_setup: DMA engine initialization failed
[    6.084129] imx-dwmac 30bf0000.ethernet eth1: stmmac_open: Hw setup failed&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;When I remove the&amp;nbsp;&lt;FONT face="andale mono,times"&gt;snps,rmii_refclk_ext&lt;/FONT&gt;&amp;nbsp;option the interface comes up, but it looks like the PHY and the MAC both generate the reference clock on separate pins and can't exchange Ethernet data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[    2.247814] imx-dwmac 30bf0000.ethernet: User ID: 0x10, Synopsys ID: 0x51
[    2.254640] imx-dwmac 30bf0000.ethernet:     DWMAC4/5
[    2.259453] imx-dwmac 30bf0000.ethernet: DMA HW capability register supported
[    2.266597] imx-dwmac 30bf0000.ethernet: RX Checksum Offload Engine supported
[    2.273740] imx-dwmac 30bf0000.ethernet: TX Checksum insertion supported
[    2.280449] imx-dwmac 30bf0000.ethernet: Wake-Up On Lan supported
[    2.286603] imx-dwmac 30bf0000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    2.294270] imx-dwmac 30bf0000.ethernet: Enabled Flow TC (entries=8)
[    2.300638] imx-dwmac 30bf0000.ethernet: Enabling HW TC (entries=256, max_off=256)
[    2.308214] imx-dwmac 30bf0000.ethernet: Using 34 bits DMA width
[    5.242914] imx-dwmac 30bf0000.ethernet eth1: PHY [stmmac-1:00] driver [Micrel KSZ8081 or KSZ8091] (irq=POLL)
[    5.259271] imx-dwmac 30bf0000.ethernet eth1: No Safety Features support found
[    5.266580] imx-dwmac 30bf0000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
[    5.277944] imx-dwmac 30bf0000.ethernet eth1: registered PTP clock
[    5.292434] imx-dwmac 30bf0000.ethernet eth1: configuring for phy/rmii link mode
[    8.382960] imx-dwmac 30bf0000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But no data is received and when I send something, I don't see any packets in Wireshark on a 2nd machine connected via Ethernet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;eth1      Link encap:Ethernet  HWaddr 50:2D:F4:24:67:4A  
          inet6 addr: fe80::522d:f4ff:fe24:674a/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:738 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:118312 (115.5 KiB)
          Interrupt:44 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My 'working' device tree is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;amp;eqos {
        pinctrl-names = "default";
        pinctrl-0 = &amp;lt;&amp;amp;pinctrl_eqos&amp;gt;;
        phy-mode = "rmii";
        phy-handle = &amp;lt;&amp;amp;ethphy1&amp;gt;;
        status = "okay";

//      snps,rmii_refclk_ext;

        mdio {
                compatible = "snps,dwmac-mdio";
                #address-cells = &amp;lt;1&amp;gt;;
                #size-cells = &amp;lt;0&amp;gt;;

                ethphy1: ethernet-phy@0 {
                        compatible = "ethernet-phy-ieee802.3-c22";
                        reg = &amp;lt;0x0&amp;gt;;
                };
        };
};

&amp;amp;iomuxc {
        pinctrl-names = "default";
        pinctrl-0 = &amp;lt;&amp;amp;pinctrl_hog&amp;gt;;

        pinctrl_eqos: eqosgrp {
                fsl,pins = &amp;lt;
                        MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC             0x2
                        MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO           0x2
                        MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL 0x16
                        MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0       0x16
                        MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1       0x16
                        MX8MP_IOMUXC_ENET_RXC__ENET_QOS_RX_ER           0x90
                        MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL 0x90
                        MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0       0x90
                        MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1       0x90
                        MX8MP_IOMUXC_ENET_TD2__CCM_ENET_QOS_CLOCK_GENERATE_REF_CLK      0x4000001f
                &amp;gt;;
        };
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tbh I have no idea how those pinctrl values are determined - I just copied them from other boards and they don't match the IOMUXC registers from the data sheet - so what are they?&lt;/P&gt;&lt;P&gt;&amp;nbsp;I understand that&amp;nbsp;&lt;FONT face="andale mono,times"&gt;MX8MP_IOMUXC_ENET_TD2__CCM_ENET_QOS_CLOCK_GENERATE_REF_CLK&lt;/FONT&gt; must be the crucial value here, but how do I configure it as input?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 14:44:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RMII-PHY-on-i-MX8MP-with-external-reference-clock/m-p/1698591#M210216</guid>
      <dc:creator>benpicco</dc:creator>
      <dc:date>2023-08-03T14:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: RMII PHY on i.MX8MP with external reference clock</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RMII-PHY-on-i-MX8MP-with-external-reference-clock/m-p/1699960#M210385</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/221072"&gt;@benpicco&lt;/a&gt;,&lt;/P&gt;
&lt;DIV&gt;Q)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;but it looks like the PHY and the MAC both generate the reference clock on separate pins and can't exchange Ethernet data:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;=&amp;gt; Here, The device tree seems correct. Please share your schematics for further debugging the issue.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Q) I have no idea how those pinctrl values are determined&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;=&amp;gt;The pinctrl values should be configured as per the pad control registers from the reference manual.&lt;/DIV&gt;
&lt;DIV&gt;i,e. For ENET_MDIO, the properties like slew rate, pull up, open drain, etc.. can be configured according&amp;nbsp;to section&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;8.2.4.170 SW_PAD_CTL_PAD_ENET_MDIO SW PAD Control Register&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from the reference manual&amp;nbsp;&lt;A href="https://www.nxp.com/webapp/Download?colCode=IMX8MPRM" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://www.nxp.com/webapp/Download?colCode%3DIMX8MPRM&amp;amp;source=gmail&amp;amp;ust=1691473159678000&amp;amp;usg=AOvVaw3pweGIDw4K28XNU0n7tWHv"&gt;IMX8MPRM&lt;/A&gt;.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks&amp;nbsp;&amp;amp; Regards,&lt;/DIV&gt;
&lt;DIV&gt;Dhruvit Vasavada&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2023 06:54:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RMII-PHY-on-i-MX8MP-with-external-reference-clock/m-p/1699960#M210385</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-08-07T06:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: RMII PHY on i.MX8MP with external reference clock</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RMII-PHY-on-i-MX8MP-with-external-reference-clock/m-p/1700170#M210398</link>
      <description>&lt;P&gt;Thank you for confirming that the configuration should behave as expected - it turned out to be a hardware issue: CRS_DV / RXCTL and REF_CLK were not connected correctly. (We had it on TXCK instead of TD2)&lt;/P&gt;&lt;P&gt;With the PHY wired up properly things are working fine now.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 10:22:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RMII-PHY-on-i-MX8MP-with-external-reference-clock/m-p/1700170#M210398</guid>
      <dc:creator>benpicco</dc:creator>
      <dc:date>2023-08-07T10:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: RMII PHY on i.MX8MP with external reference clock</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RMII-PHY-on-i-MX8MP-with-external-reference-clock/m-p/1700245#M210407</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/221072"&gt;@benpicco&lt;/a&gt;,&lt;/P&gt;
&lt;DIV&gt;I hope you are doing well&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Glad to know that query has been resolved. If there is no further query should I mark this thread as closed?&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks &amp;amp;&amp;nbsp;Regards,&lt;/DIV&gt;
&lt;DIV&gt;Dhruvit Vasavada&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 12:43:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RMII-PHY-on-i-MX8MP-with-external-reference-clock/m-p/1700245#M210407</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-08-07T12:43:34Z</dc:date>
    </item>
  </channel>
</rss>

