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.

6678 sgmiiStatus problem

Hello, all,

A problem troubled me for a long time, I designed a board based on 6678EVM, and also use 88E1111 as the PHY. I tested the demo GE, MAC, SGMII, and SERDES loopback are passed successfully. I connected the board with PC via copper, the LED_LINK1000 is lighting on, and the LED_RX is blinking. Then I test the platform with the following code:

CSL_BootCfgUnlockKicker();
CSL_BootCfgSetSGMIIConfigPLL (0x00000041);
platform_delaycycles(100);

CSL_BootCfgSetSGMIIRxConfig (1, 0x00700621);



CSL_BootCfgSetSGMIITxConfig (1, 0x000108A1);


do
{
CSL_SGMII_getStatus(1, &sgmii_status);
} while (sgmii_status.bIsLocked != 1);

CSL_SGMII_startRxTxSoftReset (1);
CSL_SGMII_disableMasterMode (1);
CSL_SGMII_enableAutoNegotiation (1);
CSL_SGMII_endRxTxSoftReset (1);

/* Setup the Advertised Ability register for this port:
* (1) Enable Full duplex mode
* (2) Enable Auto Negotiation
* (3) Enable the Link
*/
sgmiiCfg.linkSpeed = CSL_SGMII_1000_MBPS;
sgmiiCfg.duplexMode = CSL_SGMII_FULL_DUPLEX;
CSL_SGMII_setAdvAbility (1, &sgmiiCfg);

do
{
CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
} while (sgmiiStatus.bIsLinkUp != 1);//////////////////////////////////////////////////////////////////////////////////////////////In my project, it is running in infinite loop here

/* Wait for SGMII Autonegotiation to complete without error */
do
{
CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
if (sgmiiStatus.bIsAutoNegError != 0)
return; /* This is an error condition */
} while (sgmiiStatus.bIsAutoNegComplete != 1);

I know the sgmii is not link up, but I don't know what causes this, can you give me some guidance and advice? Thank you!!!!!!!

  • Hi Zhuang,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com).

    We will get back to you on the above query shortly. Thank you for your patience.

  • Hi,
    Sorry for the delay in response.
    Which example code are you working and modifying for your custom board ?
    EMAC example or PA example or client and hello world (NDK app) ?
    MCSDK package version ?
  • Hello, thank for your reply!

    I have tried all these codes actually, but the problem remains. The MSDK version I use now is MSDK_2_01_02_06. And I tried these codes on EVM board, all worked correctly. My board is designed based on the EVM board, the PHY chip is also 88E1111 and the circuit is also the same, so I think I don't need to modifying to much. Now my trouble is to find out where the problem occurs, PHY or MAC? Could you give me some advice? Thank you very much!!!

  • Hi,
    Thanks for your update.
    Have you modified the code, PLL,SERDES config etc., ?
    EMAC0 or EMAC1 ?
  • Hi, thank you for your attention. On my board, the SGMIICLK is 312.5MHZ, so the PLL config is:

    On my board, I only use the SGMII1,  

    and the function is:

    void configSerdes()
    {
        CSL_SGMII_STATUS sgmii_status;
        CSL_BootCfgUnlockKicker();
        CSL_BootCfgSetSGMIIConfigPLL (0x00000041);
        platform_delaycycles(100);
        CSL_BootCfgSetSGMIIRxConfig (0, 0x00700621);
        CSL_BootCfgSetSGMIIRxConfig (1, 0x00700621);
        CSL_BootCfgSetSGMIITxConfig (0, 0x000108A1);   
        CSL_BootCfgSetSGMIITxConfig (1, 0x000108A1);
        
        /* Poll the SGMII1 lock bit to confirm that the sgmii module has recognized
        that the SERDES PLL has locked */  
        do
        {
            CSL_SGMII_getStatus(1, &sgmii_status);
        } while (sgmii_status.bIsLocked != 1);
       
        /* All done with configuration. Return Now. */
        return;
    }

    and the SGMII SERDES config function code is:

    void Init_SGMII (uint32_t macPortNum)
    {
        CSL_SGMII_ADVABILITY    sgmiiCfg;
        CSL_SGMII_STATUS        sgmiiStatus;

        /* Reset the port before configuring it */
        CSL_SGMII_doSoftReset (macPortNum);
        while (CSL_SGMII_getSoftResetStatus (macPortNum) != 0);

         if (macPortNum == 1)
         {
            /* Hold the port in soft reset and set up
             * the SGMII control register:
             *      (1) Disable Master Mode
             *      (2) Enable Auto-negotiation
             */
            CSL_SGMII_startRxTxSoftReset (macPortNum);
            CSL_SGMII_disableMasterMode (macPortNum);
            CSL_SGMII_enableAutoNegotiation (macPortNum);
            CSL_SGMII_endRxTxSoftReset (macPortNum);

            /* Setup the Advertised Ability register for this port:
             *      (1) Enable Full duplex mode
             *      (2) Enable Auto Negotiation
             *      (3) Enable the Link
             */
            sgmiiCfg.linkSpeed      =   CSL_SGMII_1000_MBPS;
            sgmiiCfg.duplexMode     =   CSL_SGMII_FULL_DUPLEX;
            CSL_SGMII_setAdvAbility (macPortNum, &sgmiiCfg);

            do
            {
                CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
            } while (sgmiiStatus.bIsLinkUp != 1);

            /* Wait for SGMII Autonegotiation to complete without error */
            do
            {
                CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
                if (sgmiiStatus.bIsAutoNegError != 0)
                    return; /* This is an error condition */
            } while (sgmiiStatus.bIsAutoNegComplete != 1);
        }
        return;
    }

    Is there any problem with the code?

  • The code seems to be you haven't changed anything right ?
    In EVM board also, the SGMII clock is 312.5MHz.
  • Yes, you are right! My board has the same circuit with EVM board. But my board can't work, SGMII is not link up. I have run the GE demo, MAC, SGMII and SERDES loopback are all passed correctly. Do you konw GE demo? It is also a demo program written by aTI employee.
  • I suspect that any hw connection issues could be present on board between Ethernet port to PHY.

    e2e.ti.com/.../701158