Part Number:TMS320C6678
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需要怎么配置吗?
Shine:
请先测一下loopback模式能调试通过吗?
,
user4192203:
在csl_SGMII_enableAutoNeotatiob后面加上csl_SGMII_isLoopbackModeEnabled之后,还是不能通过
,
user4192203:
status的寄存器显示
bIsLinkUp=0,bIsAutoNegError=0,bIsAutoNegComplete=0,bIsLocked=1
,
user4192203:
在configserdes配置接收寄存器为01f700621,发送寄存器为002108a1,在configsgmii函数里linkup可以通过
,
Shine:
看一下网口灯是否正常,跑一下STK里GE loopback,看是不是PHY那块的问题。https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_DSP_faq-keystone1
,
user4192203:
loopback可以通过,使用的网络隔离芯片是需要88e1111工作在100m,但88e1111的config管脚配置为1000m,需要通过mdio设置88e1111的寄存器。
mdio的初始化及读写程序在哪个例程可以找到?
,
Shine:
请参考上面STK软件包里的K1_STK_v1.1\common\KeyStone_GE_Init_drv.c里的KeyStone_MDIO_Init