我们自研的单板使用BCM5461作为千兆以太网的PHY芯片,连接到C6678的SGMII0接口上。我们的硬件连接关系与C6678的Demo板主要有三个不同:
1:,Demo板使用88E1111,而我们的PHY芯片是BCM5461
2,Demo板连接到SGMII1上,而我们连接到SGMII1上
3,Demo板的以太网接口输入时钟是312.5MHz,而我们的输入时钟是156.25MHz
我们的驱动程序只是对SGMII0接口做了如下的配置修改:
CSL_BootCfgSetSGMIIConfigPLL(0x00000081);
也就是只是将PLL配置由0x00000041改为了0x00000081.
其他地方未做任何修改。
但是Demo板SGMII接口可以link up,而我们的单板不能link up。
测量时钟电源及Serdes眼图都很好。
不知道我们单板SGMII接口为何不能link up?
谢谢
Meng Zhang4:
帮顶,希望有人尽快解答这个问题!
shu jun:
回复 Meng Zhang4:
楼主解决啦没有啊 ,我也遇到一样的问题!求大侠解决
Kevin Cai:
回复 shu jun:
Hi, 您好!
您是用下面这组代码去初始化SGMII的吗?这组代码只初始化了端口1, 没有 初始化端口0, 您需要修改端口(加粗部分)
如果您不是用的这组代码,你是否方便贴一下您的SGMII代码
谢谢
Int32 Init_SGMII (UInt32 macPortNum){ CSL_SGMII_ADVABILITY sgmiiCfg; CSL_SGMII_STATUS sgmiiStatus; /* Configure SGMII Port 1 only since it is connected to RJ45 at all known EVMs */ if(cpswSimTest || (macPortNum == 1)) { /* Reset the port before configuring it */ CSL_SGMII_doSoftReset (macPortNum); while (CSL_SGMII_getSoftResetStatus (macPortNum) != 0);
/* Hold the port in soft reset and set up * the SGMII control register: * (1) Enable Master Mode (default) * (2) Enable Auto-negotiation */ CSL_SGMII_startRxTxSoftReset (macPortNum); if (cpswLpbkMode == CPSW_LOOPBACK_NONE) { CSL_SGMII_disableMasterMode (macPortNum); } else { CSL_SGMII_enableMasterMode (macPortNum); if (cpswLpbkMode == CPSW_LOOPBACK_INTERNAL) { CSL_SGMII_enableLoopback (macPortNum); } } /* Setup the Advertised Ability register for this port: * (1) Enable Full duplex mode * (2) Enable Auto Negotiation */ sgmiiCfg.linkSpeed = CSL_SGMII_1000_MBPS; sgmiiCfg.duplexMode = CSL_SGMII_FULL_DUPLEX; CSL_SGMII_setAdvAbility (macPortNum, &sgmiiCfg); CSL_SGMII_enableAutoNegotiation (macPortNum); CSL_SGMII_endRxTxSoftReset (macPortNum); /* Wait for SGMII Link */ if (!cpswSimTest) { 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 -1; } while (sgmiiStatus.bIsAutoNegComplete != 1); /* * May need to wait some more time for the external PHY to be ready to transmit packets reliabily. * It is possible to access the PHY status register through the MDIO interface to check when * the PHY is ready. * To avoid platform-dependent code, we just introduce about 2ms wait here */ if((cpswLpbkMode == CPSW_LOOPBACK_EXTERNAL) || (cpswLpbkMode == CPSW_LOOPBACK_NONE)) CycleDelay(2000000); } }
/* All done with configuration. Return Now. */ return 0;}
shu jun:
回复 Kevin Cai:
找到问题的根源是sgmii的时钟不精准
zhuang jiao:
回复 shu jun:
怎么可以确定是因为时钟的不精准呢?我测了一下EVM上的312.5M和我们自己板子的没什么差别啊,时钟的PLL_LOCK也可以正常锁定,请问你们是怎么解决的呢?
changzheng chen:
回复 shu jun:
你好,我们碰到了相同的问题,就是phy 88E1111和DSP 6678 sgmii link不成功,sgmii 和serdes的loopback都是成功的,phy 88E1111也换了一块新片子,sgmii时钟不精准,回环能成功吗?