AnsweredAssumed Answered

Custom IMX6D based board Ethernet issue (only in Linux)

Question asked by Neil Patel on Aug 1, 2019
Latest reply on Aug 5, 2019 by Neil Patel

Hi All,


I'm currently facing a strange Ethernet issue in Linux on a custom IMX6D board based on the sabresd reference design. The design uses an AR8031 PHY configured in RGMII mode , 1000-BaseX (with autonegotiation disabled, speed fixed to 1000Mbps,full duplex). I was able to get Ethernet working in U-boot (2019.04 fslc), in which I am able to ping and tftp Linux images onto the board. Once the board boots to Linux (4.14.117-fslc+g774f42075a4, initramfs image), I am able to bring up the interface (eth0) via ifconfig, talk to the AR8031 PHY via phytool (read and write to registers), but I am unable to ping (causes the board to hang).


/ # ifconfig eth0 netmask up
[   38.196024] [fec_main.c] <fec_enet_mii_probe> mdio_bus_id : 2188000.ethernet-1 , phy_id: 0x0
[   38.204720] [fec_main.c] <fec_enet_mii_probe> phy_name: 2188000.ethernet-1:00
[   38.211964] [phy_device.c]<phy_connect> bus_id = 2188000.ethernet-1:00
[   38.313674] [phy_device.c] <genphy_config_init>  phy features init
[   38.320400] [at803x.c] <at803x_config_init> genphy_config_init is ok
[   38.327518] Atheros 8031 ethernet 2188000.ethernet-1:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL)
[   38.341528] [phy.c]<phy_start_aneg_priv> phydev->autoneg = 0
[   38.348148] [phy_device.c] <genphy_setup_forced>  phy settings applied
[   38.356328] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
/ # [   39.363830] fec 2188000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   39.371636] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
/ # ifconfig
eth0      Link encap:Ethernet  HWaddr E2:36:31:54:12:34
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::e036:31ff:fe54:1234/64 Scope:Link
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:586 (586.0 B)
/ # ethtool [   64.483783] imx-sdma 20ec000.sdma: external firmware not found, using ROM firmware
ethtool: bad command line argument(s)
For more information run ethtool -h
/ # ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   1000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: g
        Wake-on: d
        Link detected: yes
/ #
/ # ethtool -S eth0
NIC statistics:
     tx_dropped: 0
     tx_packets: 10
     tx_broadcast: 0
     tx_multicast: 10
     tx_crc_errors: 0
     tx_undersize: 0
     tx_oversize: 0
     tx_fragment: 0
     tx_jabber: 0
     tx_collision: 0
     tx_64byte: 0
     tx_65to127byte: 10
     tx_128to255byte: 0
     tx_256to511byte: 0
     tx_512to1023byte: 0
     tx_1024to2047byte: 0
     tx_GTE2048byte: 0
     tx_octets: 836
     IEEE_tx_drop: 0
     IEEE_tx_frame_ok: 10
     IEEE_tx_1col: 0
     IEEE_tx_mcol: 0
     IEEE_tx_def: 0
     IEEE_tx_lcol: 0
     IEEE_tx_excol: 0
     IEEE_tx_macerr: 0
     IEEE_tx_cserr: 0
     IEEE_tx_sqe: 0
     IEEE_tx_fdxfc: 0
     IEEE_tx_octets_ok: 836
     rx_packets: 32
     rx_broadcast: 0
     rx_multicast: 0
     rx_crc_errors: 32
     rx_undersize: 0
     rx_oversize: 0
     rx_fragment: 0
     rx_jabber: 0
     rx_64byte: 0
     rx_65to127byte: 30
     rx_128to255byte: 2
     rx_256to511byte: 0
     rx_512to1023byte: 0
     rx_1024to2047byte: 0
     rx_GTE2048byte: 0
     rx_octets: 4004
     IEEE_rx_drop: 0
     IEEE_rx_frame_ok: 0
     IEEE_rx_crc: 32
     IEEE_rx_align: 0
     IEEE_rx_macerr: 0
     IEEE_rx_fdxfc: 0
     IEEE_rx_octets_ok: 0
/ #
/ # phytool print eth0/0
ieee-phy: id:0x004dd074
   ieee-phy: reg:BMCR(0x00) val:0x0140
      flags:          -reset -loopback -aneg-enable -power-down -isolate -aneg-restart -collision-test
      speed:          1000-full
   ieee-phy: reg:BMSR(0x01) val:0x614d
      capabilities:   -100-b4 +100-f +100-h -10-f -10-h -100-t2-f -100-t2-h
      flags:          +ext-status -aneg-complete -remote-fault +aneg-capable +link -jabber +ext-register
/ #


The interface is "UP" and "RUNNING", the AR8031 PHY LED_LINK1000 and LED_ACT leds light up, and Linux appears to be incrementing the TX byte counter, but RX bytes stay at 0 (in which the RX crc error count is the same as the RX packet count according to ethtool). As for the TX packets, I have Wireshark on my test PC I am using as a tftp server to load Linux, and I do NOT see any TX packets coming through (I do see network activity on Wireshark during U-boot ping/tftp commands as expected ). Any clues as to what would be causing this problem? I've been stuck on this problem for quite sometime and would really appreciate some help.


Thank you,