SNLA437 December 2023 DP83822H , DP83822HF , DP83822I , DP83822IF , DP83826I
Using the terminal command "dmesg | grep mdio", there might be several clues on what's causing the PHY to not function appropriately from a software standpoint.
$ dmesg | grep "mdio"
One of the possible outputs is as follows:
$ mdio_bus xxx.ethernet-x: MDIO device at address 8 is missing
This message indicates that the PHY is not found on the MDIO bus, which could be caused by several issues, the most common one being a missing or incorrect device tree, but could also be due to a non-functional PHY or a bad SMI connection.
Once the PHY can be detected on the MDIO bus, another common error message is as follows:
$ Generic PHY xxx.ethernet-x: attached PHY driver [Generic PHY]
This message indicates that the driver file for the corresponding PHY is not loaded correctly or not present at all, and Linux loaded in a generic driver that most likely won't work with the PHY. In that case, verify that the driver successfully compiled and added to Linux, making sure the driver matches with the model of PHY used.
Finally, a message like this could display:
$ am65-cpsw-nuss c000000.ethernet eth3: PHY [c000f00.mdio:05] driver [TI DP83822] (irq=POLL)
This message shows that the PHY has the correct driver loaded and is detected successfully. Run ifconfig to verify the network interface is present.
Example ifconfig output when the PHYs are successfully recognized as network adapter(s):
root@j7-evm:~# ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 metric 1
ether 24:76:25:a2:62:8b txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 metric 1
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 82 bytes 6220 (6.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 82 bytes 6220 (6.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
The next step is to verify the successful data transfer.