6678外接了phy芯片88E1111,SGMIISERDESCLK=156.25MHz,pass clk input=100MHz
88E1111的硬件配置为
CONFIG0------LED_TX
CONFIG1------LED_LINK1000
CONFIG2------VDD
CONFIG3------LED_DUPLEX
CONFIG4------LED_LINK1000
CONFIG5-------LED_LINK10
CONFIG6-------DGND
--------------------------------------------------------------------------------------------------------------
//main程序:
//main pll init
.........
PA_PLL_init (20, 0);
//DDR PLL init
.....
//PowerUpDomains
.....
//configSerdes
unsigned int i;
CSL_SGMII_STATUS sgmii_status;
/* Unlock the chip configuration registers to allow SGMII SERDES registers to
* be written */
CSL_BootCfgUnlockKicker();
/* Configure the SERDES */
/* Multiply to be 8 with Quarter Rate in the Rx registers */
CSL_BootCfgSetSGMIIConfigPLL (0x00000081);
for(i=0; i<0xff; i++);
CSL_BootCfgSetSGMIIRxConfig (0, 0x00700621);
CSL_BootCfgSetSGMIITxConfig (0, 0x000108A1);
/* Poll the SGMII0 lock bit to confirm that the sgmii module has recognized
that the SERDES PLL has locked */
do
{
CSL_SGMII_getStatus(0, &sgmii_status);
} while (sgmii_status.bIsLocked != 1);
/* 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);
/////////////////////////////////////////////////////////////////////////////
//macPortNum=0
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 == 0) {
/* 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;
sgmiiCfg.bLinkUp = 1;
CSL_SGMII_setAdvAbility (macPortNum, &sgmiiCfg);
do
{
CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
} while (sgmiiStatus.bIsLinkUp != 1);
}
--------------------------------------------------------------------------------------------------------------
程序一直停留在while (sgmiiStatus.bIsLinkUp != 1);
1.不知道哪块配置出现了问题。
2.怎么配置MDIO读取phy的寄存器内容?
3.以太网交换机和GE交换机,EMAC需要怎么配置吗?