I'm experiencing a problem where U-Boot cannot ping because the PHY auto-negotiation has not occurred and/or times-out. This problem started when I created a new build based upon LSDKv21.08. My previous build based on LSDKv20.04 still works fine.
My board is a custom board modeled after the LS1012A-FRWY and LS1012A-RDB. My board has MAC0 using an SGMII interface to the Atheros PHY for pfe_eth0. I also have MAC1 using an RGMII interface, phy-less/fixed to another microcontroller but I'm not even trying to use this pfe_eth1 interface from U-Boot yet. The ping problem is with pfe_eth0.
I have added some printf statements to the code to show how LSDKv21.08 behaves differently from LSDKv20.04. The ethaddr, ipaddr, and ethact environment variables are set appropriately.
When I ping from LSDKv20.04 U-Boot 2019.10, I get this successful output:
Hit any key to stop autoboot: 0
=> ping 192.168.2.10
genphy_update_link() mii_reg = 0x0000796d
genphy_update_link() phydev->link = 0
genphy_update_link() phydev->autoneg = 1
genphy_update_link() autoneg already complete, reading link second time
Speed detected 3e8
Using pfe_eth0 device
host 192.168.2.10 is alive
=> ping 192.168.2.2
genphy_update_link() mii_reg = 0x0000796d
genphy_update_link() phydev->link = 1
genphy_update_link() phydev->autoneg = 1
genphy_update_link() return success because link up and BMSR_LSTATUS set
Speed detected 3e8
Using pfe_eth0 device
host 192.168.2.2 is alive
When I ping from LSDKv21.08 U-Boot 2021.04, I get this failed output:
Hit any key to stop autoboot: 0
=> ping 192.168.2.2
genphy_update_link() mii_reg = 0x0000794d
genphy_update_link() phydev->link = 0
genphy_update_link() phydev->autoneg = 1
pfe_eth0 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY pfe_eth0
ping failed; host 192.168.2.2 is not alive
=> ping 192.168.2.10
genphy_update_link() mii_reg = 0x0000794d
genphy_update_link() phydev->link = 0
genphy_update_link() phydev->autoneg = 1
pfe_eth0 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY pfe_eth0
ping failed; host 192.168.2.10 is not alive
Notice that with the LSDKv20.04 build, that the BMSR_ANEGCOMPLETE bit is set during initialization and auto-negotiation doesn't need to be performed for the ping. But with the LSDKv21.08 build BMSR_ANEGCOMPLETE does not get set during initialization so auto-negotiation is attempted but times-out.
How do I fix this problem where PHY auto-negotiation is failing on my LSDKv21.08 U-Boot build?
解決済! 解決策の投稿を見る。
Please refer to the following fix.
https://patchwork.ozlabs.org/project/uboot/patch/20220223132056.3364440-3-vladimir.oltean@nxp.com/
This is a know issue addressed in LSDK 21.08 user manual, please refer to the following.
The development team has not provided fix so far.
I will discuss this problem with SE team, will provide feedback later.
Please refer to the following fix.
https://patchwork.ozlabs.org/project/uboot/patch/20220223132056.3364440-3-vladimir.oltean@nxp.com/
I applied this patch and this fix works for me. U-Boot can ping successfully now. Thank you.