AnsweredAssumed Answered

imx7d - second ethernet port is not working with kernel 4.9.39

Question asked by Vinothkumar Eswaran on Jul 28, 2017
Latest reply on Mar 20, 2018 by Lakshmi shetty

Hello,

 

I am working on a compulab board -

CL-SOM-iMX7 | NXP (Freescale) i.MX 7 | System-on-Module | Computer-on-Module | CompuLab .

 

Currently I am trying to build the latest LTS kernel version for the board - Linux 4.9.39. I have added the necessary device tree changes. In imx7d.dtsi file which includes imx7s.dtsi, I could see that only one ethernet device (fec1) is added. So I have added the second ethernet device as in old dtsi files under aips3 section,

 

    fec2: ethernet@30bf0000 {
        compatible = "fsl,imx7d-fec", "fsl,imx6sx-fec";
        reg = <0x30bf0000 0x10000>;
        interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
            <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
            <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&clks IMX7D_ENET_AXI_ROOT_CLK>,
            <&clks IMX7D_ENET_AXI_ROOT_CLK>,
            <&clks IMX7D_ENET2_TIME_ROOT_CLK>,
            <&clks IMX7D_PLL_ENET_MAIN_125M_CLK>,
            <&clks IMX7D_ENET_PHY_REF_ROOT_CLK>;
        clock-names = "ipg", "ahb", "ptp",
            "enet_clk_ref", "enet_out";
        stop-mode = <&gpr 0x10 4>;
        fsl,num-tx-queues=<3>;
        fsl,num-rx-queues=<3>;
        fsl,wakeup_irq = <2>;
        status = "disabled";
    };

 

In my device tree file I have enabled the ethernet device by the following configuration:

 

&fec1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet1>;
    depends = "/soc/aips-bus@30800000/i2c@30a30000/pca9555@20";
    pinctrl-assert-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH> , <&pca9555 4 GPIO_ACTIVE_HIGH>;
    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 = "rgmii";
    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>;
    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 = "rgmii";
    phy-handle = <&ethphy1>;
    fsl,magic-packet;
    status = "okay";
};

 

I have builded the Linux kernel using Yocto (Pyro). After booting the device only eth0 is working fine, the second ethernet (eth1) port is  not working. After connecting the cable no lights are flashing and also the link is not coming up.

 

ifconfig shows only eth0 as shown below:

 

root@alen-iot-gateway:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:01:C0:1E:36:B1  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

lo        Link encap:Local Loopback  
           inet addr:127.0.0.1  Mask:255.0.0.0

 

 

ifconfig -a shows both devices as shown below:

 

root@alen-iot-gateway:~# ifconfig -a

 

eth0      Link encap:Ethernet  HWaddr 00:01:C0:1E:36:B1  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

eth1      Link encap:Ethernet  HWaddr 3A:00:FC:9E:6B:4F  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

When I tried to run 'ifconfig eth1 up'  i get the following error message:

 

root@alen-iot-gateway:~# ifconfig eth1 up
ifconfig: SIOCSIFFLAGS: No such device
root@alen-iot-gateway:~# ifconfig eth1 down
root@alen-iot-gateway:~# ifconfig eth1 up
ifconfig: SIOCSIFFLAGS: No such device

 

with ethtool I get the following error messages,

 

root@alen-iot-gateway:~# ethtool eth1
Settings for eth1:
Cannot get device settings: No such device
        Supports Wake-on: g
        Wake-on: d
        Link detected: no

 

The dmesg for ethernet is shown below:

dmesg | grep -i eth
Atheros(R) L2 Ethernet Driver - version 2.2.3
30be0000.ethernet supply phy not found, using dummy regulator
fec 30be0000.ethernet eth0: registered PHC device 0
30bf0000.ethernet supply phy not found, using dummy regulator
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: 3a:00:fc:9e:6b:4f
fec 30bf0000.ethernet eth1: registered PHC device 1
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Atheros 8031 ethernet 30be0000.etherne:00: attached PHY driver [Atheros 8031 ethernet] (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 - 1Gbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

 

 

Not sure on what configuration is missing for the ethernet port. Any information on the topic would be helpful. Let me know if any further logs are required

 

Thanks & Regards,

Vinothkumar

Outcomes