UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

PL Ethernet with SFP module

Accepted Solution Solved
Adventurer
Posts: 71
Registered: ‎04-23-2014
Accepted Solution

PL Ethernet with SFP module

Hi,

 

I'm trying to get the AXI ethernet subsystem IP to work with an SFP module. This matches the design described in XAPP1082, however, I'm using a different board (AVNet Mini-ITX). I have created the block design as in XAPP1082, copied the relevant sections of the device tree and verified that all clocks have the right frequencies and that tx_disable is pulled low. I also verified that the memory addresses, interrupts and phy address in the device tree are correct. I'm using a Delock RJ45 module for testing, which is apparently just a rebranded Finisar module.

 

Unfortunately I'm not able to get the module working in Linux. Apparently, the module supports both, SGMII and 1000Base-X communication. I have tried both modes without success. The behavior in both modes is as follows:

 

SGMII mode

 

I set the IP core to SGMII mode and configure the module through I2C with either the register write sequence in the FSBL patch of XAPP1082, or with the write sequence that is given in the Finisar manual. The module acknowledges the write signals. After setting the module to SGMII mode with the appropriate register, the port status light of the connected switch lights up, signaling a connected device.

 

Linux prints the following messages during boot:

xilinx_axienet a0500000.axi-ethernet: TX_CSUM 2
xilinx_axienet a0500000.axi-ethernet: RX_CSUM 2
libphy: Xilinx Axi Ethernet MDIO: probed

However, when trying to bring up the interface through ifup I get the following messages:

net eth1: Promiscuous mode disabled.
xilinx_axienet a0500000.axi-ethernet: of_phy_connect() failed
net eth1: Promiscuous mode disabled.
ip: RTNETLINK answers: File exists

1000Base-X

 

The IP core is set to 1000Base-X mode. In this case the status LED at the switch lights up immediately after programming the FPGA. The boot logs are equal, but in this case I do not get the phy_connect error after ifup:

net eth1: Promiscuous mode disabled.
net eth1: Promiscuous mode disabled.
ip: RTNETLINK answers: File exists

However, two seconds or so after running ifup I get the following kernel log:

xilinx_axienet a0500000.axi-ethernet eth1: Error setting Axi Ethernet mac speed

Of course network communication doesn't work either in this case.

 

I can't really find any differences between my design and the one in XAPP1082. Any feedback on this problem would greatly welcome.


Accepted Solutions
Adventurer
Posts: 71
Registered: ‎04-23-2014

Re: PL Ethernet with SFP module

In case somebody else is facing this problem: I did get it running somehow,  but the solution isn't yet fully satisfactory.
 
I have been able to get the SPF module running in 1000Base-X mode, but not in SGMII mode. However, the auto negotiation is not working, which was causing the error in my initial post. According to the documentation, the SFP module should emulate the 1000Base-X auto negotiation.
 
So either the auto negotiation of the SFP module isn't working correctly or there's a bug in the kernel driver. I'm suspecting the latter one. Due to the failed auto negotiation, the kernel driver tries to set a transfer speed of 10 MBit/s, which is illegal for a 1000Base-X link. This triggers the "Error setting Axi Ethernet mac speed" error. Therefore I have patched the kernel driver to set a 1 GBit/s transfer speed by default instead.
 
For Xilinx kernel 2015.2 I modified the file:
./drivers/net/ethernet/xilinx/xilinx_axienet_main.c
 
