SNLA450 July   2024 DP83822H , DP83822HF , DP83822I , DP83822IF , DP83826E , DP83826I , DP83848-EP , DP83848Q-Q1 , DP83867CR , DP83867CS , DP83867E , DP83867IR , DP83867IS , DP83TC812R-Q1 , DP83TC812S-Q1 , DP83TC813R-Q1 , DP83TC813S-Q1 , DP83TC814R-Q1 , DP83TC814S-Q1 , DP83TG720R-Q1 , DP83TG720S-Q1 , DP83TG721S-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Texas Instruments Ethernet PHY Drivers
  5. 2Ethernet PHY Driver Overview
    1. 2.1 Exploring Linux Driver Types
      1. 2.1.1 U-Boot Driver
      2. 2.1.2 Kernel Driver
  6. 3Driver Integration
    1. 3.1 Linux Device Tree
    2. 3.2 Integrating Driver
  7. 4Common Terminal Commands
    1. 4.1 Initialization Commands
      1. 4.1.1 dmesg | grep -i mdio
      2. 4.1.2 ifconfig
    2. 4.2 Functional Commands
      1. 4.2.1 Phytool
      2. 4.2.2 Ethtool
      3. 4.2.3 Forced Master/Slave
    3. 4.3 Diagnostic Commands
      1. 4.3.1 SQI
      2. 4.3.2 TDR
      3. 4.3.3 Throughput Testing - Ping and iPerf
  8. 5Summary
  9. 6References

dmesg | grep -i mdio

Dmesg is a Linux command that displays messages written to the kernel. The | symbol is known as the pipe command, which connects the output of one command directly into the input of another. Grep is a Linux command used to find strings and the -i parameter ignores the case of the string. Overall, dmesg | grep -i mdio finds all messages written to the kernel and filters for those containing mdio. The MDIO interface is how the processor can access the PHY's registers.

The purpose of this command is to confirm if the driver is loaded correctly or provide several debug clues on what is causing the PHY to misbehave from a software standpoint.

Examples of bad output:

davinci_mdio c000f00.mdio: phy[10]: device c000f00.mdio:0a, MDIO device at address 10 is missing.

This message indicates that the PHY is not found on the MDIO bus, which can be caused by several issues. The most common being a missing or incorrect device tree (see Section 3.1 for more information), but can also be due to a non-functional PHY or a bad MDIO connection.

Once the PHY can be detected on the MDIO bus, another common error message is:

am65-cpsw-nuss c000000.ethernet eth1: PHY [c000f00.mdio:0a] driver [Generic PHY] (irq=POLL)
davinci_mdio c000f00.mdio: phy[10]: device c000f00.mdio:0a, driver unknown

Both the driver unknown and Generic PHY messages indicate that the driver file is not loaded correctly, built, or completely missing; and Linux loaded a generic driver that won't function well with the PHY. In this case, verify that the driver was successfully compiled and added to Linux. See Section 3.2 for more information on this process.

Finally, an example of a good output looks like this:

root@j7-evm:~# dmesg | grep mdio
davinci_mdio 46000f00.mdio: phy[0]: device 46000f00.mdio:00, driver TI DP83867
am65-cpsw-nuss 46000000.ethernet eth0: PHY [46000f00.mdio:00] driver [TI DP83867] (irq=POLL)

Here we can see the phy[0] is identified as the DP83867 and assigned as port eth0

Note: PHY[n], where n represents the PHY Address can be different than the ethx where x represents which port that PHY is assigned to. For example, PHY address can be 8 while being assigned to port eth0.