AnsweredAssumed Answered

Ethernet problem with i.MX 7Dual and DP83849IVS PHY

Question asked by Rasmus Rahunen on Dec 16, 2016
Latest reply on Jun 21, 2018 by Rasmus Rahunen

Hi all,

We have built our own i.MX 7Dual prototype board and its design is mostly based on i.MX 7Dual SABRE development kit reference design. But there are a few hardware changes; We have replaced the ethernet PHY chip with Texas Instruments DP83849IVS and we are using the RMII interface to connect to the PHY. We also use an external oscillator (ASFL1-50.000MHZ-EC-T) to provide the RMII reference clock.

We are using Yocto / Krogoth environment from https://github.com/Freescale/fsl-community-bsp-platform and our board configuration is based on the imx7dsabresd machine configuration. The Linux kernel version is 4.1.35. I have attached the ethernet device configuration and the pin muxing parts from the Linux device tree below that we have modified from the imx7d-sdb.dts.

The problem with our setup is that the ethernet connection doesn't seem to work at all. When checking the RMII TX data lines (ENET1_TDATA0, ENET1_TDATA1) with an oscilloscope, there is no activity on those lines at all... On the RX data lines, there seems to be some activity (ENET1_RDATA0, ENET1_RDATA1). But based on Linux boot logs, the device seems to boot up without major errors. If the network interface is brought down, the following error gets printed:

fec 30be0000.ethernet eth0: Graceful transmit stop did not complete!
We are also trying to bridge the connection from eth0 to eth1, this is made with a startup script and visible in the log where the "Graceful transmit stop did not complete!" occurs.

I have filtered some network related prints from the Linux boot log below. As you can see from the log, I haven't yet assigned MAC addresses, so Linux will use random MAC addresses. Can this cause problems? I've also tried setting the real MAC addresses in U-Boot and/or in Linux device tree, but it didn't change anything...

I have seen other users having similar problems here on the NXP community discussion groups and tried some of the suggested fix proposals. Here is a list of changes that have been made:

Can you see if there are any serious problems in the device tree configuration and the pin mux? What could explain the total silence in the data lines?

Also do I need to somehow configure the 50MHz clock to the fec1 and fec2 devices, since in our case it's provided from the external clock source and not from the processor PLL?

Best regards,
Rasmus Rahunen

 

UPDATE: 20-Dec-2016:

Corrected the comment that there is no activity on the TX data lines, but some traffic on RX data lines.

 

Device tree file:
&fec1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet1>;
    pinctrl-assert-gpios = <&gpio7 15 GPIO_ACTIVE_HIGH>;
 
    clocks = <&clks IMX7D_ENET_AXI_ROOT_CLK>,
        <&clks IMX7D_ENET_AXI_ROOT_CLK>,
        <&clks IMX7D_ENET1_TIME_ROOT_CLK>,
        <&clks IMX7D_PLL_ENET_MAIN_50M_CLK>,
        <&clks IMX7D_ENET1_REF_ROOT_CLK>;
    clock-names = "ipg", "ahb", "ptp",
        "enet_clk_ref", "enet_out";
 
    assigned-clocks = <&clks IMX7D_ENET1_TIME_ROOT_SRC>,
              <&clks IMX7D_ENET1_TIME_ROOT_CLK>;
    assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
    assigned-clock-rates = <0>, <100000000>;
    phy-mode = "rmii";
    phy-handle = <&ethphy0>;
    fsl,magic-packet;
    status = "okay";
 
    mdio {
        #address-cells = <1>;
        #size-cells = <0>;
 
        ethphy0: ethernet-phy@0 {
            compatible = "ethernet-phy-ieee802.3-c22";
            reg = <0>;
        };
 
        ethphy1: ethernet-phy@1 {
            compatible = "ethernet-phy-ieee802.3-c22";
            reg = <1>;
        };
    };
};
 
&fec2 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet2>;
 
    clocks = <&clks IMX7D_ENET_AXI_ROOT_CLK>,
        <&clks IMX7D_ENET_AXI_ROOT_CLK>,
        <&clks IMX7D_ENET2_TIME_ROOT_CLK>,
        <&clks IMX7D_PLL_ENET_MAIN_50M_CLK>,
        <&clks IMX7D_ENET2_REF_ROOT_CLK>;
    clock-names = "ipg", "ahb", "ptp",
        "enet_clk_ref", "enet_out";
 
    assigned-clocks = <&clks IMX7D_ENET2_TIME_ROOT_SRC>,
              <&clks IMX7D_ENET2_TIME_ROOT_CLK>;
    assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
    assigned-clock-rates = <0>, <100000000>;
    phy-mode = "rmii";
    phy-handle = <&ethphy1>;
    fsl,magic-packet;
    status = "okay";
};
 
