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.

AM6442: Boot over ethernet "phy_startup failed" error

Part Number: AM6442
Other Parts Discussed in Thread: AM6422

Hello

I have AM6422 board. I using os build with Yocto. I try to boot my board over ethernet. I setup dhcp and tftp server. When board started to download tispl.bin the error occurred:

am65_cpsw_nuss_port ethernet@8000000port@2: phy_startup failed
am65_cpsw_nuss_port ethernet@8000000port@2: am65_cpsw_start end error

I figure it out that this error message is thrown in am65-cpsw-nuss.c in 

 ...   
    ret = phy_startup(priv->phydev);

	if (ret) {

		dev_err(dev, "phy_startup failed\n");

		goto err_dis_rx;

    }
...

The phy_startup() function is defined in drivers/net/phy/phy.c and it calls function pointer which points to genphy_startup which finally calls genphy_update_link(). The exact error is thrown in while loop:

int genphy_update_link(struct phy_device *phydev)

{

	unsigned int mii_reg;



	/*

	 * Wait if the link is up, and autonegotiation is in progress

	 * (ie - we're capable and it's not done)

	 */

	mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);



	/*

	 * If we already saw the link up, and it hasn't gone down, then

	 * we don't need to wait for autoneg again

	 */

	if (phydev->link && mii_reg & BMSR_LSTATUS)

		return 0;



	if ((phydev->autoneg == AUTONEG_ENABLE) &&

	    !(mii_reg & BMSR_ANEGCOMPLETE)) {

		int i = 0;



		printf("%s Waiting for PHY auto negotiation to complete",

		       phydev->dev->name);

		while (!(mii_reg & BMSR_ANEGCOMPLETE)) {

			/*

			 * Timeout reached ?

			 */

			if (i > (PHY_ANEG_TIMEOUT / 50)) {

				printf(" TIMEOUT !\n");

				phydev->link = 0;

				return -ETIMEDOUT;

			}



			if (ctrlc()) {

				puts("user interrupt!\n");

				phydev->link = 0;

				return -EINTR;

			}



			if ((i++ % 10) == 0)

				printf(".");



			mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);

			mdelay(50);	/* 50 ms */

		}

		printf(" done\n");

		phydev->link = 1;

	} else {

		/* Read the link a second time to clear the latched state */

		mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);



		if (mii_reg & BMSR_LSTATUS)

			phydev->link = 1;

		else

			phydev->link = 0;

	}



	return 0;

}

It seems that function phy_read return incorrect value. I also tried to patch the code and replace MDIO_DEVAD_NONE with MDIO id 0x1f for DP83867 phy device but this not resolve the issue. My questions are:

1. Why MDIO_DEVAD_NONE is used? This is not correct MDIO id for this device

2. This problem also appears on SDK image. How to solve it?

 

And question less related to topic:

1. What is the purpose ot tiboot3.bin firmware?

Thank you for response

BR

Jakub