Forum Discussion
Altera_Forum
Honored Contributor
15 years agoI guess the code is using the wrong set of registers for detecting the PHY, it works fine (tested with ping, dhcp, etc) if I use the second set. I changed the detection code:
from: for (phy_addr = 0x0; phy_addr < 0xFF; phy_addr++) { /* set the phy address to the mac map data */ writel(phy_addr, ATSE_MAC_REG_MDIO_ADDR_0); phy_id_1 = readl(ATSE_MAC_REG_MDIO_SPACE_0 + ATSE_PHY_ID_1_OFFSET); phy_id_2 = readl(ATSE_MAC_REG_MDIO_SPACE_0 + ATSE_PHY_ID_2_OFFSET); if (phy_id_1 != phy_id_2) { found_phy = 1; break; } To: for (phy_addr = 0x0; phy_addr < 0xFF; phy_addr++) { /* set the phy address to the mac map data */ writel(phy_addr, ATSE_MAC_REG_MDIO_ADDR_1); phy_id_1 = readl(ATSE_MAC_REG_MDIO_SPACE_1 + ATSE_PHY_ID_1_OFFSET); phy_id_2 = readl(ATSE_MAC_REG_MDIO_SPACE_1 + ATSE_PHY_ID_2_OFFSET); if (phy_id_1 != phy_id_2) { found_phy = 1; break; } Ill go through the TSE docs again and create the right patch so it works in all modes.