Forum Discussion
Altera_Forum
Honored Contributor
10 years agoIs the below change an appropriate fix ?
I found that I needed to change the below code in BSP\drivers\src\altera_avalon_tse.c in the alt_tse_phy_restart_an() function. Adding a 1 second sleep in this while loop allows background tasks (we use uCOS2) to have some cpu cycles. A timeout of 10 seconds would be sufficient. The iNiche network initialization (again initialization only) is also on a task as well. while(alt_tse_phy_rd_mdio_reg(pphy, TSE_PHY_MDIO_STATUS, TSE_PHY_MDIO_STATUS_AN_COMPLETE, 1) == 0 ) { usleep(1000000); /* sleep for 1 second */ /* change to time out after 10 seconds */ if(timeout++ > 10 /*timeout_threshold*/) { tse_dprintf(4, "WARNING : PHY[%d.%d] - Auto-Negotiation FAILED\n", mac_group_index, mac_info_index); /* Restore previous MDIO address */ alt_tse_phy_wr_mdio_addr(pphy, mdioadd_prev); return TSE_PHY_AN_NOT_COMPLETE; } }