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.

CCS/TMDSEVM6678: how can i configure to SGMII(1) forced 100 mbps half-duplex fixed mode???

Part Number: TMDSEVM6678

Tool/software: Code Composer Studio

hi

i'm newbie

i want to set SGMII(1) config to forced 100 mbps half-duplex mode 

so, now i'm trying to config and check sgmii(1) linkspeed in C6678 EVM board

but always performs auto-negotiation.....

how can i configure to SGMII(1) forced 100 mbps half-duplex fixed mode???

memory browser is below

pc side is below

i read below in sprugv9d

my code is below...

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

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

if (macPortNum == 1) {
// forced 100 mbps half duplexmode 
CSL_SGMII_startRxTxSoftReset (macPortNum);
CSL_SGMII_enableMasterMode (macPortNum);
//CSL_SGMII_disableMasterMode (macPortNum);
CSL_SGMII_disableAutoNegotiation (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_100_MBPS;
sgmiiCfg.duplexMode = CSL_SGMII_HALF_DUPLEX;
sgmiiCfg.bLinkUp = 1;
CSL_SGMII_setAdvAbility (macPortNum, &sgmiiCfg);

do
{
CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
printf("bIsLinkup:%d\n",sgmiiStatus.bIsLinkUp);
} while (sgmiiStatus.bIsLinkUp != 1);

/* Reset MAC Sliver 0 */
CSL_CPGMAC_SL_resetMac (macPortNum);
while (CSL_CPGMAC_SL_isMACResetDone (macPortNum) != TRUE);

CSL_CPGMAC_SL_enableExtControl (macPortNum);

#endif // forced link mode 
}

/* All done with configuration. Return Now. */
return;
}

 

  • Hi,

    Something to clarify:

    • You use TI 6678 EVM. SGMII (1) is this zero based or 1 based? From your register view 0x2090200, I believe you meant 0-based. There is SGMII 0 and SGMII 1.
    • SGMII 1 is connected to the RJ-45 port and you directly connect to a PC with Ethernet cable?

    There is SGMII setup code inside pdk_c667x_2_0_16\packages\ti\drv\pa\example\emacExample\src\c66x\bios\cpsw_mgmt.c, Init_SGMII(). Without change anything, can you make sure you can have 1G link work? That is,        /* Wait for SGMII Link */ code pass without stuck polling sgmii link status bits?

    If yes, can you just change below if works?

    sgmiiCfg.linkSpeed = CSL_SGMII_1000_MBPS;
    sgmiiCfg.duplexMode = CSL_SGMII_FULL_DUPLEX

    Regards, Eric

  • thanks for reply~

    • You use TI 6678 EVM. SGMII (1) is this zero based or 1 based? From your register view 0x2090200, I believe you meant 0-based. There is SGMII 0 and SGMII 1.
      • i use SGMII Port 2 and SGMII Port2 is SGMII 1.

    • SGMII 1 is connected to the RJ-45 port and you directly connect to a PC with Ethernet cabl?
      • YES

    There is SGMII setup code inside pdk_c667x_2_0_16\packages\ti\drv\pa\example\emacExample\src\c66x\bios\cpsw_mgmt.c, Init_SGMII(). Without change anything, can you make sure you can have 1G link work? That is,        /* Wait for SGMII Link */ code pass without stuck polling sgmii link status bits?

    i was tested auto-negotiation ( 1000Gbps and Full duplex ) , 

    that was working fine ( linkUp / linkSpeed / duplex is OK and NIMU Ping is OK)

    but i want to set to forced mode ( 100 Mbps and Half duplex )

    so i'm trying to configuration change for forced mode....

    i was set  CSL_SGMII_setAdvAbility() to CSL_SGMII_100_MBPS and CSL_SGMII_HALF_DUPLEX

    CSL_SGMII_getAdvAbility() was CSL_SGMII_100_MBPS and CSL_SGMII_HALF_DUPLEX

    but, CSL_SGMII_getLinkPartnerAdvAbility() was CSL_SGMII_1000_MBPS and CSL_SGMII_FULL_DUPLEX

    phy ( Marvel 88E1111) is seems to be working to auto-nego.

    how can i set to forced 100 Mbps and Half duplex ??

  • Hi,

    Thanks for the information! The C6678 EVM has a Marvell 88E1111 PHY connected to the RJ-45 port. Only configuring the SGMII register (speed, duplex/half duplex, master/slave, auto-negotiation/forced) are not enough, the PHY needs to be configured into the same mode as the MAC of the C6678, this will be done over the MDIO port to change the registers in the PHY.

    What is your purpose for this? Only for testing or you are designing your own board and using TI EVM as a proxy for Ethernet mode configuration? Will put a 10/100Mbps switch or router in between C6678 EVM and PC (to limit the network to 100Mbps) work for this purpose?

    Regards, Eric

  • Thanks for reply~!

    i resolved this problem.

    that was a 88E1111 PHY config problems...

    thanks for your helps~

    Regards, JC