Hi;
I am trying to configure SGMII.Although I can send and receive packet if i can loopback EMAC, i coulndt achive the loopback operation at SGMII. here my code.
I try different ways ( slave, master .. ) but i couldnt achive it. any idea pls ?
init_sgmii()
{
Uint32 i,stat,csl_errors=0;
SGMII_Config SgmiiCfg;
i = SGMII_reset();
if ( i == 0 )
printf("Only on CORE 0: SGMII reset successful........\n");
else
{
csl_errors++;
printf("Only on CORE 0: SGMII reset NOT successful........\n");
}
SgmiiCfg.masterEn = 0x0;
SgmiiCfg.loopbackEn = 0x1;
//SgmiiCfg.txConfig = 0x00000ea1;
SgmiiCfg.txConfig = 0x000001;
SgmiiCfg.rxConfig = 0x0001;
SgmiiCfg.auxConfig = 0x0000000b;
SgmiiCfg.modeOfOperation = 0x1; //NO Auto Negotiation
i = SGMII_config(&SgmiiCfg);
if( i == 0 )
printf("Only on CORE 0: SGMII config successful........\n");
else
{
csl_errors++;
printf("Only on CORE 0: SGMII config NOT successful........\n");
return i;
}
//#ifdef PHY_MODE_100MBPS
//SGMII_REGS->MR_ADV_ABILITY = 0x9401;
//#endif
/* wait for the Link to Come Up */
do
{
stat = SGMII_REGS->STATUS;
stat = stat & 0x1;
} while( stat != 0x1 );
printf("Only on CORE 0: SerDes should be up and running \n");
}