imx6 RMII issue

cancel
Showing results for 
Search instead for 
Did you mean: 

imx6 RMII issue

Jump to solution
842 Views
will_intelli
Contributor III

Hello,

I'm using an imx6qp-based custom board and am having an issue getting the FEC ethernet interface working with RMII in Linux (4.14.62).  Its connected to a LAN8720A phy which provides a 50MHz clock on the RGMII_TX_CTL input.  It works fine in u-boot, and I'm able to tftp boot files across.

Packets seem to be getting transmitted okay, I can see ARP packets being sent in wireshark, but all received packets are being received with crc/framing errors:

   root@imx6qp-ivu:~# ifconfig eth0
   eth0      Link encap:Ethernet  HWaddr 6e:79:2e:34:eb:32
             inet addr:10.1.3.4  Bcast:10.1.255.255  Mask:255.255.0.0
             inet6 addr: fe80::6c79:2eff:fe34:eb32/64 Scope:Link
             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
             RX packets:0 errors:246 dropped:0 overruns:0 frame:246
             TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:1000
             RX bytes:0 (0.0 B)  TX bytes:4976 (4.8 KiB)

They phy is being detected okay, and I can read/write MDIO registers:

   [   66.775904] SMSC LAN8710/LAN8720 2188000.ethernet-1:00: attached PHY driver [SMSC LAN8710/LAN8720]    (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL)

I'm using these dts settings:

        pinctrl_enet: enetgrp {
            fsl,pins = <
                MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0 0x1b0b0
                MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1 0x1b030
                MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER   0x1b030
                MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN   0x1b030
                MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0 0x1b030
                MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1 0x1b030
                MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN  0x1b0b0
                MX6QDL_PAD_RGMII_TX_CTL__ENET_REF_CLK   0x10020
            >;
        };

        pinctrl_enet_mdio: enet-mdiogrp {
            fsl,pins = <
                MX6QDL_PAD_ENET_MDC__ENET_MDC       0x1b030
                MX6QDL_PAD_ENET_MDIO__ENET_MDIO     0x1b030
            >;
        };

&fec {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet &pinctrl_enet_mdio>;
    phy-mode = "rmii";
    fsl,magic-packet;
    status = "okay";
    clocks = <&clks IMX6QDL_CLK_ENET>, <&clks IMX6QDL_CLK_ENET>;
    clock-names = "ipg", "ahb";
};

Any ideas what might be causing this?

Thanks,

Will.

Labels (2)
0 Kudos
1 Solution
417 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Will

one can try with latest nxp official linux release L4.14.78

linux-imx - i.MX Linux kernel 

and recheck pinmux settings for ENET_RX_DATA, check enet

signals with oscilloscope. May be useful to read guidelines given in

Chapter 10 Using the RMII Interface i.MX6 System Development User’s Guide

https://www.nxp.com/docs/en/user-guide/IMX6DQ6SDLHDG.pdf

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
418 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Will

one can try with latest nxp official linux release L4.14.78

linux-imx - i.MX Linux kernel 

and recheck pinmux settings for ENET_RX_DATA, check enet

signals with oscilloscope. May be useful to read guidelines given in

Chapter 10 Using the RMII Interface i.MX6 System Development User’s Guide

https://www.nxp.com/docs/en/user-guide/IMX6DQ6SDLHDG.pdf

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
417 Views
will_intelli
Contributor III

Hi,

It did turn out to be an issue with my pinmux settings, I had this configuration:

MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER   0x1b030

but the pin was connected to an interrupt line, the configuration must have been getting overwritten in u-boot.

Thanks,

Will.

0 Kudos