There are several different tools available in a Linux environment to read and write registers on a TI PHY. Several of these options are listed below.
MII read:
This is the only command which can and must be used in U-boot. Stop the autoboot process as shown here, and type the following:
“mii read {PHY ID} {register address}”
“mii write {PHY ID} {register address} {value}”
Registers 0x0-0x5 can also be used with the mii dump command to see the function of each bit. Use the following syntax: “mii dump {PHY ID} {register address (0-5)}”
PHYtool:
This tool is used post-boot. This tool is already integrated into TI SDK’s but can be downloaded by typing the following “sudo apt-get install -y net-tools”. To use the tool, type the following:
phytool read {Interface}/{PHY ID}/{register address}
phytool write {Interface}/{PHY ID}/{register address} {value}
To print a dump of all registers 0x0-0x1f, you can use the following command: “x=0; while [ $x -le 31 ]; do printf "Register 0x%02X = " $x ; phytool read eth0/0/$x $(( x++ )) ; done”
MDIO-tool:
To install mdio-tool, use the following commands:
git clone https://github.com/Yannik25/mdio-tool
cd mdio-tool
cmake ./
make
make install
To use the tool: