Closed turmary closed 6 years ago
Hi Robert, Which branch should I commit, "v2018.03" or "v2018.05-rc1"?
later TI evm designs (am4x family) wire a gpio directly to the phy's reset line to accomplish this.
On the BBB family, the am3x's reset line is directly connected to the phy reset, so if you reset one you reset the other.
Regards,
Here is the linux patch we use to work-around this issue, well most of the time it works, just not 100%...
Regards,
OK Robert, I understand the linux patch and the connection of am335x's reset and the phy reset.
Instead of software warm reset the phy/am335x, I issue a Power-On reset to the board through RTCSS/PMIC if the phy's interface mode is RMII(it should MII mode when it's work). The RMII/MII mode could not be modified without a Power-On reset.
I think below patch could let the phy works 100% .
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c + /* + * Power-on reset the board if phy don't work + */ + if (!board_is_pb() + && (board_is_bone() + || (board_is_bone_lt() && !board_is_bone_lt_enhanced() && !board_is_m10a()) + || board_is_idk() + || board_is_beaglelogic() + ) + ) { + + struct phy_device *phy; + const char *devname; + unsigned short v; + int r; + + devname = miiphy_get_current_dev(); + phy = mdio_phydev_for_ethname(devname); + + if (phy != NULL && (phy->phy_id & 0xffff0) == 0x0007c0f0) { + /* LAN8710 Special Modes */ + r = miiphy_read(devname, phy->addr, 18, &v); + if (!r && (v & (0x1 << 14))) { + printf("PHY: %s not in MII mode\n", phy->drv->name); + + /* for some boards can't sleep, delay is needed here */ + mdelay(1000); + + /* Power On reset the board through a RTC controlled PMIC sleep & wakeup. + * Actually the board/PMIC will off then on + */ + rtcss_pmic_sleep(2, 2); + mdelay(2500); + } + } + }
I tried apply the above patch on U-boot branch v2018.05-rc1, but this branch can't bootup still now.
Regards,
I found BBB/BBG can't find ethernet phy sometimes and the u-boot print 'Could not get PHY for cpsw: addr 0'. There is a small posibility that the PHY(LAN8710A) enter RMII mode which will cause ethernet can't work without a power-on reset even in linux . A bad power (USB power is bad than DC power) will increse the posibility.
So I want to enumerate 32 phy addresses to find the phy real address, and power-on reset the board when it find the phy can't work, I will commit a pull request later with above function.