cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Visitor
Visitor
4,225 Views
Registered: ‎06-08-2017

Zynq dual ethernet - only eth0 works

I have a Zynq 7030 configured to use both eth0 and eth1.  The MDO configuration is both through EMIO.  I have the Zync processing block connected to two GMII_to_RGMII blocks.  These blocks are then connected to the external phy's.  Below is the device tree information.  This is what the petalinux 2017.1 generator plus what I added for my phy's.

 

&gem0 {
    status = "okay";
    compatible = "xlnx,ps7-ethernet-1.00.a";
    phy-handle = <&phy4eth0>;
    gmii2rgmii-phy-handle = <&gmii_to_rgmii_0>;
    local-mac-address = [00 0a 35 00 00 01];
    phy-mode = "gmii";
    clock-names = "ref_clk", "aper_clk";
    clocks = <&clkc 13>, <&clkc 30>;
    xlnx,ptp-enet-clock = <0x69f6bcb>;
    ps7_ethernet_0_mdio: mdio {
        #address-cells = <1>;
        #size-cells = <0>;
        phy4eth0: phy@4 {
            compatible = "ethernet-phy-ieee802.3-c22";
            device_type = "ethernet-phy";
            reg = <4>;
        };
        gmii_to_rgmii_0: phy@8 {
            device_type = "ethernet-phy";
            reg = <8>;
        };
    };
};

&gem1 {
    status = "okay";
    compatible = "xlnx,ps7-ethernet-1.00.a";
    phy-handle = <&phy4eth1>;
    gmii2rgmii-phy-handle = <&gmii_to_rgmii_1>;
    local-mac-address = [00 0a 35 00 00 02];
    phy-mode = "gmii";
    clock-names = "ref_clk", "aper_clk";
    clocks = <&clkc 14>, <&clkc 31>;
    xlnx,ptp-enet-clock = <0x69f6bcb>;
    ps7_ethernet_1_mdio: mdio {
        #address-cells = <1>;
        #size-cells = <0>;
        phy4eth1: phy@4 {
            compatible = "ethernet-phy-ieee802.3-c22";
            device_type = "ethernet-phy";
            reg = <4>;
        };
        gmii_to_rgmii_1: phy@8 {
            device_type = "ethernet-phy";
            reg = <8>;
        };
    };
};

And this is the default device tree values that petalinux 2017.1 generated:

 

gem0: ethernet@e000b000 {
            compatible = "cdns,zynq-gem", "cdns,gem";
            reg = <0xe000b000 0x1000>;
            status = "disabled";
            interrupts = <0 22 4>;
            clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
            clock-names = "pclk", "hclk", "tx_clk";
            #address-cells = <1>;
            #size-cells = <0>;
        };

        gem1: ethernet@e000c000 {
            compatible = "cdns,zynq-gem", "cdns,gem";
            reg = <0xe000c000 0x1000>;
            status = "disabled";
            interrupts = <0 45 4>;
            clocks = <&clkc 31>, <&clkc 31>, <&clkc 14>;
            clock-names = "pclk", "hclk", "tx_clk";
            #address-cells = <1>;
            #size-cells = <0>;
        };

The problem is that only eth0 ever works.  I tried swapping the connections from the phy's and the gmii_to_rgmii blocks and still only eth0 worked.  So I'm confident my hardware is okay and that the problem is either in the gmii_to_rgmii_1 block or the ethernet driver.

 

There are no errors reported by the driver (xilinx_emacps) when it is insmod'ed, and when I ping something I see the Tx packets increment but the Rx counter is always 0 (so is the error counter).  I tried DHCP and static IP assignment.

 

I'm sorry this is such a basic question - I've done the googling and found lots of reports of people having issues with the second ethernet dating back to 2015.  But I haven't had any luck finding a solution!  Has anyone else used dual ethernets in this configuration before?  Any ideas about what I'm doing wrong?

0 Kudos
Reply
4 Replies
Scholar
Scholar
4,217 Views
Registered: ‎02-27-2008

Does you board support the connection?

 

See Xapp 1082. Figure 1.

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Reply
Moderator
Moderator
4,184 Views
Registered: ‎08-25-2009

@galem So first, emacps driver is deprecated for a long time (since~2013). We have not used/tested this on any recent kernels. Then, for dual Ethernet support, there is a mdio multi-phy patch needed for MACB drivers.

 

Here is an old thread; and I hope it helps:

https://forums.xilinx.com/t5/Embedded-Linux/Dual-Marvell-88e1512-PHY-Ethernet-problem-Xilinx-LInux/td-p/682660/page/3

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Reply
Visitor
Visitor
4,082 Views
Registered: ‎06-08-2017

I tried to follow the instructions from that post, but I wasn't able to get the patch to apply properly.  I tried manually massaging the patch in, but then I wasn't able to get either ethernet to work!

 

I went back to 2017.1 petalinux and compiled in the mabc and removed the emapcps driver.  eth0 starts up, but I don't think it is able to set the clock frequency because it only works when use ethtool to set the speed to 10Mbit.  eth1 does not work at all.  I tried to massage the patch you indicated in to this driver but then neither ethernet worked!

 

 

0 Kudos
Reply
Xilinx Employee
Xilinx Employee
4,079 Views
Registered: ‎08-02-2007

hi,

 

can you apply the below patch? https://www.xilinx.com/support/answers/69132.html

 

--hs

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Reply