Changed lines 572 to 575 from

        if ((phy->speed == SPEED_10) || (phy->speed == SPEED_100)) {
            if (lp->phy_type == XAE_PHY_TYPE_1000BASE_X)
                setspeed = 0;
        } else {


to:

         if ((phy->speed == SPEED_10) || (phy->speed == SPEED_100)) {
            if (lp->phy_type == XAE_PHY_TYPE_1000BASE_X) {
                printk("Illegal speed setting: %d\n", phy->speed);
                lp->phy_type = XAE_PHY_TYPE_1000BASE_X;
            }
        } else {

 
Then I used ethtool to configure the link manually:
#> ethtool -s eth1 speed 1000 duplex full autoneg off
 
Maybe ethtool also works with the unpatched kernel. I haven't yet tried that.
 
Regards

View solution in original post


All Replies
Highlighted
Adventurer
Posts: 71
Registered: ‎04-23-2014

Re: PL Ethernet with SFP module

I forgot to mention: of course I edit the phy-type parameter in the device tree when switching between SGMII and 1000Base-X mode.
Adventurer
Posts: 71
Registered: ‎04-23-2014

Re: PL Ethernet with SFP module

In case somebody else is facing this problem: I did get it running somehow,  but the solution isn't yet fully satisfactory.
 
I have been able to get the SPF module running in 1000Base-X mode, but not in SGMII mode. However, the auto negotiation is not working, which was causing the error in my initial post. According to the documentation, the SFP module should emulate the 1000Base-X auto negotiation.
 
So either the auto negotiation of the SFP module isn't working correctly or there's a bug in the kernel driver. I'm suspecting the latter one. Due to the failed auto negotiation, the kernel driver tries to set a transfer speed of 10 MBit/s, which is illegal for a 1000Base-X link. This triggers the "Error setting Axi Ethernet mac speed" error. Therefore I have patched the kernel driver to set a 1 GBit/s transfer speed by default instead.
 
For Xilinx kernel 2015.2 I modified the file:
./drivers/net/ethernet/xilinx/xilinx_axienet_main.c
 
Changed lines 572 to 575 from

        if ((phy->speed == SPEED_10) || (phy->speed == SPEED_100)) {
            if (lp->phy_type == XAE_PHY_TYPE_1000BASE_X)
                setspeed = 0;
        } else {


to:

         if ((phy->speed == SPEED_10) || (phy->speed == SPEED_100)) {
            if (lp->phy_type == XAE_PHY_TYPE_1000BASE_X) {
                printk("Illegal speed setting: %d\n", phy->speed);
                lp->phy_type = XAE_PHY_TYPE_1000BASE_X;
            }
        } else {

 
Then I used ethtool to configure the link manually:
#> ethtool -s eth1 speed 1000 duplex full autoneg off
 
Maybe ethtool also works with the unpatched kernel. I haven't yet tried that.
 
Regards

Visitor
Posts: 9
Registered: ‎04-02-2015

Re: PL Ethernet with SFP module

Hi

Thinks for you response on the AVENT forums http://zedboard.org/content/pl-ethernet-through-sfp.I use xilinx gig-eth-pcs-pma IP core implement sfp transmission and connect it to ps Ethernet mac through EMIO interface,like reference design xapp1082(ps_emio_sfp) on the picozed.And create corresponding devicetree.Linux boot message also show probe phy

succeed.But when I configure eth device ipaddress,terminal always print "macb e000c000.ethernet eth1: unable to generate target frequency: 25000000 Hz" message continuous.Maybe auto negotitation fail cause this result.

I think auto negotitation should be a linux kernel function but might not support currently,or as you say it's a bug in kernel driver.

I find xapp1082 was base on xilinx zc706 develop board kit,but zc706, picozed version1,picozed version2 and MINI-ITX schematic have different hardware design about sfp connector.I'm not sure if these have any effect.

Could you have any idea?

Adventurer
Posts: 71
Registered: ‎04-23-2014

Re: PL Ethernet with SFP module

Hi

 

Unfortunately I have not seen this frequency error before. Could this possibly be an issue with your reference clock?

 

About the auto negotiation: The file I patched is from the AXI ethernet driver from Xilinx. I don't quite know how much of the auto negotiation is implemented in this driver and how much in the mainline kernel. I'm not really experienced with network drivers, but if there is a kernel bug I would suspect it in the AXI ethernet driver.

 

I actually don't see any changes if I configure the SFP module through I2C to disable auto negotiation. It seems like the driver always defaults to the illegal 10 MBits/s.