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.

TMS570LS3137: MDIO link status register not updated

Part Number: TMS570LS3137
Other Parts Discussed in Thread: DP83640

Hi all:

I’m working on the tms570ls3137 with an extend PHY DM9162. I was stuck in the EthPHYLinkStatusGet() process. When I look in I found it was the link status are different between PHY register and MDIO register. In PHY register the link status is valid, but the MDIO register is invalid. The link status has not been updated to MDIO register.

It seems like MDIO has the right configuration, registers can be read and write correctly! Why I got this issue? Anyone help me?
In addition the PHY address is 0x1F and the auto-negotiation has complete like the register shows.

This is the value of the PHY registers.

Basic Mode Control Register, addr: 0 v: 3100
Basic Mode Status Register, addr: 1 v: 786d
Auto-negotiation Advertisement Register, addr: 4 v: 01e1
Auto-negotiation Link Partner Ability Register, addr: 5 v: 45e1

Here is the EthPHYLinkStatusGet code where I stuck.
unsigned int EthPHYLinkStatusGet(unsigned int mdioBaseAddr, unsigned int phyAddr, volatile unsigned int retries)
{
volatile unsigned short linkStatus;
volatile unsigned int retVal = TRUE;

while (retVal == TRUE)
{
/* First read the BSR of the PHY */
MDIOPhyRegRead(mdioBaseAddr, phyAddr, PHY_BSR, &linkStatus);
if(linkStatus & PHY_LINK_STATUS)
{
/* Check if MDIO LINK register is updated */
linkStatus = MDIOPhyLinkStatusGet(mdioBaseAddr);
if(linkStatus)
DEBUG_PRINTF("mac linStatus %08x\r\n", linkStatus);

if(linkStatus & (1 << phyAddr))
{
break;
}
else
{
(retries != 0) ? retries-- : (retVal = FALSE);
}
}
else
{
(retries != 0) ? retries-- : (retVal = FALSE);
}
}


MDIOPhyRegRead(mdioBaseAddr, phyAddr, PHY_BCR, &linkStatus);
DEBUG_PRINTF("Basic Mode Control Register, addr: %d v: %04x\r\n", PHY_BCR, linkStatus);
MDIOPhyRegRead(mdioBaseAddr, phyAddr, PHY_BSR, &linkStatus);
DEBUG_PRINTF("Basic Mode Status Register, addr: %d v: %04x\r\n", PHY_BSR, linkStatus);
MDIOPhyRegRead(mdioBaseAddr, phyAddr, PHY_AUTONEG_ADV, &linkStatus);
DEBUG_PRINTF("Auto-negotiation Advertisement Register, addr: %d v: %04x\r\n", PHY_AUTONEG_ADV, linkStatus);
MDIOPhyRegRead(mdioBaseAddr, phyAddr, PHY_LINK_PARTNER_ABLTY, &linkStatus);
DEBUG_PRINTF("Auto-negotiation Link Partner Ability Register, addr: %d v: %04x\r\n", PHY_LINK_PARTNER_ABLTY, linkStatus);
//MDIOPhyRegRead(mdioBaseAddr, phyAddr, PHY_AUTONEG_ADV, &linkStatus);
//DEBUG_PRINTF("Basic Mode Control Register, addr: %d v: %04x\r\n", PHY_BCR, linkStatus);

return retVal;
}

Auto-negotiation Advertisement Register, addr: 4

Auto-negotiation Link Partner Ability Register, addr: 5 has a same define with Auto-negotiation Advertisement Register, addr: 4

This is the PHY Connection