AnsweredAssumed Answered

imx6 RMII issue

Question asked by will o'neill on Jan 9, 2019
Latest reply on Jan 23, 2019 by will o'neill



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:  Bcast:  Mask:
             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";
    status = "okay";
    clocks = <&clks IMX6QDL_CLK_ENET>, <&clks IMX6QDL_CLK_ENET>;
    clock-names = "ipg", "ahb";



Any ideas what might be causing this?