&iomuxc {
    imx7d-sdb {
        pinctrl_enet1: pinctrl_enet1grp {
            fsl,pins = <
                MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0  0x00000001
                MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1  0x00000001
                MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC  0x00000001
                MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x00000001
                MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0  0x00000001
                MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1  0x00000001
                MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL 0x00000001
                MX7D_PAD_ENET1_TX_CLK__ENET1_TX_CLK        0x40000001
                MX7D_PAD_GPIO1_IO10__ENET1_MDIO            0x00000003
                MX7D_PAD_GPIO1_IO11__ENET1_MDC             0x00000003
                MX7D_PAD_ENET1_COL__GPIO7_IO15             0x00000034
            >;
        };
 
        pinctrl_enet2: pinctrl_enet2grp {
            fsl,pins = <
                MX7D_PAD_EPDC_BDR0__ENET2_TX_CLK           0x40000001
                MX7D_PAD_EPDC_GDRL__ENET2_RGMII_TX_CTL     0x00000001
                MX7D_PAD_EPDC_SDCE0__ENET2_RGMII_RX_CTL    0x00000001
                MX7D_PAD_EPDC_SDCE1__ENET2_RX_ER           0x00000001
                MX7D_PAD_EPDC_SDCE2__ENET2_RGMII_TD0       0x00000001
                MX7D_PAD_EPDC_SDCE3__ENET2_RGMII_TD1       0x00000001
                MX7D_PAD_EPDC_SDCLK__ENET2_RGMII_RD0       0x00000001
                MX7D_PAD_EPDC_SDLE__ENET2_RGMII_RD1        0x00000001
            >;
        };
...

Filtered Linux boot log:

NET: Registered protocol family 16
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
30be0000.ethernet supply phy not found, using dummy regulator
pps pps0: new PPS source ptp0
fec 30be0000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 30be0000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: c2:d4:df:69:a4:50
libphy: fec_enet_mii_bus: probed
fec 30be0000.ethernet eth0: registered PHC device 0
30bf0000.ethernet supply phy not found, using dummy regulator
pps pps1: new PPS source ptp1
fec 30bf0000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 30bf0000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: d6:51:d1:2d:7c:14
fec 30bf0000.ethernet eth1: registered PHC device 1
NET: Registered protocol family 26
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
INIT: Entering runlevel: 5
Configuring network interfaces... fec 30be0000.ethernet eth0: Freescale FEC PHY driver [NatSemi DP83849] (mii_bus:phy_addr=30be0000.etherne:00, irq=-1)
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
fec 30be0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
done.
Starting system message bus: dbus.
Starting Dropbear SSH server: dropbear.
Starting rpcbind daemon...done.
Starting bluetooth
bluetoothd
Starting syslogd/klogd: done
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon                       [ ok ]
Starting Telephony daemon
Starting Linux NFC daemon
Running local boot scripts (/etc/rc.local)fec 30be0000.ethernet eth0: Graceful transmit stop did not complete!
device eth0 entered promiscuous mode
device eth1 entered promiscuous mode
fec 30be0000.ethernet eth0: Freescale FEC PHY driver [NatSemi DP83849] (mii_bus:phy_addr=30be0000.etherne:00, irq=-1)
fec 30bf0000.ethernet eth1: Freescale FEC PHY driver [NatSemi DP83849] (mii_bus:phy_addr=30be0000.etherne:01, irq=-1)
IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
br0: port 1(eth0) entered forwarding state
br0: port 1(eth0) entered forwarding state
br0: port 1(eth0) entered disabled state
fec 30be0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
br0: port 1(eth0) entered forwarding state
br0: port 1(eth0) entered forwarding state
fec 30bf0000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
br0: port 2(eth1) entered forwarding state
br0: port 2(eth1) entered forwarding state
br0: port 1(eth0) entered forwarding state
br0: port 2(eth1) entered forwarding state
.

Outcomes