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!

Showing results for 
Search instead for 
Did you mean: 
Scholar wzab
Registered: ‎08-24-2011

Petalinux/Vivado 2017.4 - Ethernet via PCS/PMA and SFP in SGMII mode

In the previous versions of Petalinux/Vivado I had serious problems with getting the GEM to operate the PCS/PMA in SGMII mode at 100 Mb/s [1]. The problem seems to be solved in 2017.4, however there is still a problem with connection of the MDIO via hierarchy boundary in BD [2].


It is unclear if the GMII interface may be connected directly via the hierachy boundary between GMII_ENETx in PS and gmii_gem_pcs_pma in the PCS/PMA block. Analyzing the synthesized design I have found (see attached schematic.pdf) that the gmii_rx_clk gets connected to the ground. However, it seems that sometimes transmission works correctly (gmii_tx_clk is used both for TX and RX?). To ensure reliable operation, I connect the gmii_rx_clk individually from the gmii_rxclk line in the gmii_gem_pcs_pma interface in PCS/PMA to the emio_enetX_gmii_rx_clk in the GMII_ENETx interface in PS. I also connect emio_enetX_gmii_crs to constant '1' and emio_enetX_gmii_col to constant '0'.


The most important fact however is that it appeared, that the SFP-RJ45 modules require special configuration before they can be used in SGMII mode. For example in [3], there is the following recipe to configure the module:

  • write 0x9084 to 0x1B to Enable SGMII mode
  • write 0x0F00 to 0x09 to Advertise 1000BASE-T Full/Half-Duplex
  • write 0x8140 to 0x00 to Apply Software Reset
  • write 0x0de1 to 0x04 to Advertise 100/10BASE-T Full/Half-Duplex
  • write 0x9140 to 0x00 to Apply Software Reset

However, in my tests I have discovered, that it is necessary to manually switch off the GMII isolation, so it was necessary to replace 0x8140 with 0x8100 and 0x9140 with 0x9100 in the above procedure. The procedure may be performed even with i2ctools, however, it is necessary to swap bytes. The resulting code, assuming that SFPs are connected under address 0x56 (0xac) to busses 0,1 and 2 is shown below:


for a in 0 1 2 ; do
  i2cset -y ${a} 0x56 0x1b 0x8490 w
  i2cset -y ${a} 0x56 0x09 0x000f w
  i2cset -y ${a} 0x56 0x00 0x0081 w
  i2cset -y ${a} 0x56 0x04 0xe10d w
  i2cset -y ${a} 0x56 0x00 0x0091 w

After the above configuration, and reset of PCS/PMA, I was able to establish the communication in SGMII mode, with possibility to work both via 1Gb/s and 100 Mb/s links.


0 Kudos
1 Reply
Scholar wzab
Registered: ‎08-24-2011

Re: Petalinux/Vivado 2017.4 - Ethernet via PCS/PMA and SFP in SGMII mode

The problem should be definitely solved by the "phylink" layer ( https://lwn.net/Articles/667055/ )

Unfortunately it first appeared in the kernel 4.14-rc1, so we have to wait, until Petalinux offers kernel 4.14 or above.


0 Kudos