This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

K2H SGMII to SGMII

Greetings,

I am trying to get SGMII to SGMII configuration working in the Linux kernel. I have updated the kernel to be up to date with TI revision f031f3a. 

The configuration is different from the eval board in that eth0 and eth1 are SGMII only, they do not have a PHY connected to them. So I am trying to do a loopback from eth0 to eth1. However, I do not even see the TX Packets: metric number increase when I try to ping out of that interface with the ping -I (that's a capital i) option. 

My dts is attached.

  • Hi,

    I hope, you can find the SGMII driver code is at: drivers/net/ethernet/ti/keystone_sgmii.c.
    The SGMII module on Keystone-II devices can be configured to operate in various modes. The modes are as follows, 

    • mac mac autonegotiate
    • mac phy
    • mac mac forced
    • mac fiber

    Refer the below wiki pages to get more detailed info.
    http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring#Network_Driver
    http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring#Ethernet_Driver
    http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring#10Gig_Ethernet_Driver

  • Hi Pubesh.

    If you had opened my .dts file you would see that I am following the wiki and have set slave0 and slave1 to link-interface = <2>;

    What is your recommended next step to debug this? 

    Once again to outline the issue, I bring up the interfaces using ifconfig eth0 up and I set the ip, gateway, but when I ping out using the ping -I flag I don't see the TX counter increment.

    Thanks.

  • Also, I am confirming that I am following the directions specified in SPRUGV9D—June 2013 KeyStone Architecture Gigabit Ethernet (GbE) Switch Subsystem User Guide, Procedure 2-7 SGMII to SGMII with Forced Link.

    I read back 0x9801 from MR_ADV_ABILITY, and I read back 0x20 from SGMII_CONTROL. When I read back STATUS I always get 0x30.

  • Hi Justin,

    You are right on usage of the "ping -I"

    Have you assigned the IP address for the both 'eth0' and 'eth1' ?

    Have you tried "ssh" command to test "eth0" and "eth1" ?

    Were you able to ping the K2H both ethernet devices from host PC ?

    ex:

    eth0 -> 10.100.1.94

    eth1 -> 10.100.1.93

    Commands :

    ubuntu-host$ ssh 10.100.1.93

    ubuntu-host$ ssh 10.100.1.94

    ubuntu-host$ ping 10.100.1.94

    ubuntu-host$ ping 10.100.1.93

    keystone-target$ ping -I eth1 10.100.1.93

  • Hi, Justin,

    In additon to the change in dts file, did you also change the link type in u-boot board_k2hk.c?

    Rex

  • Hi Rex. Yes here is what my eth cfg looks like:

    eth_priv_t eth_priv_cfg[] = {
        {
                .int_name       = "K2HK_EMAC0",
                .rx_flow        = 22,
                .phy_addr       = 1,
                .slave_port     = 1,
                .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
        },
        {
                .int_name       = "K2HK_EMAC1",
                .rx_flow        = 23,
                .phy_addr       = 2,
                .slave_port     = 2,
                .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
        },
        {
                .int_name       = "K2HK_EMAC2",
                .rx_flow        = 24,
                .phy_addr       = 0,    /* Make sure it matches PHY hw config */
                .slave_port     = 3,
                .sgmii_link_type = SGMII_LINK_MAC_PHY,
        },
        {
                .int_name       = "K2HK_EMAC3",
                .rx_flow        = 25,
                .phy_addr       = 3,
                .slave_port     = 4,
                .sgmii_link_type = SGMII_LINK_MAC_MAC_FORCED,
        },
    };

  • Justin,

    How about the uboot env variable, ethact? Do you have it set to EMAC2 or still at the default EMAC? If you already have it set to EMAC2 and still not working, then the only possible area will be where the phy_addr is for eth2. It really depends on the hardware design and should be reflected in eth initialization.

    Rex

  • Hi Rex,

    It is set to EMAC2, and that works just fine. My issue is ports 0 and 1, not 2.  I am able to run the digital loopback test with success on all ports, but when trying SGMII-to-SGMII we are unsuccessful. We have port 0 looped back to port 1 via cables in this test.

    Thanks,

    Justin

  • Hi, Justin,

    How do you connect port0 and port1 via cable if there is no phy? The way we tested SGMII ports is to have a AMC Breakout Card with 2 EVMs plugged into the BOC, and SoC1Port2 connected to SoC2Port2, SoC1Port3 to SoC2Port3 (in your case port 0 and 1) through the BOC. Then, ping from SoC1 to SoC2 the IP addresses assigned to the ports. We don't think connecting Port 2 and 3 (or your port 0 and 1) on the same SoC would work.

    The other way we tested also requires the 2nd EVM on the BOC which works as a switch by modifying the DTS file.With ethernet connection to the SoC2, both SGMII ports on SoC1 got served with IP addresses by DHCP through SoC2 switch.

    Rex

  • I am having a similiar problem, we are using a mac to mac connection, and I am able to get uboot to see the network just fine, but when linux is booting it is not able to find network. I have made the changes to the dts as shown in the wiki, changing the link-interface to a '2' for eth0. It seems like it isn't that simple. Anything else you recommend we try?